Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

274
Views
clang crashed during compilation of .cpp in Xcode in Release mode but ok in debug

I have a project where I have a .h, .cpp, and a bridging header, so basically trying to call some c++ code from swift. When i built and ran in Debug mode, things looked fine.

If I switch to release mode, it failed to build, and the crash happened during compilation from clang. Here's the message:

clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: aarch64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/r5/bs8mgc751_bbl3gcths89jc00000gp/T/CBaseMath-8e4bd0.cpp
clang: note: diagnostic msg: /var/folders/r5/bs8mgc751_bbl3gcths89jc00000gp/T/CBaseMath-8e4bd0.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /Users/kelvinchan/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

Any idea if there's something I should look, before trying to file a bug report for Apple as instructed? I tried to looked at the .crash file but i am not technical enough to understand it. It does not reference any of the c++ code I have.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You have a crash in your compiler, which is annoying. The best way to log a bug is to reduce this as much as possible.

The best way of doing so is with a program called Creduce. It's a program that requires a file and a script. The file is your starting situation. The script needs to prove your bug still exists.

In this case, your script could exist about the 2 compile commands and checking the return code. The file is simply your .CPP

With all of this, the program will throw away code ... and reduce the file as much as possible. I've seen 100 000 lines being reduced to 5.

A tricks: preprocessed files are larger though self-contained, this makes it easier to reduce.

Finally, you need a lot of time. You start it and it runs until it is reduced

If it runs in less than five minutes your script is faulty and you usually end up with an empty .CPP Expected time are in the range of hours.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!