Close Window causes crash EXC_BAD_ACCESS (SIGSEGV)

  1. 2 months ago

    Arthur G

    Oct 6 Pre-Release Testers

    If I have a subwindow open and hit the close button I get a crash in the debugger.
    The starting of it is

    Exception Type: EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
    Exception Note: EXC_CORPSE_NOTIFY

    Suggestions?

    Note: Going to bed

  2. Beatrix W

    Oct 6 Pre-Release Testers Europe (Germany)

    When you get up you can post the relevant part of the crash log (Thread xxx crashed).

    Also missing: version of Xojo, version of macOS.

    Wasn't this topic discussed recently? If your problem is the same something with Autoreleasepool should be in the crash log.

  3. Arthur G

    Oct 6 Pre-Release Testers

    MacBookPro Late 2011 (Never Mojave)
    No Autoreleasepool
    Report::

    lCrash report

  4. Beatrix W

    Oct 6 Pre-Release Testers Europe (Germany)

    Go to bed. Here is the relevant part:

    1 com.apple.CoreFoundation 0x93740f08 _CFAutoreleasePoolPop + 242 com.apple.Foundation 0x95167f97 -[NSAutoreleasePool drain] +1203 com.apple.AppKit 0x9136fb2a -[NSApplication run] + 9364 XojoFramework 0x00a1b51a mainloop() + 465 XojoFramework 0x00a19628 RuntimeRun + 496 ReviewCards.debug 0x0012a5b1 REALbasic._RuntimeRun + 347 ReviewCards.debug 0x00593261 _Main + 2958 ReviewCards.debug 0x0058f7f9 main + 369 ReviewCards.debug 0x00595038 start + 53

    I think this was it: https://forum.xojo.com/50398-question-about-52630-fixed-an-issue-where-macos-apps-could-occa

  5. Tim J

    Oct 6 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    Add this to App.Close after your code:

    #If TargetMacOS Then
      Declare Function NSClassFromString Lib "Cocoa" (aClassName As CFStringRef) As Integer
      Declare Function sharedApplication Lib "Cocoa" Selector "sharedApplication" (classRef As Integer) As Integer
      Declare Sub terminate Lib "Cocoa" Selector "terminate:" (appRef As Integer, sender As Integer)
      
      Dim appInstance As Integer = sharedApplication(NSClassFromString("NSApplication"))
      terminate(appInstance, appInstance)
    #EndIf
  6. Arthur G

    Oct 7 Pre-Release Testers

    Do we know what causes it? Is it XOJO, the OS, or some stuff like declares that are in the code?

  7. Beatrix W

    Oct 7 Pre-Release Testers Europe (Germany)

    Who knows? I got the problem once in a tiny project - like 6 locs. No declares at all. Since I didn't get the crash again I would assume timing issue and Xojo bug. I didn't find any Feedback issue for the problem, though.

  8. Ulrich B

    Oct 8 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    @Beatrix W I didn't find any Feedback issue for the problem, though.

    There is one as a beta bug: Feedback Case #52630

  9. Christoph D

    Oct 8 Pre-Release Testers, Xojo Pro

    I use those declares with all my macOS projects. It is a Xojo issue but very hard to reproduce and fix.

  10. Arthur G

    Oct 8 Pre-Release Testers
    Edited 2 months ago

    Nope.
    Declares from Tim J didn't do it.
    I also put those Declares at the end of the suspect Windows' Close event.

    I tapped the title bar this time I think.
    Thanks for the Feedback case, but it's different. That is crash on Quit. Mine crashes on stopping (????) quit

  11. Richard W

    Oct 9 Pre-Release Testers, Xojo Pro

    I have also been seeing this randomly will all my Xojo apps since installing macOS 10.14.
    To me this seems like a macOS bug since I never had this problem before 10.14.
    Sometimes it takes closing a particular window 3 or 4 times but eventually it crashes with:

    System Integrity Protection: enabled

    Crashed Thread: 0 Dispatch queue: com.apple.main-thread

    Exception Type: EXC_CRASH (SIGABRT)
    Exception Codes: 0x0000000000000000, 0x0000000000000000
    Exception Note: EXC_CORPSE_NOTIFY

    Application Specific Information:
    abort() called
    Application Name(1238,0x1126565c0) malloc: Incorrect checksum for freed object 0x7fdf13e5e370: probably modified after being freed.
    Corrupt value: 0x7

  12. 9 weeks ago

    Arthur G

    Oct 10 Pre-Release Testers

    I have one window and the app that closed recently that crashed.
    I don't have the window's code yet for the crash, but it also referred to another window as it closes.
    They are both from this same app on Mac High Sierra.
    I happened to be debugging it just because of this, and it's basically short.
    The app's code was also at the very end.

    If YPUbnd > -1 Then //this is a computed property
      ClsingNot = False//a property
      me.RecentItems.SveRecents()//a method
      YPrf.SavPractWrdFiles(False)//a method
    End If
    Return//Return or end of App

    The app crashed at the very end.
    Thoughts?

  13. Richard W

    Oct 10 Pre-Release Testers, Xojo Pro

    Looks like I can't blame macOS 10.14. I'm seeing this crash on High Sierra as well.
    I thought it may be related to timers on the window but I also have a window with no timers that randomly crashes when closed... weird. I will keep experimenting.

  14. Jean-Yves P

    Oct 10 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    I can see the crash on 10.11.6 ...

  15. Tim J

    Oct 10 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    I've also seen it on 10.11 and 10.12.

  16. Arthur G

    Oct 11 Pre-Release Testers

    Feedback bug filed 53670.
    Sorry, I cannot figure out to paste this as a link.
    If you have any info like a crashreport, it would be good to file this as I have to report this as inconsistent and therefore probably not reproducible.

  17. 8 weeks ago

    Jean-Yves P

    Oct 12 Pre-Release Testers, Xojo Pro Europe (France, Besançon)
    Edited 8 weeks ago

    @Tim J Add this to App.Close after your code:

    #If TargetMacOS Then Declare Function NSClassFromString Lib "Cocoa" (aClassName As CFStringRef) As Integer Declare Function sharedApplication Lib "Cocoa" Selector "sharedApplication" (classRef As Integer) As Integer Declare Sub terminate Lib "Cocoa" Selector "terminate:" (appRef As Integer, sender As Integer) Dim appInstance As Integer = sharedApplication(NSClassFromString("NSApplication")) terminate(appInstance, appInstance) #EndIf

    Sorry Tim, but this does not fix the problem.
    I added your code to my app, and still see the bug.

    and it's not on window.close, it's more on app.quit that I see this bug.

  18. Hamery E

    is not verified Oct 12 44000 Nantes (France)

    I too and on two different project, I put in the windows of the buttons "close" with as code "nomdefenetre. close" and there it no longer crashes...

    french :
    moi aussi et sur deux projet different, j'ai mis dans les fenêtres des boutons "Fermer" avec comme code "nomdefenetre.close" et là ça ne plante plus du tout...

  19. Tim J

    Oct 14 Pre-Release Testers, Xojo Pro Dehydrating in AZ

    @Jean-YvesPochez and it's not on window.close, it's more on app.quit that I see this bug.

    Have you tried adding it to App.Close instead?

  20. Jean-Yves P

    Oct 14 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    I've added it to the App.close, at the end of the method, after all other code.
    I see the bug when I quit the app, without closing all the windows, it often happens
    it did not happen before 2018r2

  21. Newer ›

or Sign Up to reply!