开发者

CDirScan function NextL raises KERN-EXEC 0

CDirScan function NextL raises "Main Panic KERN-EXEC 0" if it is not called right away SetScanDataL() (i.e. if it is called later within the same active object after another event)

f1() - called within active object

iDirScan = CDirScan::NewLC(aFs);
iDirScan->SetScanDataL(aPath, 
    KEntryAttDir|KEntryAttMatchExclusive,开发者_运维百科 
    ESortNone, CDirScan::EScanDownTree);
//wait for some asynchronous event

f2() - called within the same active object, after some asynchonous event

CDir* dir = NULL;
TRAPD(error, iDirScan->NextL(dir)); -->> "Main Panic KERN-EXEC 0"

If iDirScan->NextL() is called before waiting for some asynchronous event, everything works fine.

Why CDirScan variable looses its validity? Note that the asynchronous event has nothing to do, it can be a simple dummy timer.


I wrote some test code in an attempt to reproduce this but couldn't.

Generally, KERN-EXEC 0 panics are most often caused by stale R object handles. For example, make sure that the RFs handle you pass to CDirScan is not closed too early.


Could you post more of your code to analyze?

Does this two parts of code are in different functions f1, f2, or both are in one function f1, this is not clear for me?

Also if iDirScan is part of your class you shouldn't leave it on cleanup stack (NewLC) function.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜