-
Notifications
You must be signed in to change notification settings - Fork 0
Runtime Error in `/llvm-project/build_repo/bin/clang-tblgen': double free or corruption (out): 0x00007fe778296350 #102
Comments
Run the following command to reproduced the error.
You could reproduce the error using the following command.
|
If compiled the llvm-project (commit: a822ec7) with no existing database, everything is fine for both first and second times build.
|
The code is crashed when using clang-tblgen with the option -gen-arm-sve-builtins to generate arm_sve_builtins.inc for clang. The file SveEmitter.cpp is used to implement the function. Compared to the generated correct SveEmitter.o file, the wrong SveEmitter.o contained an additional function named "_ZSt16__insertion_sortIPSt10unique_ptrIN12_GLOBAL__N_19IntrinsicESt14default_deleteIS2_EEN9__gnu_cxx5__ops15_Iter_comp_iterIZNS1_10SVEEmitter17createRangeChecksERN4llvm11raw_ostreamEE3$3EEEvT_SG_T0", which caused the crash. |
Analysis: The When compling the SveEmitter.cpp without the existing database, it exists in the RepoMetadataPass but is removed by another optimisation pass (which is after the RepoMetadataPass). When compiling the SveEmitter.cpp with the existing database (clang.db) and the clang.db contains the I think this issue is duplicate issue of #55. |
A possible solution is mentioned in #55 (comment): The functions/variables, which have internal, private or linkonce linkage type, are only emitted into the compilation file if they are referenced. I have implemented this possible solution in the https://github.com/SNSystems/llvm-project-prepo/tree/issue102_ObjectWriter. However, the Reason: I used the print-after-all flag to print IR code after each pass. Since we want to generate the same ticket file when compiled the same source file with or without existing database, the above solution does not work |
Another possible solution: The discardable functions/variables are only pruned if they are referenced by the pruned GOs. I have put the implementation in #109 for code review. |
I’m going to call
(s/ticket file/compilation).
This information should probably be added to #55. Should this be closed as a duplicate of that bug? |
(I edited the quoted text for clarity.) It’s not yet clear to me why this process results in the program crashing. Could you explain? |
I have added the information to #55 (comment). |
I can't answer your question " It’s not yet clear to me why this process results in the program crashing. Could you explain?" I can't answer this question. I know once the issue #55 is solved (PR #109 ), the crash is solved. |
After updated LLVM to LLVM 10 and merged the new hash algorithm back to the master branch, the Wiki page (https://github.com/SNSystems/llvm-project-prepo/wiki/Compile-Faster-with-the-Program-Repository-and-ccache) need to be updated correspondingly. When I built upstream llvm-project using the repo compiler, I met the double free memory error.
This comparison was run with the Repo release compiler (llvm-project-prepo commit: [000ebc2] and pstore commit: [13eacb6b].
The upstream llvm-project project with release configuration is used to demo the performance improvement. The llvm-project is compiled at points through its commit history. For recent seven consecutive days, the first commit of each day is selected to test the compilation time. Each of those commits is built in turn, keeping the cache contents and Repo database between them. I selected seven consecutive days starting from 97c0232 (Sun Jun 21 2020).
After updating llvm-project to commit a822ec7, a double free memory crash is met when running generated clang-tblgen.
The text was updated successfully, but these errors were encountered: