Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Jul 2000 07:09:20 -0700 (PDT)
From:      jym@bsdfr.org
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   gnu/20253: [critical] O2 optimization with egcs 2.95.2 (19991024) cause segfault
Message-ID:  <20000728140920.74EB837C210@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         20253
>Category:       gnu
>Synopsis:       [critical] O2 optimization with egcs 2.95.2 (19991024) cause segfault
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 28 07:10:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jean-Yves Moulin
>Release:        FreeBSD 4.1-STABLE
>Organization:
waycom
>Environment:
FreeBSD pulsar.waycom.net 4.1-STABLE FreeBSD 4.1-STABLE #7: Thu Jul 27 15:04:46 CEST 2000     root@pulsar.waycom.net:/usr/src/sys/compile/PULSAR  i386

>Description:
When I try to use egcs version 2.95.2 19991024 with -O2 compilation 
option, program cause sigsegv randomly.
I try to use gdb to debug my program but with no success.
An example of gdb output:
(gdb) run
Starting program: /usr/users/jym/xfdump-0.5/./xfdump
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Connect to DB...        OK => connected at 127.0.0.1
Openning socket...      OK => connected at 127.0.0.1:127

New
Create 0
Found: 0
Add 0:1
Found: 0
Add 0:2
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x280ecf21 in isatty () from /usr/lib/libc.so.4
(gdb) where
#0  0x280ecf21 in isatty () from /usr/lib/libc.so.4
#1  0x280ed101 in isatty () from /usr/lib/libc.so.4
#2  0x280ed815 in malloc () from /usr/lib/libc.so.4
#3  0x8048e88 in extract_news ()
Error accessing memory address 0x7c: Bad address.
(gdb)

Another Example with simple gethostbyname function:

(gdb) run
Starting program: /usr/users/jym/xfdump-0.5/xfdump
(no debugging symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...
Connect to DB...        OK => connected at localhost
(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x280ecf21 in isatty () from /usr/lib/libc.so.4
(gdb) where
#0  0x280ecf21 in isatty () from /usr/lib/libc.so.4
#1  0x280ed101 in isatty () from /usr/lib/libc.so.4
#2  0x280ed815 in malloc () from /usr/lib/libc.so.4
#3  0x280c49a5 in getaddrinfo () from /usr/lib/libc.so.4
#4  0x280c463e in getaddrinfo () from /usr/lib/libc.so.4
#5  0x280c47a8 in getaddrinfo () from /usr/lib/libc.so.4
#6  0x280c3f84 in getaddrinfo () from /usr/lib/libc.so.4
#7  0x280c3231 in res_init () from /usr/lib/libc.so.4
#8  0x280cdec8 in _sethostdnsent () from /usr/lib/libc.so.4
#9  0x280cc6c5 in sethostent () from /usr/lib/libc.so.4
#10 0x280ccc2f in _gethostbyhtname () from /usr/lib/libc.so.4
#11 0x280cc5ac in gethostbyname2 () from /usr/lib/libc.so.4
#12 0x280cc53c in gethostbyname () from /usr/lib/libc.so.4
(gdb)

Huhu...

I try to recompile the same program without -O2 optimization option and
the program work very fine.
I try to use gcc 2.8.1 with -O2 compilation option and the program work
fine too.

Huhu... what's the problem ??? Unknow bug in egcs ??
egcs is in 4.x-RELEASE and STABLE base system... urgl...
>How-To-Repeat:
I cannot send you my specific program sorry.
>Fix:
re-install gcc 2.8.1
bug appears in latest dev egcs version ? don't know...

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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