×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    signal exception 0 received: a data abort exception has occurred.....how to resolve?

    Hi all,

    I am doing simple file operations using RFile and RFsSession. Everything works fine on emulator but when i tried to do the same on device, it failed.

    I tried with device debugging and found out that when control comes to RFile declaration, data abort exception occurs and control steps into file s32file.inl pointing to the following:

    Code:
    /** Detaches the file from this stream buffer.
    
    The intermediate buffer's read and write marks are not changed, and the stream 
    positions are not changed. This means that the contents of the file should 
    not change while it is detached. 
    
    @see Attach()
    @see Reattach() */
    	{iFile=RFile();}  <---- control gets stuck in here and when try to stop the debugger given kern-exec 3
    inline void RFileBuf::Reattach(RFile& aFile)
    Don't know what is wrong with this because it happens on a simple line which says:

    Code:
    RFile file;
    I am first creating a file and closing it. Then i repeatedly write data to it and close again. Then i open it again and there it happens when i declare RFile object.

    Any idea anyone?

    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,751

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    When accessing a member variable (iFile) fails with KERN-EXEC 3, it often means that the method is invoked on a non-existing object (like a NULL pointer, or some totally random thing). Non-virtual methods are always present in the memory, the problems start when they try accessing something from the object.
    "RFile file;" creates a local variable, it does not need the object to exist.
    Note that "iFile=RFile();" will be a strange line even after fixing the problem. Assuming that iFile is declared as "RFile iFile;" in the header file, it does not need any further instantiation.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    Ok but what do you suggest i should try doing to fix this. This is happening everytime. Is it a good idea to make RFile an instance of the class rather than local variable?

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

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    the crash likely comes from something else, so do try checking the line again.

    Also do check the actual panic code: http://www.developer.nokia.com/Commu...ded_panic_code

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    I hope so because this doesn't seem to make any sense. I already tried that and extended panic code as i told in thread is KERN-EXEC 3 but how do i find the exact place where the panic is coming from except device debugging?

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

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    in general, you would not get Kern-Exec 3 with R-Class objects, unless something not-so-usual goes wrong in there. One reason would be stack-overrun, which you could fix by increasing the default stack.

    Anyway, I would strongly suggest that you do re-check which line of code is giving this particular panic.

  7. #7
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    Ok can you provide me some link to HookLogger as well which might help me out in this kind of situation? I am developing on carbide++ 2.7 for S60 3rd FP1

    thanks

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

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    You don't need any special tools, you could simply use file logging to see what is the line that gets executed last. Also you should write any possible error codes you could get as return values or with TRAP's before you get to the line that causes the panic.

  9. #9
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    Trying to use RFileLogger like below but i am not able to create the directory or file at the specified path

    Code:
    _LIT(KLogDir,"c:\\data\\");
    _LIT(KLogFile,"logfile.txt");
    RFileLogger iFileLogger;
    	iFileLogger.CreateLog(KLogDir, KLogFile, EFileLoggingModeOverwrite);
        iFileLogger.Write(_L("file declared"));
    iFileLogger.CloseLog();
    iFileLogger.Close();
    i tried different combinations but could not create the directory or file

    any idea?

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

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    For quick and dirty alternative, you could also try using global notes: http://www.developer.nokia.com/Commu...i/Global_notes

    Basically the execution is hanging when note is shown, also do remember that with Global notes the UI focus is taken from the app, thus use it only if your application logic does not do anything on focus changes etc.

  11. #11
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,089

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    I utilized the file logging in the following way:

    1) Include the filelogger.h in the project's inc folder (attachment)

    2) Include in mmp file : LIBRARY flogger.lib

    3) In the pkg file, send a dummy file to the location where you want to create the log directory, E.g.:
    (no need to write any code to create the directory & file)

    "xyz.txt" - "C:\data\Mylogs\logfile.log"

    4) Mention the same name of directory & file in the header attached( filelogger.h)

    5) Include the filelogger.h in the source files where you want to create logs & use it as : __LOGSTR_TOFILE("FunctionStarted"); (as defined in filelogger.h)
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    hi yucca,

    i tried the global notes after commenting everything else but still getting KERN-EXEC 3 on app crash on RFile file; line.

  13. #13
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    Thanks vineet. I will try this for sure.

    The issue that i am talking about here is not coming up in emulator. Everything works great there. Its just on the device.

  14. #14
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,089

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    Can you paste here the full code. Also try declaring some other variable as well at the same time when RFile's object is declared(when panic comes) & see if it fails as well( for e.g. declare TBuf<5>iTestBuf or else)

  15. #15
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: signal exception 0 received: a data abort exception has occurred.....how to resol

    sure here it is:

    Code:
        RFile file;  <---------control comes at this line and goes to s32file.inl as i mentioned in first comment and app crashes with KERN EXEC 3....emulator is fine with this though
        TInt error = file.Open(iFsSession, KFileData, EFileRead);
    
        TInt pos = 0;
        TInt fileSize;
        file.Size(fileSize);
        file.Seek(ESeekEnd, pos);
    
        TUint dataLength = pos;
        const TInt size = fileSize;
        TBuf8<54601>data8;
        pos = 0;
        file.Seek(ESeekStart, pos);
        TInt errRead = file.Read(data8);
        file.Close();
        data8.TrimAll();
        TInt actionTagPos = data8.Find(_L8("action="));
        TInt methodTagPos = data8.Find(_L8("method"));
        iActionUrl.Copy(data8.Mid(actionTagPos+8, methodTagPos-actionTagPos-10));
        TInt optionTagStartPos = data8.Find(_L8("<option>"));
        TInt selectTagEndPos = data8.Find(_L8("</select>"));
        TInt xmlDataLength = selectTagEndPos-optionTagStartPos;
        
        if(iXmlData)
        	{
        	delete iXmlData;
        	iXmlData = NULL;
        	}
        iXmlData = HBufC8::NewL(xmlDataLength+23);
        TInt totalLengthNow = data8.Length();
        iXmlData->Des().Copy(_L8("<countries>"));
        iXmlData->Des().Append(data8.Mid(optionTagStartPos, xmlDataLength));
        iXmlData->Des().Append(_L8("</countries>"));    
        iXmlData->Des().TrimAll();
        
        RFile xmlFile;
        TInt errCreate = xmlFile.Create(iFsSession, KFileXmlData, EFileWrite);
        xmlFile.Write(iXmlData->Des());
        xmlFile.Close();
        TInt errDelete = iFsSession.Delete(KFileData);

Similar Threads

  1. Replies: 1
    Last Post: 2011-12-22, 13:57
  2. Suspended: Signal 'Exception 0' received. Description: A data abort exception occured
    By amit04.kumar in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2010-10-12, 12:57
  3. Replies: 6
    Last Post: 2010-06-16, 09:21
  4. Replies: 4
    Last Post: 2009-12-11, 09:43

Posting Permissions

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