This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gas --statistics segfault
- From: Dasn Clainst <clainst at fastmail dot cn>
- To: binutils at sources dot redhat dot com
- Date: Sun, 5 Feb 2006 21:02:19 +0800
- Subject: gas --statistics segfault
Hi, guys.
In my box, 'as --statistics' sometimes segfault.
-------------------------------------------------------------
$ uname -msr
OpenBSD 3.8 i386
$ echo "main(){}" > p.c
$ cat -n test.sh
1 #!/bin/sh
2 count=100;failed=0;i=0
3 cc -S p.c -o p.s
4 while [ $i -lt $count ]
5 do
6 ./as-new --statistics p.s > /dev/null 2>&1
7 if [ $? -ne 0 ]; then
8 let failed=failed+1
9 fi
10 let i=i+1
11 done
12 echo "$failed/$count failed."
13 rm -rf as-new.core a.out
$ sh test.sh
100/100 failed.
-------------------------------------------------------------
The following patch simply comments out 'output_file_close' function may
solve this problem.
Index: as.c
===================================================================
RCS file: /cvs/src/src/gas/as.c,v
retrieving revision 1.67
diff -u -p -r1.67 as.c
--- as.c 30 Oct 2005 18:08:52 -0000 1.67
+++ as.c 5 Feb 2006 12:41:27 -0000
@@ -1170,7 +1170,7 @@ main (int argc, char ** argv)
#endif
#ifndef OBJ_VMS /* Does its own file handling. */
- output_file_close (out_file_name);
+ /* output_file_close (out_file_name); */
#endif
if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0)