Subject: optimization bug with current egcs in libc(?)
To: None <port-arm32@netbsd.org>
From: Thilo Manske <Thilo.Manske@HEH.Uni-Oldenburg.DE>
List: port-arm32
Date: 03/06/2000 16:29:20
I rebuilt the world a few days ago and now vi dumps core (segment violation)
on me.

I tracked down the problem to libc:
With libc build with CFLAGS=-O it works, without (i.e. optimization O2):

[...]
        d=\134E[1m:me=\134E[m:ml=\134El:mr=\134E[7m:mu=\134Em:nd=\134E[C:r2=\
        \134E7\134E[r\134E[m\134E[?7h\134E[?1;3;4;6l\134E[4l\134E8\134E>:rc=\
        \134E8:sc=\134E7:se=\134E[m:sf=^J:so=\134E[7m:sr=\134EM:ta=^I:te=\134E\
        [2J\134E[?47l\134E8:ti=\134E7\134E[?47h:ue=\134E[m:up=\134E[A:us=\134E\
        [4m:\0xterm|vs100|xterms|xterm terminal emulator (X Window System)"
  4037 vi       RET   pread 4096/0x1000
  4037 vi       CALL  madvise(0x53000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  madvise(0x54000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  close(0x3)
  4037 vi       RET   close 0
  4037 vi       CALL  madvise(0x51000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  madvise(0x52000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  madvise(0x51000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  madvise(0x51000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  madvise(0x51000,0x1000,0x6)
  4037 vi       RET   madvise 0
  4037 vi       CALL  ioctl(0x2,TIOCGWINSZ,0xefbfdae8)
  4037 vi       RET   ioctl 0
  4037 vi       CALL  __fstat13(0x1,0xefbfda64)
  4037 vi       RET   __fstat13 0
  4037 vi       CALL  break(0x55000)
  4037 vi       RET   break 0
  4037 vi       CALL  break(0x65000)
  4037 vi       RET   break 0
  4037 vi       CALL  __sigaction14(0x1,0xefbfdad0,0x4f1ac)
  4037 vi       RET   __sigaction14 0
  4037 vi       CALL  __sigaction14(0x2,0xefbfdad0,0x4f1c4)
  4037 vi       RET   __sigaction14 0
  4037 vi       CALL  __sigaction14(0xf,0xefbfdad0,0x4f1dc)
  4037 vi       RET   __sigaction14 0
  4037 vi       CALL  __sigaction14(0x1c,0xefbfdad0,0x4f1f4)
  4037 vi       RET   __sigaction14 0
  4037 vi       PSIG  SIGSEGV SIG_DFL
  4037 vi       NAMI  "vi.core"

and (gdb backtrace from this coredump):

#0  0x29dbc in opts_search ()
(gdb) bt
#0  0x29dbc in opts_search ()
#1  0x200cbfd8 in bsearch ()
#2  0x29cf4 in opts_search ()
#3  0x28664 in opts_set ()
#4  0x27ae0 in opts_init ()
#5  0x24ba0 in editor ()
#6  0x2cd4 in main ()
#7  0x10fc in __start ()
Cannot access memory at address 0x3bfdc64.

FWIW:
I have one of the "faulty" StrongARMs (SA-110 with bugged STM^
instruction) but this hasn't really hurt me in the past...
-- 
Dies ist Thilos Unix Signature! Viel Spass damit.