I have a C program. It compiles successfully and works fine, but in the end main()it crashes and gives me an error Abort trap: 6.
I have no idea how I can debug this. A few error related SO questions Abort trap: 6did not help me.
In general, what could be the problem?
(I do not want to publish my source code, since it contains about 400 lines of code. I would publish a specific piece of code if I knew what to look for.)
Note. I run the program in the terminal using GCC. But when I run it in Xcode, my program will work, and if I stop it, it ends with exit code: 9.
This is the result of lldb:
Process 1191 stopped
* thread
frame
libsystem_kernel.dylib`__pthread_kill + 10:
-> 0x7fff8fa08286: jae 0x7fff8fa08290 ; __pthread_kill + 20
0x7fff8fa08288: movq %rax, %rdi
0x7fff8fa0828b: jmp 0x7fff8fa03c53 ; cerror_nocancel
0x7fff8fa08290: retq