×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    wxWidgets is a cross-platform GUI toolkit popular on Windows/Gtk/Mac OS. It has a Symbian port, but the coding work have stopped for 3 years (from 2007 - link ). This unfinished work is somehow complete, and has implemented almost all the main features of the PC version wxWidgets.

    I use wxWidgets on PC and think highly of it. So when I started to learn programming under Symbian OS, I thought of it immediately. After spending days building the minimal sample with S60 3rd MR SDK, I succeeded finally.

    But another bad problem arose. When the sample app exits, the emulator will prompt a KERN-EXEC 3 panic. After stepping in the code, I found the app broke in AppUI::Exit(). I tried to comment out all the unnecessary codes, but the same error. As a novice of the Symbian world, I spent another days trying to solve it. No lucky.

    Any help will be appreciated.

    Regards,
    Ning

    p.s. I have repacked the wxSymbian source code and placed the files into their proper folders. I compiled the code with S60 3rd MR SDK.
    Please download from here and import the bld.inf/.mmp form Projects\9.1\HelloWorld_9_0\group.

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    I would suspect that it comes from some destructor, in where you try deleting a invalid pointer. So check that all uninitialized pointers (as well as deleted ones) are set to NULL.

  3. #3
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    When the panic occurs, the call stack is not accessible (the frmework doesn't provide symbols). So I'm not able to figure out which pointer is null. I just know the panic is from the CXXXAppUi::Exit().

    Regards,
    Ning

  4. #4
    Nokia Developer Champion
    Join Date
    Jul 2004
    Posts
    2,015

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    Then use a binary chop approach of setting pointers to NULL to find out which one is causing the problem.
    Once you've found it out, look back through the code to see where its being previously deleted, and if it is supposed to be being deleted at that earlier point.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    The panic breakpoint (since you mention the call stack, I assume you have enabled Just In Time debugging) is located deep inside some .dll, however if you start scrolling down the call stack, you will find your code.

  6. #6
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    Quote Originally Posted by wizard_hu_ View Post
    The panic breakpoint (since you mention the call stack, I assume you have enabled Just In Time debugging) is located deep inside some .dll, however if you start scrolling down the call stack, you will find your code.
    The call stack has none of of my code. All are .dll methods without symbols.

    Regards,
    Ning

  7. #7
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    Quote Originally Posted by hotcheese View Post
    Then use a binary chop approach of setting pointers to NULL to find out which one is causing the problem.
    Once you've found it out, look back through the code to see where its being previously deleted, and if it is supposed to be being deleted at that earlier point.
    Ok. I will try, but wxWidgets is really very complex...

    Regards,
    Ning

  8. #8
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,143

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    I'm nearly sure the actual line is inside a destructor still, basically when you call the exit, it will stop the active scheduler, which after your application framework is deleted. most likely you do not have too much stuff in Application or docuemnt classes, so you could try (only for debugging) to comment out deletions from the Appui's destructor, to see which item there is causing the problem. this would mean leaking memory so you should use this only to find out the part that causes the error.

    and once you have limited the possible area of the panic, then just see what inside it could causing the panic. anyway, deleting a NULL pointer is ok, so don't mind of those. it is most likely a deletion of a non-NULL pointer that is not valid, or usage of a pointer that is either NULL or non-valid.

  9. #9
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    Quote Originally Posted by symbianyucca View Post
    I'm nearly sure the actual line is inside a destructor still, basically when you call the exit, it will stop the active scheduler, which after your application framework is deleted. most likely you do not have too much stuff in Application or docuemnt classes, so you could try (only for debugging) to comment out deletions from the Appui's destructor, to see which item there is causing the problem. this would mean leaking memory so you should use this only to find out the part that causes the error.

    and once you have limited the possible area of the panic, then just see what inside it could causing the panic. anyway, deleting a NULL pointer is ok, so don't mind of those. it is most likely a deletion of a non-NULL pointer that is not valid, or usage of a pointer that is either NULL or non-valid.

    Err... It seems that the wxSymbianUI's dtor doesn't invoked.(derived from CAknViewAppUi)
    The break point's ASM code is
    call dword ptr [esi] near
    Does it mean that the null ptr is a function ptr??

    Regards,
    Ning

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    Debugging destructors is a bit tricky, a weak point of the toolchain. A thing which usually works is creating some dummy function, and invoking it from the destructor. Then you can put a breakpoint into the dummy function, and it will stop there.
    Last edited by wizard_hu_; 2010-10-19 at 18:16. Reason: week point, great.

  11. #11
    Registered User
    Join Date
    Aug 2010
    Posts
    14

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    I now confirm that the panic is from CAknAppUiBase::Exit, not any of wxWidgets's dtors.(Thanks for wizard_hu_'s idea!)
    When I stepped into CAknAppUiBase::Exit, after executing some lines of assembly codes, the app panicked.
    Here are the assembly codes executed:

    0x00744190 push ebp
    0x00744191 mov ebp,esp
    0x00744193 push esi
    0x00744194 sub esp,0x8
    0x00744197 mov eax,0xcccccccc
    0x0074419c mov dword ptr [esp],eax
    0x0074419f mov dword ptr [esp+0x4],eax
    0x007441a3 mov dword ptr [ebp-0xc],ecx
    0x007441a6 mov eax,dword ptr [ebp-0xc]
    0x007441a9 cmp dword ptr [eax+0x34],0x0 // pointer [eax+0x34] is null.
    0x007441ad je $+0x23 // panics
    Yet I now have no idea how to debug this...

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,568

    Re: Any help for wxSymbian? KERN-EXEC 3 panic when the sample app exits

    It is unlikely that someone will recognize assembly code for you. If it is your destructor, switch back to C++ view, that would be more useful.

Similar Threads

  1. [copy] App exits throwing KERN-EXEC 3
    By anuprojekar in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2010-04-29, 04:26
  2. App exits throwing KERN-EXEC 3
    By anuprojekar in forum Series 40 & S60 Platform Feedback Archive
    Replies: 1
    Last Post: 2010-04-24, 09:39
  3. Replies: 2
    Last Post: 2010-04-23, 11:49
  4. KERN-EXEC 3 or 0 with GPS sample code
    By neil.young in forum Symbian
    Replies: 12
    Last Post: 2009-10-14, 20:50
  5. Replies: 5
    Last Post: 2008-12-12, 09:42

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •