-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Runtime segfault on freebsd #13427
Comments
I am unconvinced that this is a rust bug. This C program exhibits the same bug: #include <assert.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
static pthread_mutex_t lock;
static pthread_cond_t cond;
static volatile int cnt = 0;
static void test() {
int p = fork();
assert(p >= 0);
if (p == 0) {
_exit(0);
}
int a = 1;
assert(waitpid(p, &a, 0) == p);
assert(WEXITSTATUS(a) == 0);
}
static void *child(void *arg) {
test();
assert(pthread_mutex_lock(&lock) == 0);
cnt -= 1;
if (cnt == 0) {
assert(pthread_cond_signal(&cond) == 0);
}
assert(pthread_mutex_unlock(&lock) == 0);
return arg;
}
int main() {
assert(pthread_mutex_init(&lock, NULL) == 0);
assert(pthread_cond_init(&cond, NULL) == 0);
pthread_t c1, c2;
cnt = 2;
assert(pthread_create(&c1, NULL, child, NULL) == 0);
assert(pthread_create(&c2, NULL, child, NULL) == 0);
assert(pthread_mutex_lock(&lock) == 0);
while (cnt != 0) {
assert(pthread_cond_wait(&cond, &lock) == 0);
}
assert(pthread_mutex_unlock(&lock) == 0);
pthread_join(c1, NULL);
pthread_join(c2, NULL);
} |
I have submitted an upstream bug: http://www.freebsd.org/cgi/query-pr.cgi?pr=188425 |
This is a bit of an interesting upgrade to LLVM. Upstream LLVM has started using C++11 features, so they require a C++11 compiler to build. I've updated all the bots to have a C++11 compiler, and they appear to be building LLVM successfully: * Linux bots - I added gcc/g++ 4.7 (good enough) * Android bots - same as the linux ones * Mac bots - I installed the most recent command line tools for Lion which gives us clang 3.2, but LLVM wouldn't build unless it was explicitly asked to link to `libc++` instead of `libstdc++`. This involved tweaking `mklldeps.py` and the `configure` script to get things to work out * Windows bots - mingw-w64 has gcc 4.8.1 which is sufficient for building LLVM (hurray!) * BSD bots - I updated FreeBSD to 10.0 which brought with it a relevant version of clang. The largest fallout I've seen so far is that the test suite doesn't work at all on FreeBSD 10. We've already stopped gating on FreeBSD due to #13427 (we used to be on freebsd 9), so I don't think this puts us in too bad of a situation. I will continue to attempt to fix FreeBSD and the breakage on there. The LLVM update brings with it all of the recently upstreamed LLVM patches. We only have one local patch now which is just an optimization, and isn't required to use upstream LLVM. I want to maintain compatibility with LLVM 3.3 and 3.4 while we can, and this upgrade is keeping us up to date with the 3.5 release. Once 3.5 is release we will in theory no longer require a bundled LLVM.
Can't reproduce this anymore (FreeBSD 10.1-RC2). Apart from the debuginfo tests (gdb too old and no utf-8 support) and a probably bogus failure in run-pass/tcp-stress.rs |
Our FreeBSD bot is still segfaulting regularly (http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/), but perhaps it was a bug fixed upstream? They're running |
@alexcrichton Upgrading seems a good idea. I have been running rust on FreeBSD for a few weeks now without major problems. I'm not sure at what point the random segfaults disappeared, but it might have happened before I upgraded to a 10.1 prerelease. Upgarding to the latest 10.0 patch level might be worth a try. |
I've upgraded our buildbot to 10.1-RC2 and I'll watch the queue for a few days to see if it's all green, and then we can close this and re-gate on bsd. |
The bot is a whole lot more green than before, but it seems to be suffering from a spurious out-of-stack error on stdtest (this is the second time I've seen this)
|
@alexcrichton Any updates on when/if this is going to be resolved? |
Sadly no, but it sounds like another FreeBSD upgrade may be promising. |
Unfortunately building on 10.1-RELEASE still results in a segfault |
Can anyone confirm if this is still an issue? |
@frewsxcv I can't say but I believe there are unofficial builds of cargo and rustc floating around some user's repository |
@alexcrichton it appears that this is no longer an issue on FreeBSD. The new buildbot is solidly green. I vote we close this. |
🎊 |
feat: Make flycheck workdone progress reports cancellable In clients that support this (like VSCode), the clients will now render a cancel button on the notification message which can be clicked to cancel the flycheck instead. Closes rust-lang/rust-analyzer#6895 ![Code_VbXgP3SbFD](https://user-images.githubusercontent.com/3757771/196205329-2df93451-c143-4d1b-a700-d988edf55efa.gif)
Don't lint unnamed consts and nested items within functions in `missing_docs_in_private_items` With this change we no longer require doc comments for `const _: ()` items as well as nested items in functions or other bodies. In both of those cases, rustdoc generates no documentation even with `--document-private-items`. Fixes rust-lang#13427 (first commit) Fixes rust-lang#13298 (second commit) cc rust-lang/rust-clippy#5736 (comment) changelog: [`missing_docs_in_private_items`]: avoid linting in more cases where rustdoc generates no documentation
This code will segfault quickly on freebsd. Apparently something in
phread_cond_signal
is dereferencing NULL.I have been unable to reproduce yet with equivalent C code, so I'm assuming this is a problem with the runtime somewhere.
The text was updated successfully, but these errors were encountered: