Open Quuxplusone opened 5 years ago
Bugzilla Link | PR40278 |
Status | NEW |
Importance | P normal |
Reported by | Heejin Ahn (aheejin@gmail.com) |
Reported on | 2019-01-09 17:21:55 -0800 |
Last modified on | 2019-05-15 17:16:28 -0700 |
Version | unspecified |
Hardware | PC Linux |
CC | dschuff@google.com, greened@obbligato.org, llvm-bugs@lists.llvm.org, ruiu@google.com, sbc@chromium.org, smithp352@googlemail.com, srj@google.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
FYI: I'm seeing a crash failure with essentially identical stacktrace steps in my project (Halide); the difference is that this isn't when running wasm-ld via commandline, but rather, I'm linking in the lld libraries and calling lld::wasm::link()
directly from my code (with CanExitEarly=False, of course).
The interesting thing here is that I only get this crash if LLVM is built with GCC instead of Clang, but that may just be a peculiarity of my setup; the crash will replicate for me with GCC 5.3 and GCC 7.3 on Ubuntu-variant systems, but I haven't nailed this down to a GCC bug at all. (That said, the fact that it only occurs with HCC and only in non-debug builds makes me a little suspicious.)
(BTW: On the two local systems I've seen this on, it's 100% reproducible. Anything I can do to gather useful info?)
One other note: I am compiling with LLVM_ENABLE_RTTI=ON for both the crashy and non-crashy cases. (I point this out since it is likely a bit unusual and is also something in common with the original reporter.)
@greened, are you building llvm with gcc when you see this issue?
I've tried to repro this using gcc to build but do far no luck. Any more repro tips welcome.
I can repro this 100% of the time with a build that includes Halide as part of the mix. Repro instructions are a little complex; I can post here or send directly to you if you like.
Actually I have now reproduced it using gcc.
It seems that it only effects GCC and only release builds.
Also it doesn't reproduce if you run the command line directly rather then
running from within lit.
Can you conform that last part?
Also, I am seeing this in 80 or the 94 tests in lld/test/wasm. Are you seeing
this too?
Also it doesn't reproduce if you run the command line directly rather then running from within lit. Can you conform that last part?
Yes, because running from lit skips the "CanExitEarly" path, and the bug only occurs when the arenas are destroyed (which is skipped via exit() in that path).
Also, I am seeing this in 80 or the 94 tests in lld/test/wasm. Are you seeing this too?
I haven't evaluated it there; I've seen it when linking lld-wasm directly to my own code.
Oh! Thanks for the tip regarding LLD_IN_TEST environment variable. Thats nasty.
However... even with that I still don't see the crash the arena is freed just fine when I run directly from the command line.
Redirecting stdout to file makes the problem manifest. So now I and repro outside of lit. I have not idea why that would effect this ..
I have not idea why that would effect this
Yeah, this smells like it's gonna be something really weird and/or ugly
Also doesn't repro with in RelWithDebInfo.. only Release. Great.