Failure Report Issues - EXC_BAD_ACCESS

OK, so I got a crash report for one of my applications, but I swear I'm 100% confused.

This is what the "main" part is:

Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Regions Near 0: --> __TEXT 0000000100000000-0000000100015000 [ 84K] rx/rwx SM=COW /Applications/MY_APP/Contents/MacOS/MY_APP Application Specific Information: objc[337]: garbage collection is ON Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_c.dylib 0x00007fff90128650 strlen + 16 1 MY_BUNDLE_ID 0x0000000100008f12 0x100000000 + 36626 2 MY_BUNDLE_ID 0x000000010000b435 0x100000000 + 46133 3 MY_BUNDLE_ID 0x0000000100003c90 0x100000000 + 15504 4 com.apple.CoreFoundation 0x00007fff9065147a _CFXNotificationPost + 2554 5 com.apple.Foundation 0x00007fff8e5fe846 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 6 com.apple.AppKit 0x00007fff9a7894a7 -[NSTableView textDidChange:] + 377 7 com.apple.CoreFoundation 0x00007fff9065147a _CFXNotificationPost + 2554 8 com.apple.Foundation 0x00007fff8e5fe846 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 9 com.apple.AppKit 0x00007fff9a15c260 -[NSTextView(NSSharing) didChangeText] + 339 10 com.apple.AppKit 0x00007fff9a7f8381 _NSDoUserReplaceForCharRange + 390 11 com.apple.AppKit 0x00007fff9a7f85b1 _NSDoUserDeleteForCharRange + 38 12 com.apple.AppKit 0x00007fff9a7e1e72 -[NSTextView(NSKeyBindingCommands) deleteBackward:] + 440 13 com.apple.AppKit 0x00007fff9a18a1cc -[NSResponder doCommandBySelector:] + 75 14 com.apple.AppKit 0x00007fff9a18a02e -[NSTextView doCommandBySelector:] + 197 15 com.apple.AppKit 0x00007fff9a20cf4e -[NSKeyBindingManager(NSKeyBindingManager_MultiClients) interpretEventAsCommand:forClient:] + 2200 16 com.apple.AppKit 0x00007fff9a20c3bb -[NSTextInputContext handleEvent:] + 939 17 com.apple.AppKit 0x00007fff9a20bf87 -[NSView interpretKeyEvents:] + 183 18 com.apple.AppKit 0x00007fff9a158f67 -[NSTextView keyDown:] + 723 19 com.apple.AppKit 0x00007fff9a374120 -[NSWindow sendEvent:] + 9687 20 com.apple.AppKit 0x00007fff9a36f744 -[NSApplication sendEvent:] + 5761 21 com.apple.AppKit 0x00007fff9a2852fa -[NSApplication run] + 636 22 com.apple.AppKit 0x00007fff9a229cb6 NSApplicationMain + 869 23 MY_BUNDLE_ID 0x0000000100002014 0x100000000 + 8212 

Do you have any ideas what might be wrong? Or could you just point me in the right direction?


Aside:

Can someone help me, for example, do this? 0x00007fff90128650 more ... meaning and do it (in some future crash report) also show the function name?

+4
source share
3 answers

Your crash log gives you a lot of information: at first you crashed because you tried to access address 0 in the ur program, and the kernel is not happy.

 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 

See, you get segmentation, by the way, it starts at address 0x00, so you like the direct pointer 0 / nil. Like this

 char* adress = 0; printf("get %p", adress); // will output 0x0 printf("get %p", adress[0]); // will make a EXC_BAD_ACCESS 

You really need to focus on this.

There are three interesting things in the crash stack:

 6 com.apple.AppKit 0x00007fff9a7894a7 -[NSTableView textDidChange:] + 377 5 com.apple.Foundation 0x00007fff8e5fe846 -[NSNotificationCenter postNotificationName:object:userInfo:] + 64 0 libsystem_c.dylib 0x00007fff90128650 strlen + 16 

[textDidChange] is one of the last calls that caused a crash, by the way, you send a notification when you start [textDidChange]. And the last line that actually crashes: strlen + 16 is because there is something that thinks it can get the length of char from the actual address of the pointer, and actually it is not.

For me, you should verify that you are sending in your notice.

 _NSDoUserReplaceForCharRange _NSDoUserDeleteForCharRange 

When you delve deeply into the collapse of the stack, it seems that it appears when you make a cell - insert / delete in ur tableViewController. You should check that sometime someone clicks the wrong data or does not use the edit cell as it should be.

So, here is a summary: 1 Someone is editing a tableViewCell, he is not pasting or pasting the code that he is to insert. 2 You send a notification with invalid data inside it. 3 When strlen (invalid_dataStructure) is running, this will crash ur application

By the way, I’m just guessing, since I don’t know, actually, your code implementation. But I hope this can give you many tips for your debugging session.

+12
source

Usually the problem is that you need to save.

You need to enable Zombies for debug mode. in xCode 4 click "edit scheme" β†’ "Diagnostics" β†’ "Enable zombie objects"

It will show you in the console which β€œremote” object you are trying to access on failure.

this should help.

you will see something like this:

 2010-01-25 14:35:24.840 MyApplication[1393:20b] *** -[CFString retain]: message sent to deallocated instance 0x42a5060 

You can also enable "Malloc logging" and after a failure, enter the following command in the debug console:

 shell malloc_history 1393 0x42a5060 

there you can find the entire alloc / release stack. just look at the release and distribution commands.

0
source

I have a very similar crash report trying to open applications with graphical compression (pymol and coot) (see below)

I found out that if I disconnected my mac from my external monitor, the programs worked again. I used a USB-HDMI connector - apparently this is a bad idea. I just purchased a microUSB-HDMI connector and I expect this to work better. Programs run if I just use my own monitor monitor.

 Time Awake Since Boot: 19000 seconds Time Since Wake: 110 seconds Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000 VM Regions Near 0: --> __TEXT 0000000100000000-0000000100cff000 [ 13.0M] rx/rwx SM=COW /Applications/MacPyMOL.app/Contents/MacOS/MacPyMOL Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.opengl 0x00007fff8333857c CGLDescribeRenderer + 79 1 com.schrodinger.macpymol 0x000000010083c5b4 CheckOpenGLCaps + 484 2 com.schrodinger.macpymol 0x000000010084cd8c -[PyMOLOpenGLView awakeFromNib] + 1420 3 com.apple.CoreFoundation 0x00007fff8a10785f -[NSSet makeObjectsPerformSelector:] + 223 4 com.apple.AppKit 0x00007fff88b935cd -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1216 5 com.apple.AppKit 0x00007fff886a3605 loadNib + 384 6 com.apple.AppKit 0x00007fff88c14749 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 727 7 com.apple.AppKit 0x00007fff88c14ca8 +[NSBundle(NSNibLoadingInternal) _loadNibFile:externalNameTable:options:withZone:] + 150 8 com.apple.AppKit 0x00007fff886a2bc0 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 631 9 com.schrodinger.macpymol 0x000000010084d77b main + 1499 10 com.schrodinger.macpymol 0x0000000100007494 start + 52 
0
source

Source: https://habr.com/ru/post/1439602/


All Articles