[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LYNX-DEV FIX: debugging that URL...
From: |
Foteos Macrides |
Subject: |
Re: LYNX-DEV FIX: debugging that URL... |
Date: |
Wed, 13 Nov 1996 19:57:52 -0500 (EST) |
address@hidden (Jason Baker) wrote:
>> Filip M Gieszczykiewicz <address@hidden> wrote:
>> >Greetings. Add the following line right before the for (..)
>> >on line 37 of the WWW/Library/Implementation/HTString.c:
>> >
>> > if (!p) return -1;
>> >
>> >Now it won't dump when it hits URL:
>> >
>> >http://www.safetycare.com.au/mig.html
>> >
>> >and the likes of it.
>>
>> That function is called from a zillion places, and should never
>> be called without valid pointers. If you block the crash there, you'll
>> just mask the real programming error.
>
>Just a thought - what about putting something like (pardon possible
>C errors, I've been doing Oracle PL/SQL too long):
>
># Catch function calls without valid pointer
>if (!p)
>{
> # Display error so the programming bug doesn't go unseen
> /* insert debug message call here */
>
> # Prevent ourselves from crashing
> return -1;
>}
It's a judgement call. That function is called from a zillion
places, and should never be called with a bad pointer. It can't return
an error value. That -1 implies a valid comparison to the calling
function, which will continue on that basis, and probably to something
strange. The function doesn't know what called it, so a TRACE message
can't report that. By letting it crash, on VMS the fatal error routine
includes a TRACEBACK, which includes the sequence of calling functions,
and other useful information. So I was able to debug it literally in
less than a minute. It could take hours to figure out why strange
behavior is occurring if it returned a false but seemingly valid value,
or it might be valid by chance, making it even more likely that
blatantly bad code could look OK and get out the door.
Fote
=========================================================================
Foteos Macrides Worcester Foundation for Biomedical Research
address@hidden 222 Maple Avenue, Shrewsbury, MA 01545
=========================================================================
;
; To UNSUBSCRIBE: Send a mail message to address@hidden
; with "unsubscribe lynx-dev" (without the
; quotation marks) on a line by itself.
;