Closed asterite closed 7 years ago
I can't reproduce, so I can't tell for sure, but:
The DIBuilder is attached to a Module or Context, doesn't it? Would it be possible that we dispose of the module/context before we dispose of the DIBuilder but the DIBuilder dispose method needs to access it?
I thought so, yes, but we never dispose DIBuilders ¯_(ツ)_/¯
I was able to "reduce" the random crash that sometimes happens on travis and CI.
To reproduce, compile this file:
The run it, making sure to set the
CRYSTAL_PATH
env var to the "src" folder of the compiler, otherwise the prelude won't be found.The crash happens randomly, so after it prints "Start: 20" you can ctrl+c and then run it again. This is the crash I sometimes get:
Sometimes the trace is a bit different.
This happens when passing
Crystal::Debug::All
for the debug info. It doesn't happen withCrystal::Debug::None
. It seems to be related to disposing an llvmMDNode
twice, or something like that.I have no idea why it happens. Our code makes sure that an
LLVM::Context
is disposed only once. Maybe our custom bindings to the LLVM C++ debug API has bugs, I don't know. I also tried to trace this in LLVM's source code but it's huge and it's written in C++.The "good" thing is that this is very unlikely to happen when compiling one file. But there's a chance it happens in tests, and then we have to restart CI from time to time and hope it passes.
Any help finding the cause of this would be greatly appreciated! :-)