-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
trunk 217475 and -g -O2 causing crash #21267
Comments
assigned to @adrian-prantl |
Stack backtrace 0 clang 0x00000000022f0005 llvm::sys::PrintStackTrace(_IO_FILE*) + 37 |
Adrian? This looks like the stuff you've been touching. |
Compiling this file uses over 24GiB of memory, all metadata. I'll have a look. |
Impressive. Most impressive. |
What happens here is that SelectionDAG is combining two SDNodes and then merging their DbgValues via DAG.TransferDbgValues(), but SelectionDAG::AddDbgValue() doesn't check whether a DbgValue is already in that SDNode's list of DbgValues and happily adds all of them. The testcase with it's plethora of debug variables from layer over layers of inlined boost::* methods drives this into a pathologic situation where — when dagcombining a chain of instructions — our SDNode's DbgValMap is growing exponentially. The attached patch changes the DbgValMap to have set semantics, which fixes the problem and reduced the memory usage to only ~500MB. I'm still trying to come up with a usable testcase for this. |
Bugpoint and delta-reduced testcase |
Fixed by r221709 |
Extended Description
The attached preprocessed C++ source code, when compiled by today's trunk with
-g -O2, causes a crash.
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.6.0 (trunk 217475)
Target: x86_64-unknown-linux-gnu
Thread model: posix
The text was updated successfully, but these errors were encountered: