×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Panic KERN-EXEC 3

    Hello,

    I get a KERN_EXEC 3 panic for the following piece of code in my app:
    TInt err = iBitmap->Load(KCardsFile, iPlayerHand[i]);

    if(KErrNone != err)
    {
    RDebug::Printf("Error Loading File %s\n", KCardsFile);
    }
    else if(KErrNone == err)
    {
    gc.DrawBitmap(rect, iBitmap);
    }


    The line of code highlighted in the debugger is
    RDebug::Printf("Error Loading File %s\n", KCardsFile);

    KCardsFile has been set to the genereated .mbm file
    _LIT(KCardsFile, "\resources\apps\\Cards.mbm");

    The stack trace at the time of panic shows the variable values as follows:

    this 0x43194bcc
    CCoeControl 0x43194BCC
    iBitmap 0x43194e80
    CBase 0x43194E80
    iFbs 0x43190734
    iAddressPointer 0x00000000
    iFlags 0
    iUseCount 0
    iHandle 0
    iServerHandle 0
    iBitmapError 0
    iDeckOfCards 0x43194c74
    iPlayerHand
    iPhoneHand
    iNumPlayerCards 3
    iNumPhoneCards 3
    iPlayerWins 0
    iPhoneWins 0
    iGameMode EModePlaying
    KCardsFile 0x004082B0
    rect 0x4315D958
    gc 0x43190FE8
    i 0
    err -28

    I am not sure why I get this panic. Any suggestions would be appreciated.

    TIA
    Vin

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

    Re: Panic KERN-EXEC 3

    You should propably not load the image in a draw function, since it is executed multiple times, thus try having it in a ConstructL or some other functio which execution you can actually control. As well as it might be good to just check which excat line is giving the panic.

  3. #3
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Panic KERN-EXEC 3

    Thanks for the prompt response. I am loading the image in the draw function as there are multiple images (3 images to be precise), which are loaded and discarded in a loop.
    So I create the view object in ConstructL() and then load the images in the Draw() method.
    I am not sure how to check the exact line, as I am not very familiar with the debugger.
    As I mentioned in my last post, the line highlighted in the debugger is the one with the RDebug::Printf() statement.

    thanks
    vin

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Panic KERN-EXEC 3

    Your Draw function is called multiple times, and you dont really have a control for it. So then try loading the image in the "loop", note though that you can not use any for-while-etc loops, since they would prevent any redraw events.

    Also you could check the pointers that they are non-NULL before using them. and remember to set any pointer that is deleted to NULL, these two things usually take away most of the Kern-Exec 3 panics.

  5. #5
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Panic KERN-EXEC 3

    In fact, I load the image within the loop itself. I then reset the bitmap object before loading the next image. Here's the code for the Draw method:

    void CCardGameGUIAppVer2AppView::Draw(const TRect& aRect) const
    {
    TRect rect = Rect();
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();
    if (EModePlaying == iGameMode)
    {
    for(TInt i=0; i<iNumPlayerCards; i++)
    {
    gc.Clear(rect);
    iBitmap->Reset();
    TInt err = iBitmap->Load(KCardsFile, iPlayerHand[i]);
    if(KErrNone != err)
    {
    RDebug::Printf("Error Loading File %s\n", KCardsFile);
    }
    else if(KErrNone == err)
    {
    gc.DrawBitmap(rect, iBitmap);
    }
    }
    }

    thanks
    Vin

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Panic KERN-EXEC 3

    That will also not work. Thus try out for example a timer that calls a function in which you delete the old image, and make completel new one, and then you would just call DrawNow(), and in Draw() do check that the iBitmap is valid pointer & image.

  7. #7
    Super Contributor
    Join Date
    Mar 2008
    Posts
    1,481

    Re: Panic KERN-EXEC 3

    Can you check if iBitmap is valid?

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Panic KERN-EXEC 3

    That err=-28 in your post should be quite self-explanatory: http://wiki.forum.nokia.com/index.php/Error_codes

  9. #9
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,175

    Re: Panic KERN-EXEC 3

    Quote Originally Posted by wizard_hu_ View Post
    That err=-28 in your post should be quite self-explanatory: http://wiki.forum.nokia.com/index.php/Error_codes
    damned, my week-old-flu is making me to miss things, pretty nicely spotted.. Basically firstly there should be a drive letter, and secondly // should be used instea dof just simgle ones..

  10. #10
    Regular Contributor
    Join Date
    Aug 2010
    Posts
    347

    Re: Panic KERN-EXEC 3

    Quote Originally Posted by wizard_hu_ View Post
    That err=-28 in your post should be quite self-explanatory: http://wiki.forum.nokia.com/index.php/Error_codes
    thanks. that resolved the problem.

    Vin

Similar Threads

  1. Panic - Kern Exec 3
    By ganeshs87 in forum Symbian
    Replies: 9
    Last Post: 2010-03-09, 10:35
  2. Panic KERN-EXEC 3
    By rohitnegi in forum Symbian User Interface
    Replies: 2
    Last Post: 2010-02-26, 08:57
  3. Help with KERN-EXEC 3 panic
    By rsiudak in forum Symbian
    Replies: 1
    Last Post: 2009-11-11, 16:05
  4. Panic KERN-EXEC 3
    By Rajmittal in forum Bluetooth Technology
    Replies: 2
    Last Post: 2008-07-28, 13:12
  5. Panic KERN-EXEC 3
    By vivek_mics in forum Symbian
    Replies: 7
    Last Post: 2006-11-25, 07:10

Posting Permissions

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