id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	os	architecture	failure	difficulty	testcase	blockedby	blocking	related
1030	ghc-6.6 crashed after being built on linux (fedora core)	newsham	igloo	"I downloaded ghc-6.6 source and built it from ghc-6.4.2 (which I previously built on this same machine).  The newly built binary doesnt work.  

{{{
root@discover# ghc-6.6
Segmentation fault
}}}

Upon investigation it looks like the stage1 compiler doesnt crash but the stage2 compiler does:

{{{
root@discover# compiler/stage1/ghc-6.6
ghc-6.6: missing -B<dir> option
root@discover# compiler/stage2/ghc-6.6
Segmentation fault
}}}

{{{
root@discover# gdb compiler/stage2/ghc-6.6
GNU gdb Red Hat Linux (6.0post-0.20040223.19rh)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type ""show copying"" to see the conditions.
There is absolutely no warranty for GDB.  Type ""show warranty"" for details.
This GDB was configured as ""i386-redhat-linux-gnu""...(no debugging symbols found)...Using host libthread_db library ""/lib/libthread_db.so.1"".

(gdb) run
Starting program: /root/src/ghc-6.6/compiler/stage2/ghc-6.6
Error while mapping shared library sections:
: Success.
Error while reading shared library symbols:
: No such file or directory.
(no debugging symbols found)...(no debugging symbols found)...[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 2783)]
Error while reading shared library symbols:
: No such file or directory.
Error while reading shared library symbols:
: No such file or directory.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 2783)]
0x00421d3b in __pthread_clock_gettime () from /lib/i686/libpthread.so.0
(gdb) where
#0  0x00421d3b in __pthread_clock_gettime () from /lib/i686/libpthread.so.0
#1  0x00dc0331 in clock_gettime () from /lib/i686/librt.so.1
#2  0x0888fb4d in getThreadCPUTime ()
#3  0xfef8a508 in ?? ()
#4  0x0888fe26 in initMutex ()
#5  0x0a5bddd4 in ?? ()
#6  0x00000000 in ?? ()

(gdb) x/32x $esp
0xfef8a3c4:     0x1712409a      0x00000000      0x00000003      0x29a79300
0xfef8a3d4:     0x006ec840      0x00421cf0      0x00dc3ff4      0x00000003
0xfef8a3e4:     0x00000000      0xfef8a428      0x00dc0331      0x00000003
0xfef8a3f4:     0x29a79300      0x00000000      0xfef8a448      0x00dbc7ec
0xfef8a404:     0x0a5bdd88      0x29a79300      0x00000000      0xffffffff
0xfef8a414:     0x006ec840      0x00000000      0x0a5bdd88      0xfef8a4f0
0xfef8a424:     0x00000001      0xfef8a508      0x0888fb4d      0x00000003
0xfef8a434:     0xfef8a448      0xfef8a508      0x0888fe26      0x0a5bddd4
(gdb) x/4i $eip
0x421d3b <__pthread_clock_gettime+75>:  mov    %eax,(%edx)
0x421d3d <__pthread_clock_gettime+77>:  mov    0x8(%ebp),%edx
0x421d40 <__pthread_clock_gettime+80>:  mov    %ecx,0xc(%esp)
0x421d44 <__pthread_clock_gettime+84>:  mov    %esi,(%esp)
(gdb) info reg
eax            0x0      0
ecx            0x29a79300       698848000
edx            0x0      0
ebx            0x424ff4 4345844
esp            0xfef8a3c4       0xfef8a3c4
ebp            0xfef8a3e8       0xfef8a3e8
esi            0x1712409a       387072154
edi            0x0      0
eip            0x421d3b 0x421d3b
eflags         0x10286  66182
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51
}}}

About my environment:
{{{
newsham@discover$ uname -a
Linux discover.x0d99.com 2.6.5-1.358 #1 Sat May 8 09:04:50 EDT 2004 i686 athlon i386 GNU/Linux

newsham@discover$ cat /etc/fedora-release
Fedora Core release 2 (Tettnang)

newsham@discover$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --disable-libunwind-exceptions --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7)
}}}"	merge	closed	normal	6.6.1	Compiler	6.6	fixed	crash		Linux	x86		Unknown				
