Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upfs::metadata() crashes on FreeBSD 12 due to layout change in stat.h #42681
Comments
lukaslueg
changed the title
fs::metadata() crashes on FreeBSD due to layout change in stat.h
fs::metadata() crashes on FreeBSD 12 due to layout change in stat.h
Jun 15, 2017
nagisa
added
I-nominated
I-wrong
T-libs
labels
Jun 15, 2017
Rufflewind
referenced this issue
Jun 16, 2017
Open
How to deal with breaking changes on platform ? [BSDs related] #570
This comment has been minimized.
This comment has been minimized.
|
I would like to point a pre-RFC discussion about introducing a way in Rust to permit libc to represent differents layouts per OS version. I think there is need to move forward. |
This comment has been minimized.
This comment has been minimized.
|
We discussed this at libs triage today and the conclusion was that this is indeed bad! We would be fine in the very near future adding dynamic detection to do the right thing at runtime. In the long term we decided to see how @semarie's rfc plays out. |
alexcrichton
added
O-openbsd
O-freebsd
and removed
I-nominated
O-openbsd
labels
Jun 25, 2017
sfackler
referenced this issue
Jul 1, 2017
Closed
On FreeBSD std::fs::metadata(".").is_dir() returns false #43005
This comment has been minimized.
This comment has been minimized.
johalun
commented
Jul 8, 2017
|
Is there a quick fix for this? This stops me from building a few (probably many) crates.. |
This comment has been minimized.
This comment has been minimized.
johalun
commented
Jul 13, 2017
|
Here's a temporary fix for those who can't wait |
Mark-Simulacrum
added
C-bug
P-high
and removed
I-wrong
labels
Jul 27, 2017
This comment has been minimized.
This comment has been minimized.
kirillrdy
commented
Jul 29, 2017
|
@johalun Thanks for a workaround ! |
Mark-Simulacrum
added
the
I-crash
label
Aug 10, 2017
This comment has been minimized.
This comment has been minimized.
|
Hi! I prepared a patch to support the two breaking changes in FreeBSD 12.x (see rust-lang/libc#721). I tested them successfully on FreeBSD 10.3 and FreeBSD 12.0, using the testsuites of However, I'm not sure my solution around |
dumbbell
added a commit
to dumbbell/libc
that referenced
this issue
Aug 10, 2017
This comment has been minimized.
This comment has been minimized.
mattmacy
commented
Sep 22, 2017
|
@dumbbell there's an ongoing discussion about the fact that Rust has inadvertently baked in UBs on !Linux platforms by creating its own private copies of system headers, that are essentially an arbitrary version. rust-lang/libc#570 (comment) Cargo needs to grow support for doing the equivalent of parsing uname -K and passing that as target_os_version. For the time being I've accepted that when compiling I need to just append the following 3 lines to the Cargo.toml of any root crate when building on HEAD: [patch.crates-io] |
This comment has been minimized.
This comment has been minimized.
mattmacy
commented
Sep 23, 2017
|
Actually - although I managed to get jsonrpc_http_server bits to work yesterday by patching some of the dependent ports and then using [patch.crates-io] overrides, today I tried building netmap_sys with user libs which failed in the gcc crate, presumably because of something in libstd. I tried installing the FreeBSD port, but the cargo in that version wouldn't let me override libc (if that's something only available in nightlies you really need to make it standard) so although it compiled the binary didn't actually work. I've lost too much time on this to consider Rust a viable option for any near-term deadlines and have concluded that Rust really isn't cross-platform outside of tier 1 targets right now. |
This comment has been minimized.
This comment has been minimized.
|
Here's a fun thing. @johalun's amazing method of patching Mesa OpenGL driver loading. Running
And no,
The ports/pkg rustc, compiled normally with the same |
This comment has been minimized.
This comment has been minimized.
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
added a commit
to bdrewery/libc
that referenced
this issue
Mar 1, 2018
bdrewery
referenced this issue
Mar 2, 2018
Merged
Use pre-ino64 FreeBSD symbols to resolve binary compatibility. #937
bors
added a commit
to rust-lang/libc
that referenced
this issue
Mar 2, 2018
bors
closed this
in
rust-lang/libc#937
Mar 2, 2018
This comment has been minimized.
This comment has been minimized.
|
Technically this is not fixed yet as I need to update the submodule and the bootstrap needs to get the fix. Will be a few days. |
bdrewery
added a commit
to bdrewery/rust
that referenced
this issue
Mar 8, 2018
bdrewery
added a commit
to bdrewery/rust
that referenced
this issue
Mar 8, 2018
Mark-Simulacrum
reopened this
Mar 9, 2018
bdrewery
added a commit
to bdrewery/rust
that referenced
this issue
Mar 12, 2018
bors
added a commit
that referenced
this issue
Mar 14, 2018
bdrewery
added a commit
to bdrewery/rust
that referenced
this issue
Mar 14, 2018
This was referenced Mar 14, 2018
This comment has been minimized.
This comment has been minimized.
|
The last piece for this should be updating the src/stage0.txt beta used. I am testing that now. |
lukaslueg commentedJun 15, 2017
The layout of
struct statused to be this in FreeBSD 11, in FreeBSD 12 it's now this. This causes the FreeBSD-specific implementation ofstd::fs::metadata()to crash for 1.18 and nightly as of 17/06/15, as it's stack frame get's boiled up.Can be reproduced via
Downstream this appeared in jwilm/alacritty#618