-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
0.2.61 regression #1466
Comments
I suspect #1440 to have changed some "default" values when Some code changed from "defined when @asomers @pizzamig I think |
@semarie I also suspect #1440 introduced the issue. I haven't looked at this into great detail, but a couple of things are clear (1) libc builds for the target, (2) the libc APIs that tokio uses are part of the built library (otherwise tokio would have failed to compile), and (3) the types of these APIs did not change substantially (otherwise tokio would have failed to compile). That CI build job is using FreeBSD 12.0, so maybe this is caused by an ABI difference that's leading to undefined behavior ? |
if env::var("LIBC_CI").is_ok() {
if let Some(11) = which_freebsd() {
println!("cargo:rustc-cfg=freebsd11");
}
if let Some(12) = which_freebsd() {
println!("cargo:rustc-cfg=freebsd12");
}
if let Some(13) = which_freebsd() {
println!("cargo:rustc-cfg=freebsd13");
}
} so in normal build, there is no Now in #[cfg_attr(
all(target_os = "freebsd", freebsd11),
link_name = "kevent@FBSD_1.0"
)]
pub fn kevent(kq: ::c_int,
changelist: *const ::kevent,
nchanges: ::c_int,
eventlist: *mut ::kevent,
nevents: ::c_int,
timeout: *const ::timespec) -> ::c_int;
#[cfg_attr(
all(target_os = "freebsd", freebsd11),
link_name = "mknodat@FBSD_1.1"
)]
pub fn mknodat(dirfd: ::c_int, pathname: *const ::c_char,
mode: ::mode_t, dev: dev_t) -> ::c_int; before it was |
@semarie Thanks, I agree that this is the bug, but I still don't understand why that is causing the tokio build jobs to fail. Tokio is using FreeBSD12 on their CI, and when building For this to be an issue, the semantics of the I think it would be worth it to exactly pin-point why the tokio tests are failing. Knowing this might be useful for the discussion about how to let users choose the FreeBSD version that libc targets (e.g. changing semantics of some ABI-compatible symbols is something that they should be aware of). |
I guess that I introduced an error in the logic how things are handled. The
For what I can see, if |
@gnzlbg In the |
I was able to successfully test However, I don't know how to make the field |
@pizzamig Can mio actually detect when the field present? I think without some dirty hacks it is unlikely, unless we somehow can easily spot freebsd 11 and 12? But the fact that it compiled on 12 without problem indicates that field was missing in libc too? Also which path will you take for |
The problem probably is that, because The The fix for this is to remove this catch all and replace it with an That way, if the appropriate |
@gnzlbg that's exactly what is happening. Nice catch! |
The libc crate only supports freebsd11. Other freebsd versions are not supported. What you want is probably some sort of target-platform versioning, see #570 . |
If Right now
As work-around it would be good to have ctor that could allow initialize common fields, and the rest could be done by user, if necessary |
Yes.
Yes. |
@gnzlbg @DoumanAsh the $ objdump -T /lib/libc.so.7| grep kevent
000000000008fab0 w DF .text 0000000000000011 (FBSD_1.0) kevent
0000000000090d10 w DF .text 000000000000000e FBSD_1.5 kevent |
But current implementation uses this name when |
The previous logic was: use |
Correct. --
Right. , which shouldn't be the case for freebsd12, right? Right, when To clarify: The |
Fix FreeBSD #1440 broke FreeBSD by changing `libc` FreeBSD targets to require a `cfg(freebsdXX)` to be defined, but not updating `build.rs` to define `freebsd11` when `LIBC_CI` is not available. Since `LIBC_CI` is always defined on CI, this issue went undetected. This PR fixes that issue in the `build.rs` and introduces a build task that tests FreeBSD without `LIBC_CI` on FreeBSD11, although I'm not sure this would have caught the issue in #1466 . Closes #1466 .
@carllerche i've published 0.2.62 with what we believe is a fix. Please do let us know and/or re-open this issue if updating to libc 0.2.62 doesn't fix this for you. |
I just saw CI on freebsd 12 no longer failing with new version, thanks |
The 0.2.61 release causes the Tokio CI to fail on FreeBSD:
Failure: https://cirrus-ci.com/task/5089534616797184
I tested the CI run with 0.2.60 and it passes: tokio-rs/tokio#1434
I checked the diff, but did not see anything that would obviously cause this. I will continue to investigate, but any advise would be appreciated.
The text was updated successfully, but these errors were encountered: