Skip to content

Instantly share code, notes, and snippets.

@xackus
Created April 14, 2021 21:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xackus/bcca30f324ccf46324c78f2283a02826 to your computer and use it in GitHub Desktop.
Save xackus/bcca30f324ccf46324c78f2283a02826 to your computer and use it in GitHub Desktop.
Program received signal SIGSEGV, Segmentation fault.
#0 0x0000555557721640 in llvm::ChangeReporter<llvm::OrderedChangedData<llvm::OrderedChangedData<llvm::ChangedBlockData> > >::~ChangeReporter() ()
#1 0x0000555555fd8728 in llvm::StandardInstrumentations::~StandardInstrumentations (this=0x7fffffffcd80, __in_chrg=<optimized out>)
at /home/mwa/code/llvm-project/build/install/include/llvm/Passes/StandardInstrumentations.h:401
#2 0x0000555555fceea9 in ZigLLVMTargetMachineEmitToFile (targ_machine_ref=0x55555b6949d0, module_ref=0x55555b692610, error_message=0x7fffffffdb48, is_debug=true, is_small=false, time_report=false, tsan=false, lto=false,
asm_filename=0x0, bin_filename=0x55555b690580 "basic1.o", llvm_ir_filename=0x0) at ../src/zig_llvm.cpp:237
#3 0x0000555555e99405 in zig_llvm_emit_output (g=0x55555b688ff0) at ../src/stage1/codegen.cpp:8488
#4 0x0000555555e9df48 in codegen_build_object (g=0x55555b688ff0) at ../src/stage1/codegen.cpp:9608
#5 0x0000555555e6f614 in zig_stage1_build_object (stage1=0x55555b688ff0) at ../src/stage1/stage1.cpp:130
#6 0x0000555555e6b3b7 in main (argc=21, argv=0x7fffffffde38) at ../src/stage1/zig0.cpp:477
@mikdusan
Copy link

fyi here's my reproduction on macos

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100183380 zig0`llvm::StringMap<std::__1::unordered_map<unsigned long long, float, std::__1::hash<unsigned long long>, std::__1::equal_to<unsigned long long>, std::__1::allocator<std::__1::pair<unsigned long long const, float> > >, llvm::MallocAllocator>::~StringMap(this=0x00007ffeefbfece8) at StringMap.h:184:38
   181 	    // work not required in the destructor.
   182 	    if (!empty()) {
   183 	      for (unsigned I = 0, E = NumBuckets; I != E; ++I) {
-> 184 	        StringMapEntryBase *Bucket = TheTable[I];
   185 	        if (Bucket && Bucket != getTombstoneVal()) {
   186 	          static_cast<MapEntryTy *>(Bucket)->Destroy(Allocator);
   187 	        }
Target 0: (zig0) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000100183380 zig0`llvm::StringMap<std::__1::unordered_map<unsigned long long, float, std::__1::hash<unsigned long long>, std::__1::equal_to<unsigned long long>, std::__1::allocator<std::__1::pair<unsigned long long const, float> > >, llvm::MallocAllocator>::~StringMap(this=0x00007ffeefbfece8) at StringMap.h:184:38
    frame #1: 0x0000000100183325 zig0`llvm::StringMap<std::__1::unordered_map<unsigned long long, float, std::__1::hash<unsigned long long>, std::__1::equal_to<unsigned long long>, std::__1::allocator<std::__1::pair<unsigned long long const, float> > >, llvm::MallocAllocator>::~StringMap(this=0x00007ffeefbfece8) at StringMap.h:178:16
    frame #2: 0x0000000100183305 zig0`llvm::PseudoProbeVerifier::~PseudoProbeVerifier(this=0x00007ffeefbfece8) at SampleProfileProbe.h:56:7
    frame #3: 0x00000001001832a5 zig0`llvm::PseudoProbeVerifier::~PseudoProbeVerifier(this=0x00007ffeefbfece8) at SampleProfileProbe.h:56:7
    frame #4: 0x0000000100183248 zig0`llvm::StandardInstrumentations::~StandardInstrumentations(this=0x00007ffeefbfeab8) at StandardInstrumentations.h:401:7
    frame #5: 0x0000000100173645 zig0`llvm::StandardInstrumentations::~StandardInstrumentations(this=0x00007ffeefbfeab8) at StandardInstrumentations.h:401:7
    frame #6: 0x0000000100172ebf zig0`::ZigLLVMTargetMachineEmitToFile(targ_machine_ref=0x0000000106032600, module_ref=0x000000010593f420, error_message=0x00007ffeefbff1e0, is_debug=true, is_small=false, time_report=false, tsan=false, lto=false, asm_filename=0x0000000000000000, bin_filename="basic1.o", llvm_ir_filename=0x0000000000000000) at zig_llvm.cpp:355:1
    frame #7: 0x0000000100054cfe zig0`zig_llvm_emit_output(g=0x000000010602b800) at codegen.cpp:8488:9
    frame #8: 0x0000000100051822 zig0`codegen_build_object(g=0x000000010602b800) at codegen.cpp:9608:5
    frame #9: 0x000000010015ec3c zig0`::zig_stage1_build_object(stage1=0x000000010602b800) at stage1.cpp:130:5
    frame #10: 0x0000000100002d5f zig0`main(argc=21, argv=0x00007ffeefbff588) at zig0.cpp:477:5
    frame #11: 0x00007fff20457621 libdyld.dylib`start + 1
    frame #12: 0x00007fff20457621 libdyld.dylib`start + 1
(lldb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment