This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] x % 0 hangs


   Date: Sat, 26 Jun 2004 11:44:20 -0400 (EDT)
   From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)

   I like your patch, although I can't approve it.

   There is a PR for this:

     http://sources.redhat.com/gdb/bugs/1056
     divide by zero hangs gdb

   Could you a line to your ChangeLog like this:

   2004-06-26    <david@streamline-computing.com>

	   Partial fix for PR cli/1056.
	   * valarith.c: check for zero in division and remainder
	   evaluation.

   > Although there may be some systems that can healthily respond to this, I
   > propose a trivial patch - unless someone is going to tell me there's an
   > option to stop the hanging, or respond differently to the signal.

   Someone still has to dive into the signal handling design and fix the
   lower-level problem, which is analyzed in the PR.  Briefly, the problem
   is that gdb defers the its response to the signal and returns from the
   signal handler, but returning from the signal handler for SIGFPE can
   re-execute the same instruction that hung.

Fixing this is highly non-trivial.  The only approach that's somewhat
portable is longjmp-ing out of the signal handler, and even that seems
to have its problems on some platforms.  Therefore I think this patch
is a very good idea.

I just wonder whether just printing "Division by zero" as the error
message would be enough.

David, consider this patch with or without that change approved.
Please modify your ChangeLog as requested by Michael though.

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]