×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Dec 2009
    Posts
    19

    Panic - Kern Exec 3

    Hi ,
    I am getting kern exec 3 panic in d following code .Can anyone please help me resolving the code ?

    IN DB AppUi.cpp


    void CDBAppUi::AddStudentL(const TDesC& name,const TDesC& id,const TInt date,const TInt month,const TInt year,
    const TDesC& gender,const TDesC& age,const TDesC& father,const TDesC& course,const TDesC& sem,const TDesC& branch,const TDesC& school,const TDesC& address,const TDesC& university,const TDesC& mobile)
    {

    _LIT(KErrorMsg,"Failed. Make sure the fields are not empty.");
    TInt err(KErrNone);
    err = StudentDb->insert_student(name,id,date,month,year,gender,age,father,course,sem,branch,school,address,university,mobile);
    //HERE S WHERE I AM GETTING THE PANIC

    if(err)
    ShowNoteL(KErrorMsg);
    // else
    // ShowAllStudentsL();
    }

    In DBEngine.CPP :-

    TBool CStudentDb::insert_student(const TDesC& name,const TDesC& id,const TInt date,const TInt month,const TInt year,
    const TDesC& gender,const TDesC& age,const TDesC& father,const TDesC& course,const TDesC& sem,const TDesC& branch,const TDesC& school,const TDesC& address,const TDesC& university,const TDesC& mobile )
    {
    _LIT(KSelect, "SELECT ");
    _LIT(KFrom, " FROM ");
    _LIT(KOrderBy, " ORDER BY ");
    _LIT(KDot, ", ");


    TBuf<KCustomSqlMaxLength> sqlStr;

    sqlStr.Append(KSelect);
    sqlStr.Append(name);
    sqlStr.Append(KDot);
    sqlStr.Append(id);
    sqlStr.Append(KDot);
    sqlStr.Append(date);
    sqlStr.Append(KDot);
    sqlStr.Append(month);
    sqlStr.Append(KDot);
    sqlStr.Append(year);
    sqlStr.Append(KDot);
    sqlStr.Append(gender);
    sqlStr.Append(KDot);
    sqlStr.Append(age);
    sqlStr.Append(KDot);
    sqlStr.Append(father);
    sqlStr.Append(KDot);
    sqlStr.Append(course);
    sqlStr.Append(KDot);
    sqlStr.Append(sem);
    sqlStr.Append(KDot);
    sqlStr.Append(branch);
    sqlStr.Append(KDot);
    sqlStr.Append(school);
    sqlStr.Append(KDot);
    sqlStr.Append(address);
    sqlStr.Append(KDot);
    sqlStr.Append(university);
    sqlStr.Append(KDot);
    sqlStr.Append(mobile);
    sqlStr.Append(KFrom);
    sqlStr.Append(KStudentsTable);
    sqlStr.Append(KOrderBy);
    sqlStr.Append(name);
    sqlStr.Append(KDot);
    sqlStr.Append(KStudentsSchoolCol);


    RDbView view;
    TInt error;
    error = view.Prepare(iStudentDb, TDbQuery(sqlStr, EDbCompareFolded));
    if(error!=KErrNone)
    {
    return error;
    }
    error = view.EvaluateAll();
    if(error!=KErrNone)
    {
    return error;
    }
    RDbColWriteStream writeStream;

    TRAP(error,
    view.InsertL();
    view.SetColL(1,name);
    view.SetColL(2,id );
    view.SetColL(3,date);
    view.SetColL(4,month);
    view.SetColL(5,year);
    writeStream.OpenL(view,6);
    writeStream.WriteL(gender);

    writeStream.OpenL(view, 7);
    writeStream.WriteL(age);

    writeStream.OpenL(view, 8);
    writeStream.WriteL(father);

    writeStream.OpenL(view, 9);
    writeStream.WriteL(father);

    writeStream.OpenL(view, 10);
    writeStream.WriteL(course);

    writeStream.OpenL(view, 11);
    writeStream.WriteL(sem);

    writeStream.OpenL(view, 12);
    writeStream.WriteL(course);

    writeStream.OpenL(view, 13);
    writeStream.WriteL(school);

    writeStream.OpenL(view, 14);
    writeStream.WriteL(course);

    );
    if(error!=KErrNone)
    {
    return error;
    }
    writeStream.Close();
    TRAP(error, view.PutL());
    if(error!=KErrNone)
    {
    return error;
    }
    view.Close();
    return KErrNone;

    return ETrue;

    }

    Please help me to resolve this panic.

    Thanking you,
    Ganesh

  2. #2
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Panic - Kern Exec 3

    Hi Ganesh,

    see in the ShowNoteL(KErrorMsg),what exactly u r doing there. Debug into the method,
    Kern Exec3 , u must be trying to access the variable which u have not created not must be trying to access the deletable data.

    if possible share the code

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

    Re: Panic - Kern Exec 3

    Hi,
    You can check insert_student and see if you are writing data (Descriptor) out of range or some memory that has not been allocating and using it.

  4. #4
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Panic - Kern Exec 3

    Hi,

    chk whether the instance of RBdNamedDatabase iStudentDb has been instantiated or not.

  5. #5
    Registered User
    Join Date
    Dec 2009
    Posts
    19

    Re: Panic - Kern Exec 3

    Hi,
    I can share my code. Can u please give me your mail id ? I ll mail you the code .

  6. #6
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Panic - Kern Exec 3

    i have send u the mail id...

  7. #7
    Registered User
    Join Date
    Dec 2009
    Posts
    19

    Re: Panic - Kern Exec 3

    I have sent you the code . Please check and let me know where should i make the corrections . Thank you for your time and help .

  8. #8
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Panic - Kern Exec 3

    let me chk...

  9. #9
    Regular Contributor
    Join Date
    Jun 2007
    Location
    Bangalore
    Posts
    208

    Re: Panic - Kern Exec 3

    where are u creating the instance of StudentDb;I think u have forgot to call yur OpenDatabaseL() method.

    call yur OpenDatabaseL() method from the constructL(), it will solve yur prob.
    and better that u mentain the array of structure, instead of passing so many arguments.
    Calling each and every time yur insert_student method will decrease the performance.

  10. #10
    Registered User
    Join Date
    Jul 2009
    Posts
    259

    Re: Panic - Kern Exec 3

    Either you are accessing a null pointer to call some function or your stack size should be increased to remove that error.

    Thanks

Similar Threads

  1. getting panic KERN - EXEC 3
    By rohitnegi in forum Symbian User Interface
    Replies: 2
    Last Post: 2010-02-22, 11:01
  2. EXit() returns Kern Exec 3 panic
    By jey_ in forum Symbian
    Replies: 5
    Last Post: 2009-03-03, 14:17
  3. panic kern exec 3 error need help
    By urban37 in forum Symbian User Interface
    Replies: 13
    Last Post: 2008-12-17, 08:24
  4. Replies: 4
    Last Post: 2008-03-05, 09:30
  5. Replies: 2
    Last Post: 2007-07-19, 01:29

Posting Permissions

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