Question: When I was debugging my .c file using lldb on terminal for Mac, I some how cannot find the location of the segmentation fault. I

When I was debugging my .c file using lldb on terminal for Mac, I some how cannot find the location of the segmentation fault. I have debugged the code numerous of times and it is still producing the same error. I tried using Valgrind but Mac doesn't support Valgrind. Can someone help me on why I can find the location of segmentation fault.

When I was debugging my .c file using lldb on terminal for

(11db) target create "average", Current executable set to 'average' (x86_64). [(lldb) run Process 19134 launched: '/Users/amanpatel/Desktop/College/Sophomore Year/CSE31/Lab_2/average' (x86_64) Enter input values (enter 0 to finish): Process 19134 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2) frame #0: Ox00007fff6548efda libsystem_c.dylib_svfscanf 1 + 273 libsystem_c.dylib' _svfscanf 1: -> 0x7fff6548efda : mov1 %eax, (%rcx) 0x7fff6548efdc : jmp 0x7fff65490696 ; Ox7fff6548efe1 : mova (%r11), %rcx 0x7fff6548efe4 : leaq 0x8(%rcx), %rdx Target 0: (average) stopped. [(lldb) continue Process 19134 resuming Process 19134 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2) frame #0: 0x00007fff6548efda libsystem_c.dylib__svfscanf_1 + 273 libsystemc.dylibsvfscanf 1: -> Ox7fff6548efda : movl %eax, (%rcx) @x7fff6548efdc : jmp Ox7fff65490696 ; 0x7fff6548efe1 : movg (%r11), %rcx @x7fff6548efe4 : leag 0x8(%rcx), %rdx Target 0: (average) stopped. (lldb) (11db) target create "average", Current executable set to 'average' (x86_64). [(lldb) run Process 19134 launched: '/Users/amanpatel/Desktop/College/Sophomore Year/CSE31/Lab_2/average' (x86_64) Enter input values (enter 0 to finish): Process 19134 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2) frame #0: Ox00007fff6548efda libsystem_c.dylib_svfscanf 1 + 273 libsystem_c.dylib' _svfscanf 1: -> 0x7fff6548efda : mov1 %eax, (%rcx) 0x7fff6548efdc : jmp 0x7fff65490696 ; Ox7fff6548efe1 : mova (%r11), %rcx 0x7fff6548efe4 : leaq 0x8(%rcx), %rdx Target 0: (average) stopped. [(lldb) continue Process 19134 resuming Process 19134 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2) frame #0: 0x00007fff6548efda libsystem_c.dylib__svfscanf_1 + 273 libsystemc.dylibsvfscanf 1: -> Ox7fff6548efda : movl %eax, (%rcx) @x7fff6548efdc : jmp Ox7fff65490696 ; 0x7fff6548efe1 : movg (%r11), %rcx @x7fff6548efe4 : leag 0x8(%rcx), %rdx Target 0: (average) stopped. (lldb)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!