Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 1997 17:00:19 -0500 (EST)
From:      Thomas David Rivers <ponds!rivers@dg-rtp.dg.com>
To:        ponds!FreeBSD.org!freebsd-hackers@ucbvax.Berkeley.EDU, ponds!mitre.org!guhl@ucbvax.Berkeley.EDU
Cc:        ponds!FreeBSD.org!freebsd-bugs@ucbvax.Berkeley.EDU
Subject:   Re: Fix to Interrupt/Terminate Signal causes page fault in kernel mode
Message-ID:  <199702112200.RAA03232@lakes.water.net>

next in thread | raw e-mail | index | archive | help
> 
> I posted the following to freebsd-hackers and freebsd-bugs a couple
> of days ago.   I have fixed the problem, not by making any code
> changes, but by compiling the kernel unoptimized!
> 
> compiler: GNU gcc version 2.6.3
> 
> I question the wisdom of allowing the COPTFLAGS option in
> /sys/386/conf/Makefile.i386 to enable optimization when
> this may cause unpredictable and erroneous kernel behavior.
> 
> Any opinions?
> 

 Yep -
 
  As a compiler writer, I "hear" this all the time.

  There are several situations where erroneous C code can
  behave this way.  Usually, these involve taking the address
  of an automatic variable, and saving that after the routine
  has ended.

  Also, in this situation, a common occurrence is to overwrite
  the end of an automatic array, or other variable.  When compiled
  optimized, the frame is frequently reordered, or the function has
  fewer temporaries; so you are more likely to write over other
  "meaningful" data.

  Only after I have eliminated those two possibilities do I begin
  to investigate compiler bugs.

	- Dave Rivers -


 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702112200.RAA03232>