×
Namespaces

Variants
Actions

Extended panic code

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Code Example
Source file: Media:Errrd KB.zip
Article
Created: ltomuta (08 Mar 2007)
Last edited: hamishwillee (27 Sep 2012)

If your application generates a panic it will be closed and an error note is shown by the OS: "Program closed:/n%S" where %S is your application's name.

In emulator, if just in time debugging is enabled, a panic will launch the debugger instead of displaying a panic note and terminating the thread. Some Symbian Software Development Kit releases have just in time debugging enabled by default. You can disable it by editing %EPOCROOT%\epoc32\data\epoc.ini and making sure the following line exists in the file:
JustInTime 0

Contents

S60 1st and 2nd Edition

To get the emulator/device display the reason and error code for panics, create a zero-sized file named ErrRd (no file name extension) under the PC's directory %EPOCROOT%\epoc32\wins[cw|b]\c\system\bootdata\.

On the device, you should create a zero-sized file ErrRd (no file name extension) under the directory c:\system\bootdata\. You can use a file explorer application (for instance, FExplorer) to create the file, or if none is available, use a signed sis file.

S60 3rd Edition and later

To get the emulator display the reason and error code for panics, start the emulator, then open its Tools -> Preferences menu, and finally make sure the "Extended panic code file" option is checked on the C++ Debug tab. (This has the effect of creating a zero-sized file named ErrRd (no file name extension) under the PC's directory %EPOCROOT%\epoc32\wins[cw|b]\c\resource\.)

On the device, you should create a zero-sized file ErrRd (no file name extension) under the directory c:\resource\. You can use a file explorer application (for instance, YBrowser) to create the file, or if none is available, deploy the file through a SIS file. In case you don't want to use ErrRd, then you could also use Y-Tasks Crash monitor or Panic Observer.

Note.pngNote: You can obtain a prebuilt SIS file from here (file signature updated, valid until 2018)

Note.pngNote: You can also build your own ErrRd.sisx

Copy the following code into ErrRd.bat

@echo off
echo #{"ErrRd"},(0xEEEEEEEE),1,0,3 >ErrRd.pkg
echo %%{"ErrRd"} >> ErrRd.pkg
echo :"ErrRd" >> ErrRd.pkg
echo [0x101F7961], 0, 0, 0, {"S60 3rd ProductID"} >> ErrRd.pkg
echo [0x1028315F], 0, 0, 0, {"S60 5th ProductID"} >> ErrRd.pkg
echo [0x20022E6D], 0, 0, 0, {"Symbian^3 ProductID"} >> ErrRd.pkg
echo "nul"-"c:\resource\ErrRd" >>ErrRd.pkg
makesis ErrRd.pkg
makekeys -cert -expdays 3650 -password test -dname "CN=Developer OU=MobileDev" test.key test.cer
signsis ErrRd.sis ErrRd.sisx test.cer test.key test
del test.key
del test.cer
del .rnd
del ErrRd.sis
del ErrRd.pkg
pause
and execute it. Move the mouse horizontally when asked (it may collect several lines of dots, a message appears when it is done). After it finishes, ErrRd.sisx will be created.


Warning.pngWarning: * Do not add the ErrRd file to your application's SIS file, it will cause you update error when attempting to overwrite it.

  • Do not release this file with your application. This is an R&D tool for developers to use, it does not belong on an end-user's phone.

The results

Once this file is created, the error note shown by the OS would look like: "Program closed:/n%S/n%S %d" where the second %S is replaced by the panic reason (for example, USER, KERN-EXEC, etc.) and %d would be replaced by the panic code.

Errrd.png

Note.pngNote: *The panic reason and code are only shown on this error note; they are NOT logged into the ErrRd file.

  • The screenshots are taken from an emulator. Target devices may show even less info than illustrated in image a) (or no info at all) when the ErrRd file is missing.


A quick search in SDK's help and you will find a hint on the kind of programming error you should be hunting for in your code.

When reporting an application crash, either on Nokia Developer's Discussion Boards or to Nokia Developer's Technical Support service, please add the panic reason and code to the problem description.

Refer to the following link for: Symbian OS Error Codes.

The same trick will also enable the InfoMsg API which allows developers to print debug information in a pop-up info note showing in the top left right corner of the screen. See below such a info print as displayed by S60 5.0's FEP

Info msg.png


CEikonEnv::Static()->InfoMsg(_L("iFnKeyState = EFnKeyLock"));

Troubleshooting

Have you activated the "Extended panic code" in the emulator but it does not appear to work? See Running the emulator from Carbide.c++.

You cannot find any reference to the identified panic in the SDK (documentation and/or header files)? Add the panic reason and code to the end of Undocumented Symbian OS and S60 panics.

This page was last modified on 27 September 2012, at 08:58.
150 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×