The KERN EXEC 3 ERROR

Login to reply to this topic.
Wed, 2007-09-19 10:16
Joined: 2007-08-26
Forum posts: 14

HI,ALL:

MY code cause the KERN EXEC 3 error.My code is show below:

RAknsSrvSession skinsSession;
User::LeaveIfError( skinsSession.Connect( this ) );
CleanupClosePushL( skinsSession );

TAknsPkgIDBuf pidBuf;
CRepository* repository =
CRepository::NewL( KCRUidPersonalisation );
TInt retVal = repository->Get( KPslnActiveSkinUid, pidBuf );
delete repository;
repository = NULL;
iOriginalSkinPid.SetFromDesL( pidBuf );

CArrayPtr< CAknsSrvSkinInformationPkg >* skinInfoArray =
skinsSession.EnumerateSkinPackagesL();
CleanupStack::PushL( skinInfoArray );

TInt retValue( KErrNone );

TAknsPkgID pkgId = skinInfoArray->At( 0 )->PID();

retValue = skinsSession.SetAllDefinitionSets( pkgId );
if ( retValue == KErrNone )
{
TAknsPkgIDBuf pidBuf;
pkgId.CopyToDes( pidBuf );
CRepository* repository =
CRepository::NewL( KCRUidPersonalisation );
TInt retVal = repository->Set( KPslnActiveSkinUid, pidBuf );

delete repository;
repository = NULL;
}
break;
}
skinInfoArray->ResetAndDestroy();
CleanupStack::PopAndDestroy( 2 );
}
}

I can't find the problem in the code.then,the code "retValue = skinsSession.SetAllDefinitionSets( pkgId );"may cause error.
But ,I don't know what is the mistake !!!
the code can change the active theme.
pls help me !!!
thank you in advance!




Wed, 2007-09-19 10:31
Joined: 2004-05-21
Forum posts: 285
Re: The KERN EXEC 3 ERROR

KERN EXEC 3 is a common panic in Symbian happens mostly because of invalid handle. Check out which is the statement whcih is panking. If you dont know how, run in debug mode and see the last function in your code executed from the call stack when panic is raised.

Cheers,
Sri

Wed, 2007-09-19 15:33
Joined: 2004-11-29
Forum posts: 1142
Re: The KERN EXEC 3 ERROR

No!
Kern-Exec 3 is seldom caused because of an invalid handle.

Technically, it means "unhandled exception", and most commonly it happens because you try to access memory areas you are not allowed to access, for example by trying to use a pointer that is NULL.

An invalid handle will give you Kern-Exec 0.

The call stack trick sirkanth meantions hasn't worked for me in public SDKs, only in partner or licensee baselines unfortunately... Though I don't know how Carbide handles it...
You can also put a breakpoint in the function, and step line by line, and find which line gives you the panic.

Thu, 2007-09-20 05:08
Joined: 2004-05-21
Forum posts: 285
Re: The KERN EXEC 3 ERROR

Thanks for correcting alh.

Cheers,
Sri

Thu, 2007-09-20 07:26
Joined: 2007-08-20
Forum posts: 21
Re: The KERN EXEC 3 ERROR

1st thing that u need to do is ...make log / debug, to get exactly which line is crashing .. Smiling

saur

Thu, 2007-09-20 08:38
Joined: 2007-08-26
Forum posts: 14
Re: The KERN EXEC 3 ERROR

when I exit the program,error happen.I debug the program,but I can't find which line crash.I also try to put the code in the exit even handle function .when I press the rightsoftkey,the program exit ,this time the program work well.error don't happen.when I put the code in other place ,error happen. I really how to do now?

Thu, 2007-09-20 09:56
Joined: 2007-07-25
Forum posts: 2
Re: The KERN EXEC 3 ERROR

Eric,
Sorry, a KERN-EXEC panic 3 is one of the most elusive one to plug. A few things here:-
a) Are you really sure that this is the code fragment causes the error? Silly question but I wanted to make sure...
b) The code looks like a part of a loop or switch-case structure (see the "break"), so I really can't judge which line may cause the prob. The parantheses are not balanced.
c) If it is indeed a part of a loop, then you would like to go through the loop logic and see if there is anything in there that's causing the prob.
d) This code looks particularly fishy :-
TAknsPkgID pkgId = skinInfoArray->At( 0 )->PID();
It would be a good idea to check what is the size of the array AND the value of pkgId if array-size >= 1. It may possibly give you an out-of-bound exception or an access violation.
Good luck.

  • Login to reply to this topic.