Mail Archives: djgpp/2002/01/03/01:05:01
On Wed, 2 Jan 2002 05:03:58 -0800 (PST), ROLAND
<roland_asmann AT yahoo DOT com> wrote:
>First let me wish you all a very good 2002!
>
>I have a question concerning PMCOM, but I cannot get
>in touch with Peter Marinov.
>I have ported a program from UNIX to DJGPP, and I am
>using PMCOM for serial communication.
>Everything is working fine, until at some point the
>program crashes, telling me it could not "read" memory
>at address "0xfffff" (or something like that).
>I am not sure what to do about this, since my program
>calls a COMReadBuffer in a while-loop, and it performs
>this COMReadBuffer several times, with a correct
>result. And then at some point, it just crashes,
>leaving me wondering who to solve this...
>Does anybody know what's wrong here??
>Or could it be the problem is not with the
>COMReadBuffer in the while-loop but some place else??
You're calling something which normally returns a valid pointer,
but returns -1 when there is an error, and you are not checking
for -1 as an error return value: you may be assuming that NULL is
returned on an error.
This is not always the case, especially when dealing with system
calls.
If you are already checking for NULL, add a check for || ? == -1
and print out some debugging info for both error cases, to see if
there is a difference in symtoms.
Thanks. Take care, Brian Inglis Calgary, Alberta, Canada
--
Brian DOT Inglis AT CSi DOT com (Brian dot Inglis at SystematicSw dot ab dot ca)
fake address use address above to reply
tosspam AT aol DOT com abuse AT aol DOT com abuse AT yahoo DOT com abuse AT hotmail DOT com abuse AT msn DOT com abuse AT sprint DOT com abuse AT earthlink DOT com abuse AT cadvision DOT com abuse AT ibsystems DOT com uce AT ftc DOT gov
spam traps
- Raw text -