bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Segmentation fault in make-3.81


From: Glenn Coombs
Subject: Segmentation fault in make-3.81
Date: Fri, 31 Jul 2009 16:03:53 +0100

Hi,

The attached makefile causes a segmentation fault if run with make -j2 (or anything higher than -j1).  It does sometimes run with no error but 50% of the time I get a segmentation fault.  This is on a machine running CentOS release 4.6, kernel 2.6.9-67.ELsmp.  To reproduce just run:

make setup
make -j2

I encountered this issue when I added the eval at line 18 so that I could set CHIPNAME to the uppercase of the filename stub.  The problem disappears if either line 18 (the eval) or line 23 (the echo command) are commented out.  Alternatively if I replace the echo command with a $(info message) equivalent then the issue also disappears. 

%_struct.h: %_struct.def
    $(eval CHIPNAME := $(shell echo $* | tr a-z A-Z))                # line 18
ifdef VERBOSE
    $(REGCONV) -chipname $(CHIPNAME) $< -simout $@
else
#   $(info Creating regconv header file CHIPNAME=$(CHIPNAME): $(notdir $@))
    @echo Creating regconv header file CHIPNAME=$(CHIPNAME): $(notdir $@)            # line 23
    @$(REGCONV) -chipname $(CHIPNAME) $< -simout $@
endif

The stacktrace from gdb looks like this:

% gdb ~/bin/make core.18433
GNU gdb Red Hat Linux (6.3.0.0-1.153.el4rh)
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 "x86_64-redhat-linux-gnu"...Using host libthread_db library "/lib64/tls/libthread_db.so.1".

Reading symbols from shared object read from target memory...done.
Loaded system supplied DSO at 0xffffe000
Core was generated by `make -j3'.
Program terminated with signal 11, Segmentation fault.

warning: svr4_current_sos: Can't read pathname for load map: Input/output error

Reading symbols from /lib/tls/librt.so.1...done.
Loaded symbols for /lib/tls/librt.so.1
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0  eval_buffer (buffer=0x8077a50 "CHIPNAME := FOO2") at read.c:430
430       ebuf.floc = *reading_file;
(gdb) bt
#0  eval_buffer (buffer=0x8077a50 "CHIPNAME := FOO2") at read.c:430
#1  0x08050012 in func_eval (o=0x8077981 "\233]", argv=0x0, funcname=0x8062e38 "eval") at function.c:1369
#2  0x080506a8 in expand_builtin_function (o=0x8077981 "\233]", argc=134707792, argv=0xffffb870, entry_p=0xffffffee) at function.c:2115
#3  0x08050819 in handle_function (op=0xffffb904, stringp=0x8076802) at function.c:2213
#4  0x0804c630 in variable_expand_string (line=0x0, string=0x80767d0 "\t$(eval CHIPNAME := $(shell echo $* | tr a-z A-Z))", length=-1) at expand.c:253
#5  0x0804c9a6 in variable_expand (line=0x80767d0 "\t$(eval CHIPNAME := $(shell echo $* | tr a-z A-Z))") at expand.c:418
#6  0x0804ca40 in variable_expand_for_file (line=0xffffffee <Address 0xffffffee out of bounds>, file=0x8077a50) at expand.c:463
#7  0x0804cc15 in allocated_variable_expand_for_file (line=0x80767d0 "\t$(eval CHIPNAME := $(shell echo $* | tr a-z A-Z))", file=0x8073ce8) at expand.c:548
#8  0x08053319 in new_job (file=0x8073ce8) at job.c:1600
#9  0x0805c28a in update_file_1 (file=0x8073ce8, depth=2) at remake.c:761
#10 0x0805b984 in update_file (file=0x8073ce8, depth=2) at remake.c:307
#11 0x0805cc73 in check_dep (file=0x8073ce8, depth=2, this_mtime=1, must_make_ptr=0xffffbb34) at remake.c:947
#12 0x0805bdff in update_file_1 (file=0x8072d00, depth=1) at remake.c:508
#13 0x0805b984 in update_file (file=0x8072d00, depth=0) at remake.c:307
#14 0x0805b63f in update_goal_chain (goals=0x8076ea8) at remake.c:154
#15 0x080551a2 in main (argc=2, argv=0xffffd514, envp=0xffffd520) at main.c:2198

--
Glenn

Attachment: makefile
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]