Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
simon_hain
Posts: 15,791
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

segfault after closing the app

After closing my application i get a SIGSEGV. Unfortunately, even debug mode does not tell me where that happens.

Is there a way to analyze where this nullpointer happens?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Developer
CMY
Posts: 1,120
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: segfault after closing the app

Have you looked a the log file under your application directory's logs folder? That's how I figured out where I was crashing when debugging my ANE.
Please use plain text.
Developer
simon_hain
Posts: 15,791
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: segfault after closing the app

the log file only shows the output of the debug console i already saw:
Process 34705630 (x) terminated SIGSEGV code=1 fltno=11 ip=7962bbe6(/base/usr/lib/qt4/lib/libQtCore.so.4.8.4@_ZN7QObjectD1Ev+0x29) mapaddr=0011fbe6. ref=00000010 bdslot=1
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Developer
CMY
Posts: 1,120
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: segfault after closing the app

Do you do your own cleanup routine when exiting your application or do you destroy objects along the way. I got a similar error a few times when working on my ANE and it was because I was either freeing memory that I shouldn't have or trying to use memory that wasn't yet initialized. I would look at your destructors, etc and see if you are freeing any memory that you didn't allocate yourself. Sorry can't be of more use, but my c/c++ is very rusty. I know that you could use gdb to inspect core files on linux, not sure how that would work within the NDK thogh.
Please use plain text.
Developer
simon_hain
Posts: 15,791
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: segfault after closing the app

the destructor of the main application class calls delete on a lot of services, but as the log message below is printed i think it finishes successfully.

if there is no way to analyze things i'll remove/add them one by one to find the issue, just hoped there would be a quicker way.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
Developer
CMY
Posts: 1,120
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook
My Carrier: Verizon

Re: segfault after closing the app

The log message is always printed if your application crashes. From the message I would suspect its one of the objects from the QtCore Library, so I would start with the standard constructs. I'm sure there is an easier way, but for me it's easier to use print statements at the moment rather than take time to brush up on c and gdb at the same time.
Please use plain text.
Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook
My Carrier: x

Re: segfault after closing the app

If you can't catch your crash with a breakpoint then I would pay attention to global variables/objects.

Please use plain text.