-
-
Notifications
You must be signed in to change notification settings - Fork 255
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
Possible memory corruption in GarbageCollect2Stack pass #4593
Comments
|
ping @alonsobsd who is maintainer of the lang/ldc port. |
|
Thx for the report. AFAICT, the relevant code (in master, but shouldn't have changed significantly since v1.35) looks as harmless as it gets wrt. inserting some pointers into a stack-allocated and default-initialized |
|
Oh and our current FreeBSD CI does use the LLVM v15.0.7 port too, and its clang as C++ host compiler: https://cirrus-ci.com/task/5161765764333568 |
|
Yeah, the mystery here is that the I'm thinking that some sort of optimization has messed up the assumptions under which such SmallPtrSets can be used, but I can't see the problem with other ports that use llvm15, so I'm still not sure whether the problem is in GarbageCollect2Stack, in llvm15, or in clang18... |
|
Oh wild. I'd make sure that the same clang that was used to compile libLLVM is used as C++ host compiler for LDC too. |
|
Okay, this turned out to be my own fault. In llvm/llvm-project@6255157d24e2 I turned on trivial Long story short, because of the mismatch a In DimitryAndric/freebsd-src@4c0e8f6 I reverted that, rebuilt the FreeBSD world and ports, and now |
As part of an exp-run for the FreeBSD ports tree (see https://bugs.freebsd.org/276104) I am investigating a crash in the
lang/ldc2port. The port links against the LLVM 15.0.7 runtime, which is provided by another port,devel/llvm15. (I did not create the port, so I am unsure whether ldc supports linking against any later LLVM runtime.)According to https://pkg-status.freebsd.org/gohan04/data/mainamd64PR276104-default-foo/2024-02-02_20h56m00s/logs/errors/ldc-1.35.0.log, the build is terminated by an assertion failure in malloc, apparently due to some memory corruption.
I lifted out the ldc command it is running, which is:
Running this through valgrind shows:
So for reason, it's crashing in the
GarbageCollect2Stackpass, while it is inserting values into theSmallSetVisited, in the functionisSafeToStackAllocate(). At this point I a little out of clues, so I would appreciate any assistance in figuring out what goes wrong.Note, if I use the same
ldccommand line, but append--disable-gc2stack, the compile completes successfully, as far as I can see.The text was updated successfully, but these errors were encountered: