USER 0
| Wed, 2005-01-26 06:46 | |
|
What does the panic USER 0 mean? The docs says the following
Quote This panic is raised when a thread calls User::Invariant(). Typically, User::Invariant() is called when a test for a class invariant fails, i.e. when a test which checks that the internal data of an object is self-consistent, fails. Check the design and implementation of your class. What does "internal data of an object is selfconsistent" mean? What object? What could be wrong? I hope the answer to this isn't "anything"... In my program I get this error the second time I go through the same code. I feel that is strange.... Another strange thing is that it doesn't seem to happen regularly... ![]() I also found (http://www.symbian.com/developer/techlib/v70sdocs/doc_source/reference/cpp/SystemStaticFunctions/UserClass.html) that: Code: Such tests are almost always done in debug builds, commonly using the __ASSERT_DEBUG macro. However, I have no __ASSERT_DEBUG macro in my code. |
|







Forum posts: 1379
Most people should do tests with something like this:
__ASSERT_DEBUG(iState == EThisState, User::Panic("A FRIENDLY CAT NAME", A USEFUL NUMBER);
So you can get more info.
Some lazy people (and it's a few places in the OS!) do this:
__ASSERT_DEBUG(iState == EThisState, User::Invariant());
Which gives you no clue at all to whats going on
Your only bet is to find the line thats raising it ..
didster
Forum posts: 349
It seems like my USER 0 panic occurs not the first, but the second time the following code is run. I don't know how to solve this problem.
dlg->PrepareLC(R_DIALOG_POPUP_MESSAGE);
dlg->QueryHeading()->SetTextL(aTitle);
dlg->RunLD(); //<---Just after this dialog is displayed the second time, USER 0 panic happens
Forum posts: 1379
didster
Forum posts: 349
Ok... when you mention it I put a breakpoint in DoCancel and fount out that it is not run even though I have called Cancel();. I guess it should call DoCancel - right?
It doesn't seem to matter how long time I wait... the panic comes exactly on the same place in the code anyway. If I don't misunderstand this the panic will come when the active object completes, which is a matter of time - or am I wrong?
Forum posts: 1379
if(IsActive())
{
DoCancel();
User::WaitForRequest(iStatus);
}
Does Cancel() return?
Well, we can't really say when it will happen, cause we don't really know whats causing it yet.
didster
Forum posts: 349
Forum posts: 1379
Not the desctuctor I hope!
If you can't figure it out, email me it (sure you still have my address) with an expliation of where it is, and how to get there, and ill have a look
didster
Forum posts: 349
{
switch (iStatus.Int()) {
case KErrNone:
{// Character has been read from socket
if (iBuffer_tmp.Length() > 0) {
iBuffer.Append(iBuffer_tmp);
iBuffer_tmp.Zero();
}
IssueRead(); // Immediately start another read
break;
}
case KErrDisconnected:
{
iEngineNotifier.ReportError(MEngineNotifier::EDisconnected, iStatus.Int());
break;
}
case KErrEof:
{
if (iBuffer_tmp.Length() > 0) {
iBuffer.Append(iBuffer_tmp);
iBuffer_tmp.Zero();
}
iEngineNotifier.ResponseReceived(iBuffer);
Cancel();
break;
}
default:
{
iEngineNotifier.ReportError(MEngineNotifier::EGeneralReadError, iStatus.Int());
break;
}
}
}
void CSocketsEngine::ResponseReceived(const TDesC8& aBuffer)
{
iTimer->Cancel();
if (iGlobalProgressDialog) {
iGlobalProgressDialog->UpdateProgressDialog(iRequestSize, iRequestSize);
User::After(200000);
iGlobalProgressDialog->ProcessFinished();
}
...
if (iConsole.CurrentRequest() == ERetreiveCreditCmd) { //Credit status was requested
HBufC* cr = HBufC::NewL(creditsLeftBuf->Length());
cr->Des().Copy(creditsLeftBuf->Des());
HBufC* fr = HBufC::NewL(freebiesLeftBuf->Length());
fr->Des().Copy(freebiesLeftBuf->Des());
TLex lex(cr->Des());
TInt credit = -1;
TInt freebies = -1;
lex.Val(credit);
lex.Assign(fr->Des());
lex.Val(freebies);
iConsole.CreditReceived(credit, freebies);
} else { //It is a vCard
...
}
Disconnect();
}
void CSocketsEngine::Disconnect()
{
if (iGlobalProgressDialog) {
iGlobalProgressDialog->ProcessFinished();
}
// cancel all outstanding operations
// since we are connected, the only possibilities are read and write
iSocketsReader->Cancel();
iSocketsWriter->Cancel();
iSocket.Close();
isDisconnecting = EFalse;
ChangeStatus(ENotConnected);
}
I have also sent you an e-mail.
Kindest Regards,
Joachim
Forum posts: 8
Forum posts: 1379
I havent had one..
didster
Forum posts: 8
My problem is caused by the dialog code:
from RSS ...
RESOURCE DIALOG r_simpledlg_player_name_dialog
{
flags=EAknDialogSelectionList;
buttons=R_AVKON_SOFTKEYS_OK_CANCEL;
items=
{
DLG_LINE
{
id=ESimpleDlgCIdPlayerName;
type=EAknCtSingleListBox;
control= LISTBOX
{
flags=EAknListBoxSelectionList;
};
}
};
}
from HandleCommandL from AppUi:
CDesCArray* tempArray=new (ELeave) CDesC16ArrayFlat(10);
_LIT (KStringHeader, "0\tSaved Game %d");
TBuf <16> aString;
for (TInt i = 1; i< 11; i++)
{
aString.Format(KStringHeader(), i);
tempArray->AppendL (aString);
}
TInt openedItem(0);
CAknSelectionListDialog* dialog = CAknSelectionListDialog::NewL(openedItem, tempArray, 0);
dialog->PrepareLC (R_SIMPLEDLG_PLAYER_NAME_DIALOG);
// Execute the dialog
dialog->RunLD ()
If anybody see the problem please help. I do not see any inconsistency:(.
Forum posts: 19
Did you find the solution to this problem? I am getting the same error with similiar code.
It would be very nice if you could share the soloution if you have it.
Thanx.
Forum posts: 10
Forum posts: 2
Hi,
I am facing USER 0 for multi line data query dialog.
Can anyone suggest what is the problem ?
Yes in background there is a running active object so if it is the problem then what I have to do for that AO ?
Regards,
Kavit.