Subject: Re: program built with -O2 exits on receiving SIGWINCH
To: None <netbsd-users@netbsd.org>
From: George Georgalis <george@galis.org>
List: netbsd-users
Date: 02/27/2006 00:27:52
On Mon, Feb 27, 2006 at 12:07:53AM -0500, Christos Zoulas wrote:
>On Feb 27,  1:55pm, an.olive.tree@gmail.com ("Hiroshi SAKURAI") wrote:
>-- Subject: Re: program built with -O2 exits on receiving SIGWINCH
>
>| On 2/27/06, Christos Zoulas <christos@astron.com> wrote:
>| >
>| > The problem is that with -O2 the optimizer changes the call to "func"
>| > to a jump, so the stack frame is off when the signal handler returns,
>| > and we end up calling setcontext(0).
>| >
>| > christos
>| 
>| Does it mean that -O2 must not be used to compile signal handler
>| or NetBSD should be fixed?
>
>I think it is a compiler issue because we push two frames and we pop one.

As long as this has come up.... I have found a
couple flags that break things I didn't expect.

# DANGER breaks distribution build
#echo "CFLAGS= -O1 -pipe" >>/etc/mk.conf
# DANGER breaks /usr/pkgsrc/devel/boehm-gc
#echo 'MAKEFLAGS= -B -j3' >>/etc/mk.conf

I expected the first option to safely improve
performance.  The second was to reduce compile
times on a dual cpu box, the boehm-gc goes into an
infinite loop. I may have stopped using these in
2.0.2...

// George


-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:george@galis.org