-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Deterministic package files break lldb #9512
Comments
Wow nice find! This comparison in particular looks pretty suspcious. I forgot that we preserved mtimes... In any case I think we should do two things to fix this:
|
With rust-lang/cargo#9512 discovered this is, uh, odd fallout of the "deterministic" header mode in this crate. This is an unintended consequence of the deterministic header mode which should ideally be fixable. This commit changes the `tar` crate to use a different constant than 0 when creating archives with the deterministic header mode (specifically 123456789: Nov 29, 1973). It also will now refuse to create files with a 0 mtime, instead resetting the mtime to 1 which should help the mtime be nonzero so tools like lldb don't accidentally think it's zero.
Thinking more about this, I don't think that we can skip the zero mtime case. If we skip the zero mtime case then we run afoul of #7590 where we'd basically just ignore mtimes altogether. I've opened alexcrichton/tar-rs#250 to handle both points above which I think should fix this issue. New archives created by Cargo will have nonzero mtimes and older archives will start being extracted with an mtime of 1 instead of 0. @ehuss mind reviewing that PR and the strategy here? |
With rust-lang/cargo#9512 discovered this is, uh, odd fallout of the "deterministic" header mode in this crate. This is an unintended consequence of the deterministic header mode which should ideally be fixable. This commit changes the `tar` crate to use a different constant than 0 when creating archives with the deterministic header mode (specifically 123456789: Nov 29, 1973). It also will now refuse to create files with a 0 mtime, instead resetting the mtime to 1 which should help the mtime be nonzero so tools like lldb don't accidentally think it's zero.
Update tar dependency to 0.4.35 Pulls in a fix which should avoid 0 mtime files from showing up. Closes #9512
Problem
#8864 introduced deterministic packaging. One of the key aspects is that the mtime of every file is set to 0. Unfortunately, this seems to prevent lldb from reading the file. This means that stepping into dependencies from crates.io won't show any source information.
Arguably this is a bug in lldb. This does not seem to affect gdb. Unfortunately I feel like the likelyhood of fixing this in lldb is low (and even if it does get fixed, I imagine it would take years to trickle into Apple's release).
Steps
Possible Solution(s)
I'm not sure. Cargo could set the timestamp of files when they are extracted. Would just need to be careful with #7590. I think setting all files to the same timestamp should be sufficient?
Notes
Output of
cargo version
: cargo 1.54.0-nightly (070e459 2021-05-11)Seems to affect lldb on both macOS and Linux.
Linux: lldb version 10.0.0 and lldb version 11.0.0 and lldb version 12.0.1
macOS: lldb-1200.0.44.2 (Xcode 12.4 (12D4e))
The text was updated successfully, but these errors were encountered: