KERN EXEC 0

Login to reply to this topic.
Thu, 2008-08-28 15:52
Joined: 2007-07-12
Forum posts: 7

Hi,

I am getting KERN-EXEC 0, while attempt to Seek() on a file that being used by Real Player for playing a video. I am attaching the code for reference. I marked the line with BOLD which cause the panic. please help me.

/*
========================================================================
Name : VideoTest1VideoRenderer.cpp
Copyright : Your copyright notice
Description :
========================================================================

CVideoTest1VideoRenderer::CVideoTest1VideoRenderer()
{

}
/**
* Destroy child controls.
*/
CVideoTest1VideoRenderer::~CVideoTest1VideoRenderer()
{
iFileHandler=NULL;
delete iFileHandler;
}

CVideoTest1VideoRenderer* CVideoTest1VideoRenderer::NewL(const TRect& aRect,
const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
{
CVideoTest1VideoRenderer* self = CVideoTest1VideoRenderer::NewLC (aRect,
aParent, aCommandObserver);
CleanupStack::Pop ( self);
return self;
}

CVideoTest1VideoRenderer* CVideoTest1VideoRenderer::NewLC(const TRect& aRect,
const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
{
CVideoTest1VideoRenderer* self = new ( ELeave ) CVideoTest1VideoRenderer();
CleanupStack::PushL ( self);
self->ConstructL ( aRect, aParent, aCommandObserver);
return self;
}

void CVideoTest1VideoRenderer::ConstructL(const TRect& aRect,
const CCoeControl* aParent, MEikCommandObserver* aCommandObserver)
{
if ( aParent == NULL)
{
CreateWindowL ();
}
else
{
SetContainerWindowL ( *aParent);
}
iFocusControl = NULL;
iCommandObserver = aCommandObserver;
InitializeControlsL ();
SetRect ( aRect);
ActivateL ();
}

TInt CVideoTest1VideoRenderer::CountComponentControls() const
{
return ( int ) ELastControl;
}

CCoeControl* CVideoTest1VideoRenderer::ComponentControl( TInt aIndex) const
{
switch ( aIndex)
{
}
return NULL;
}

void CVideoTest1VideoRenderer::SizeChanged()
{
CCoeControl::SizeChanged ();
LayoutControls ();
}

void CVideoTest1VideoRenderer::LayoutControls()
{
}

TKeyResponse CVideoTest1VideoRenderer::OfferKeyEventL(
const TKeyEvent& aKeyEvent, TEventCode aType)
{

if ( iFocusControl != NULL&& iFocusControl->OfferKeyEventL ( aKeyEvent,
aType)== EKeyWasConsumed)
{
return EKeyWasConsumed;
}
return CCoeControl::OfferKeyEventL ( aKeyEvent, aType);
}

void CVideoTest1VideoRenderer::InitializeControlsL()
{
iFileHandler = CFileHandler::NewL ();

#ifndef __WINS__
_LIT(fileLocation,"sample_test.mp4");
#else
_LIT(fileLocation,"sample_test.mp4");
#endif

TFileName path = PathInfo::PhoneMemoryRootPath ();
path.Append (PathInfo::VideosPath ());
path.Append (fileLocation);

CDocumentHandler* iDocHandler;
#ifdef __SERIES60_3X__
iDocHandler = CDocumentHandler::NewL();
#else
iDocHandler = CDocumentHandler::NewL ( CEikonEnv::Static()->Process ());
#endif
TBool isOpen;
CCoeEnv::Static()->FsSession().IsFileOpen (path, isOpen);
RFile writeFile;
TInt err = writeFile.Open (CCoeEnv::Static()->FsSession (), path,
EFileShareReadersOrWriters);
User::LeaveIfError (err);
CleanupClosePushL (writeFile);
_LIT8(KMimeType, "video/mp4v");
TDataType data = TDataType (KMimeType);
TInt err1 = iDocHandler->OpenFileEmbeddedL (writeFile, data);
User::LeaveIfError (err1);
CleanupStack::PopAndDestroy ();
}

void CVideoTest1VideoRenderer::HandleResourceChange( TInt aType)
{
CCoeControl::HandleResourceChange ( aType);
SetRect ( iAvkonViewAppUi->View( TUid::Uid( EVideoTest1VideoRendererViewId ) )->ClientRect());

}

void CVideoTest1VideoRenderer:raw( const TRect& aRect) const
{
CWindowGc& gc = SystemGc ();
gc.Clear ( aRect);

}

/*
========================================================================
Name : FileHandler.cpp
Copyright : Your copyright notice
Description :
========================================================================
*/

#include "FileHandler.h"
#include
#include
#include
#include
#include
#include

CFileHandler::CFileHandler() :
CActive(EPriorityHigh)
{

}

CFileHandler::~CFileHandler()
{
iTimer.Close ();
Cancel ();
}

CFileHandler* CFileHandler::NewL()
{
CFileHandler* self=new (ELeave) CFileHandler;
self->ConstructL ();
return self;
}
TBuf8<411214> firstChunkOfData;
TBuf8<522242> secondChunkOfData;
void CFileHandler::ConstructL()
{
Cancel ();
User::LeaveIfError (iTimer.CreateLocal ());
CActiveScheduler::Add (this);

// TBuf8<522242> secondChunkOfData;
_LIT(readFileName,"sample.mp4");
TFileName readFilePath = PathInfo::PhoneMemoryRootPath ();
readFilePath.Append (PathInfo::VideosPath ());
readFilePath.Append (readFileName);

RFile iReadFile;
User::LeaveIfError (iReadFile.Open (CCoeEnv::Static()->FsSession (), readFilePath,
EFileStream|EFileShareReadersOnly|EFileRead));
CleanupClosePushL (iReadFile);
User::LeaveIfError (iReadFile.Read (firstChunkOfData));
TInt seekPos = 411214;
User::LeaveIfError (iReadFile.Seek (ESeekStart, seekPos));
User::LeaveIfError (iReadFile.Read (secondChunkOfData));
iReadFile.Close ();
CleanupStack::PopAndDestroy ();
WriteToFile (firstChunkOfData, ETrue);

iTimer.After (iStatus, TTimeIntervalMicroSeconds32 (2*1000000));
SetActive ();
}

void CFileHandler::RunL()
{
Cancel ();
WriteToFile (secondChunkOfData, EFalse);
iTimer.Cancel ();
iTimer.Close ();
}
TFileName writeFilePath;

void CFileHandler::WriteToFile(const TDes8& fileChunk, TBool isFirst)
{
_LIT(writeFileName,"sample_test.mp4");
writeFilePath = PathInfo::PhoneMemoryRootPath ();
writeFilePath.Append (PathInfo::VideosPath ());
writeFilePath.Append (writeFileName);

RFile iWriteFile;
TInt err = iWriteFile.Open (CCoeEnv::Static()->FsSession (), writeFilePath,
EFileStream|EFileShareReadersOrWriters|EFileWrite);
if ( err!=KErrNone)
User::LeaveIfError (iWriteFile.Create (CCoeEnv::Static()->FsSession (), writeFilePath,
EFileStream|EFileShareReadersOrWriters|EFileWrite));

CleanupClosePushL (iWriteFile);
RFileWriteStream OutputFileStream(iWriteFile);
OutputFileStream.PushL ();

if ( !isFirst)
{
TInt seekPos = 411214;
TInt mySize;
iWriteFile.Size (mySize);
TInt myError=iWriteFile.Seek (ESeekStart, seekPos); //this line throws the panic
User::LeaveIfError (myError);
OutputFileStream.WriteL (fileChunk);
}
else
OutputFileStream.WriteL (fileChunk);

OutputFileStream.CommitL ();
OutputFileStream.Pop ();
OutputFileStream.Release ();
iWriteFile.Close ();

CleanupStack::PopAndDestroy ();

}

void CFileHandler::LaunchRealPlayer()
{
/* CDocumentHandler* iDocHandler;
#ifdef __SERIES60_3X__
iDocHandler = CDocumentHandler::NewL();
#else
iDocHandler = CDocumentHandler::NewL ( CEikonEnv::Static()->Process ());
#endif
TBool isOpen;
CCoeEnv::Static()->FsSession().IsFileOpen (writeFilePath, isOpen);
if ( !isOpen)
{
TInt err = iWriteFile.Open (CCoeEnv::Static()->FsSession (), writeFilePath,
EFileShareReadersOrWriters|EFileWrite|EFileStream);
User::LeaveIfError (err);
CleanupClosePushL (iWriteFile);
}

TDataType data = TDataType (KMimeType);
TInt err = iDocHandler->OpenFileEmbeddedL (iWriteFile, data);
User::LeaveIfError (err);
*/
}

void CFileHandler:oCancel()
{
iTimer.Cancel ();
}

TInt CFileHandler::RunError(TInt /*aError*/)
{
return KErrNone;
}

Please guide me what's the problem?

-Ashish Garg


Fri, 2008-08-29 07:37
Joined: 2007-08-26
Forum posts: 59
Re: KERN EXEC 0

KERN EXEC 0
This panic is raised when the Kernel Executive cannot find an object in the object index for the current process or current thread using the specified object index number (the raw handle number).

Fri, 2008-08-29 07:40
Joined: 2007-07-12
Forum posts: 7
Re: KERN EXEC 0

Hi Amit,

Thanks for your reply, I have also read the same about KERN-EXEC 0 on the forums, but didn't able to solve the issue Sad.

-Ashish Garg

Fri, 2008-08-29 07:52
Joined: 2007-08-26
Forum posts: 59
Re: KERN EXEC 0

i guess u need to check seekpos. May be offset specified is greater than the size of the file

Fri, 2008-08-29 08:53
Joined: 2005-11-20
Forum posts: 1242
Re: KERN EXEC 0

Not related to the immediate problem at hand, but probably another error that I saw looking at the code:

CVideoTest1VideoRenderer::~CVideoTest1VideoRenderer()
{
iFileHandler=NULL;
delete iFileHandler;
}

Setting NULL *before* you delete is not what you want. (And setting the pointer NULL *after* the delete is unnecessary inside a destructor.)


René Brunner

Fri, 2008-08-29 09:13
Joined: 2007-07-12
Forum posts: 7
Re: KERN EXEC 0

Thanks rbunner................. i am very beginner with Symbian.......just started 4 days back.

Mon, 2008-10-20 08:51
Joined: 2008-10-20
Forum posts: 1
Re: KERN EXEC 0

Hi
I am very beginner with Symbian Thank you

__________________________________________
Gmail Rocks Yahoo Mail Rocks

  • Login to reply to this topic.