Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE dumps leak user names etc #128594

Open
Tracked by #128914
matthiaskrgr opened this issue Aug 3, 2024 · 6 comments
Open
Tracked by #128914

ICE dumps leak user names etc #128594

matthiaskrgr opened this issue Aug 3, 2024 · 6 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

When you trigger an ICE, rustc generates this stacktrace file and prints its location as absolute path:

note: please attach the file at /home/matthias/vcs/github/rust/rustc-ice-2024-08-03T09_07_05-3443169.txt to your bug report

This absolute path is part of the backtrace and often copied into the ticket and can contain sensitive information such as users real names or where they work, when its a work computer, etc...

Can we make this a relative path?
cc @estebank

@matthiaskrgr matthiaskrgr added the C-bug Category: This is a bug. label Aug 3, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 3, 2024
@jieyouxu
Copy link
Member

jieyouxu commented Aug 3, 2024

Pretty sure long ty names written to disk also has this issue
EDIT: opened #129296 so that is separately tracked.

@jieyouxu jieyouxu added the A-diagnostics Area: Messages for errors, warnings, and lints label Aug 3, 2024
@Noratrieb
Copy link
Member

making it a relative path would likely hurt usability, cargo sets the working directory to the crate source which is not necessarily the working directory of the user. it would be bad if they couldn't just copy paste the path and open it.

@matthiaskrgr
Copy link
Member Author

Ah good point, in case a crate dependency causes the ICE, the backtrace file gets dumped into random dirs inside the $CARGO_HOME which is even worse (registry crate sources really shouldn't be altered at all during builds...), see #128484 for an example.

We could probably fix 99% of the cases by checking if there is a something like a /tmp and using that one if available?

@bjorn3
Copy link
Member

bjorn3 commented Aug 3, 2024

Could we replace a prefix matching the user's home dir with ~/ on Unix and with %userprofile% on Windows (or assume that most Windows users understand the ~/ syntax too)?

@jieyouxu jieyouxu added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed C-bug Category: This is a bug. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Aug 4, 2024
@estebank
Copy link
Contributor

estebank commented Aug 4, 2024

I think that we can likely use a combination of the above strategies. @yaahc just happens to be looking into making the target directory a user definable nightly config flag (instead of an env flag) so that cargo can pass it in and specify a directory in the same way that they are talking about global caching of artifacts (cc @epage). That would likely also have the issue of the username being part of the path printed to stderr. I think if we can reliably use ~/ and %userprofile%, that would likely be the best option.

@yaahc
Copy link
Member

yaahc commented Aug 13, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one. D-diagnostic-infra Diagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants