-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clang crash in preprocessor code #23843
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
Comments
With an assert build I get: Assertion `NextLocalOffset + TokLength + 1 > NextLocalOffset && NextLocalOffset + TokLength + 1 <= CurrentLoadedOffset && "Ran out of source locations!"' failed. |
I don't know what the assert build messages mean but it is clearly a clang bug and not anything in my original code. Shouldn't clang be looking to fix this bug in their preprocessor ? |
Well the testcase just needs huge amounts of memory. It there a clang switch that increases the max. amount of source locations? |
No. (You could try switching it to a 64-bit type and recompiling, but there will likely be a lot of places you need to change, and this is obviously not a supported configuration.) ~2GB of preprocessed source per translation unit (including all intermediate levels of macro expansion) is one of clang's implementation limits. We are unlikely to increase this limit any time soon, as source locations are responsible for a significant proportion of our memory usage. |
You should still be putting out some sort of error indicating what has happened rather than have an internal compiler error. |
Still crashing as of post-16 trunk: https://godbolt.org/z/65K9fachf (it takes 8 seconds to crash on my machine, so I guess it exceeds CE timeouts)
Assertion:
|
@llvm/issue-subscribers-clang-frontend |
Possibly related: #29894 |
Extended Description
Testing my Boost.VMD library clang crashes with message:
clang++.exe: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
Attached in a zip file is the information requested.
The test can be also run from Boost.VMD on the 'develop' branch to see the crash.
The text was updated successfully, but these errors were encountered: