[OT: Sorry that I replied to an unrelated email; I may have screwed up
threading in some mail clients.]

Here is some additional info that I got from the original GDB session.

(gdb) 
#0  0x08093c66 in vp_draw_chunk (data=0x85014a0, user_data=0x8e40108) at \
         visual_progress_gui.c:121
#1  0x401cbbe9 in g_slist_foreach () from /usr/lib/libglib-1.2.so.0
#2  0xec835356 in ?? ()

But I think things are pretty clear without knowing that
g_slist_foreach() was the caller.  I had done a multi selection with
the mouse, prior to the PURGE.

> Bill Pringlemeir wrote:
>> The particular link is in "vp_draw_chunk".
  
>>     bpp = v->file_size / (v->context->width);
>> ->  s_from = chunk->from / bpp; 
>>     s_to = chunk->to / bpp; 
  
>> "v->file_size" is most likely zero because the file has been moved
>> or removed.  Should the code register a signal handler for the
>> division by zero
 
On Mon, 26 Apr 2004, [EMAIL PROTECTED] wrote:
> There's hardly any way to rely on anything from there on, you would
> risk any kind of undefined behaviour - whatsoever. There's no
> portable I know of to resume from a division-by-zero.

No it is not a way to recover.  However, it is a general problem that
could happen anywhere.  I was thinking that instead of trying to
guarentee perfect code every where that this signal handler would try
to send "BYE" messages to the network and do other things that might
be appropriate.  Division by zero never seems to indicate an unstable
process in my experience.  If the signal was a memory access
violation, etc. then it might not be good to attempt this.  

I doubt an attempt to fix the error could be done.  However, it is
possible that more graceful handling of the fault could be
done... Maybe it wouldn't be worth the effort though.  I am sure it
would be different across Windows, *nix and MAC.

> Bill Pringlemeir wrote:
>> or should there be checks put in place
 
On Mon, 26 Apr 2004, [EMAIL PROTECTED] wrote:
> Sure, there has to be a check that bpp is greater than zero, which
> isn't guaranteed here at all, AFAICS.

I was intending to run Splint on the CVS code.  I could provide a list
of any more possible places where a division by zero, etc. could
occur.  I would run through this list myself to try and prevent false
positives.  Is this list the best place for this or should I be using
the bug tracker?

Thanks,
Bill Pringlemeir.



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to