Thnx for answers, I traced down error somehow and found that:
1) it doesn't matter if I pass NULLs or single spaces, it crash where it crashed and
it works where it worked, no change
2) temp_txt is global variable (as was written in the comment) so it was not on stack
but error appeared only in case, I interrupted ultralite synchronization via serial
stream very soon after beggining. So it looks, it is some problem with it
(because when I switched to TCP/IP stream I wasn't able to invoke this bug,even
gremlins didn't crash). So maybe something with serial support in PalmOS (or
Ultralite), or something. I don't know. Other places were my fault (too short space
for string on stack...). Sorry for false alerts.
----old ------
Subject: Re: FrmCustomAlert problems part 2 (the Nightmare is back...)
From: "Chris DiPierro" <[EMAIL PROTECTED]>
Date: Wed, 24 Jan 2001 10:07:07 -0500
X-Message-Number: 16
Just a guess, but since temp_txt is local, and you say you can only get it
to happen after a certain series of events, perhaps you're munging your
stack somewhere before this call? If Gremlins can produce it, I'd run the
app in the debugger, then start Gremlins loose, then when it crahses, verify
that temp_txt is valid.
Michal Seliga <[EMAIL PROTECTED]> wrote in message
news:36917@palm-dev-forum...
>
> Yes it's me who started previous thread about this theme...
>
> CodeWarrior r6, Handspring Visor with PalmOS3.1, Visor's ROM used in
emulator. It is not interesting if it happens on 3.5 or not, our customer
has Visors only)
>
> Now I use this code
>
> #define SYNCHROFAIL "Something crashed :-( (SQL error message: "
> char temp_txt[256]; file://global variable
> bool ok; file://local variable
>
> some ultralite stuff (synchronization).
> returns with ok set to true/false (true if synchronisation went well)
>
> if(ok==false)
> {
> StrCopy(temp_txt,SYNCHROFAIL);
> StrIToA(temp_txt+StrLen(SYNCHROFAIL),sql_code);
> StrCat(temp_txt,")");
> file://* breakpoint
> // now debugger shows that temp_txt is filled well, the string
contains valid chars and is zero-terminated.
> // It is too long to fit one line, but that doesn't matter, shorter
text would not help (tested)
> FrmCustomAlert(UniversalAlert,temp_txt," "," "); // note, there
are " ", no "" (space inside!)
> file://*breakpoint - but I will not get here
> }
>
>
> UniversalAlert is defined using Constructor, it contains text ^1 (and
nothing more)
>
> It CRASH badly. Not everytime, but Gremlins can produce this error quite
often and I found this happens when I press buttons very fast...
> Emulator reports each run different error (illegal operation, reading from
0, reading from bad adress....) and when I press debug it throws me to the
part of
> code which is surely somewhere else (sometimes), or reports next error
about trying to set the program counter to invalid adress (nearly everytime)
>
> When I comment out FrmCustomAlerts everything works just fine.
> Same bug happens on other places of code too (but it is much harder to
invoke)
>
> Looks to me like stack crash. Any ideas how to solve it? (I don't like the
idea of writing my own FrmCustomAlert clone and change it in all my
code...(~1MB of
> sources not including Ultralite stuff).
>
> help if possible... thanks.
>
>
Subject: RE: FrmCustomAlert problems part 2 (the Nightmare is back...)
From: "Richard Burmeister" <[EMAIL PROTECTED]>
Date: Wed, 24 Jan 2001 09:29:25 -0600
X-Message-Number: 21
> From: Michal Seliga
>
> FrmCustomAlert(UniversalAlert,temp_txt," "," "); // note,
> there are " ", no "" (space inside!)
[snip]
> UniversalAlert is defined using Constructor, it contains
> text ^1 (and nothing more)
You are passing in three strings to the alert but the alert is defined with
only one string. If your alert only contains ^1, then pass NULL for the
last 2 params to FrmCustomAlert. If your alert uses ^1, ^2, and ^3, and you
don't want to display anything for ^2 and ^3, then pass in a single space ("
") for each of the unused parameters.
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/