remake (and make) memory free() error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
remake (Ubuntu) |
Fix Released
|
Undecided
|
Rocky |
Bug Description
Binary package hint: remake
lsb_release -d => Ubuntu 8.04.1
remake -v => GNU Make + Debugger 3.80+dbg-0.62
make : GNU Make 3.81
This is a strange one.
The problem surfaces in make and remake depending on the project location, comments, etc., so I'm guessing that memory is being stepped on somewhere.
Sometimes it's make that crashes, sometimes remake, sometimes both.
At least it's reproducible so hopefully this little test-project will help you track it down.
"make" builds the dummy program and "make clean" cleans up - nice and simple for testing.
If you unpack the contents of the archive I will attach below to /opt/dev/bugs/make then
$ cd /opt/dev/
$ remake
you get
/opt/dev/
remake[1]: Entering directory `/opt/dev/
arena.inc:75: ARENA_ROOT_DIR = /opt/dev/
arena.inc:76: ARENA_SRC_DIR = /opt/dev/
src.mak:14: ARENA_SUB_
COMPILE.cc = [$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c]
CXX = [g++]
CXXFLAGS = [-fPIC -D_FILE_
TARGET_ARCH = []
LINK.cc = [$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)]
LDFLAGS = [-pie]
CC_VER = [i486-linux-gnu]
ARENA_GEN_DIR = [/opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
src.mak:16: <mkdir> /opt/dev/
remake all -C macro_test -I /opt/dev/
remake[2]: Entering directory `/opt/dev/
macro_test_
/opt/dev/
Pre-recurse [simple] complete
remake --warn-
remake[3]: Entering directory `/opt/dev/
/opt/dev/
/opt/dev/
/opt/dev/
Need to make simple
g++ -fPIC -D_FILE_
Making simple from /opt/dev/
g++ -pie -o /opt/dev/
Made simple
remake[3]: Leaving directory `/opt/dev/
Make [simple] complete
Recurse [simple] complete
Post-recurse [simple] complete
remake[2]: Leaving directory `/opt/dev/
*** glibc detected *** remake: free(): invalid pointer: 0x08080a20 ***
======= Backtrace: =========
/lib/tls/
/lib/tls/
remake[0x805acdc]
remake[0x805dacc]
/lib/tls/
remake[0x8049c81]
======= Memory map: ========
08048000-08073000 r-xp 00000000 08:05 3255662 /usr/bin/remake
08073000-08075000 rw-p 0002a000 08:05 3255662 /usr/bin/remake
08075000-08097000 rw-p 08075000 00:00 0 [heap]
b7a00000-b7a21000 rw-p b7a00000 00:00 0
b7a21000-b7b00000 ---p b7a21000 00:00 0
b7be9000-b7bf3000 r-xp 00000000 08:05 1818689 /lib/libgcc_s.so.1
b7bf3000-b7bf4000 rw-p 0000a000 08:05 1818689 /lib/libgcc_s.so.1
b7c0d000-b7c0e000 rw-p b7c0d000 00:00 0
b7c10000-b7c4f000 r--p 00000000 08:05 3277973 /usr/lib/
b7c4f000-b7d30000 r--p 00000000 08:05 3277972 /usr/lib/
b7d30000-b7d31000 rw-p b7d30000 00:00 0
b7d31000-b7d33000 r-xp 00000000 08:05 1836376 /lib/tls/
b7d33000-b7d35000 rw-p 00001000 08:05 1836376 /lib/tls/
b7d35000-b7d36000 rw-p b7d35000 00:00 0
b7d36000-b7d63000 r-xp 00000000 08:05 1818705 /lib/libncurses
b7d63000-b7d66000 rw-p 0002c000 08:05 1818705 /lib/libncurses
b7d66000-b7d7a000 r-xp 00000000 08:05 1836396 /lib/tls/
b7d7a000-b7d7c000 rw-p 00013000 08:05 1836396 /lib/tls/
b7d7c000-b7d7e000 rw-p b7d7c000 00:00 0
b7d7e000-b7ec7000 r-xp 00000000 08:05 1836370 /lib/tls/
b7ec7000-b7ec8000 r--p 00149000 08:05 1836370 /lib/tls/
b7ec8000-b7eca000 rw-p 0014a000 08:05 1836370 /lib/tls/
b7eca000-b7ecd000 rw-p b7eca000 00:00 0
b7ecd000-b7ef9000 r-xp 00000000 08:05 1818745 /lib/libreadlin
b7ef9000-b7efd000 rw-p 0002c000 08:05 1818745 /lib/libreadlin
b7efd000-b7efe000 rw-p b7efd000 00:00 0
b7efe000-b7f05000 r-xp 00000000 08:05 1836400 /lib/tls/
b7f05000-b7f07000 rw-p 00006000 08:05 1836400 /lib/tls/
b7f07000-b7f08000 rw-p b7f07000 00:00 0
b7f10000-b7f11000 r--p 00000000 08:05 3277978 /usr/lib/
b7f11000-b7f12000 r--p 00000000 08:05 3277981 /usr/lib/
b7f12000-b7f13000 r--p 00000000 08:05 3277976 /usr/lib/
b7f13000-b7f14000 r--p 00000000 08:05 3285004 /usr/lib/
b7f14000-b7f15000 r--p 00000000 08:05 3277979 /usr/lib/
b7f15000-b7f16000 r--p 00000000 08:05 3277977 /usr/lib/
b7f16000-b7f17000 r--p 00000000 08:05 3277971 /usr/lib/
b7f17000-b7f18000 r--p 00000000 08:05 3277980 /usr/lib/
b7f18000-b7f19000 r--p 00000000 08:05 3277975 /usr/lib/
b7f19000-b7f20000 r--s 00000000 08:05 1679599 /usr/lib/
b7f20000-b7f21000 r--p 00000000 08:05 3277974 /usr/lib/
b7f21000-b7f22000 rw-p b7f21000 00:00 0
b7f22000-b7f23000 r-xp b7f22000 00:00 0 [vdso]
b7f23000-b7f3d000 r-xp 00000000 08:05 1818644 /lib/ld-2.7.so
b7f3d000-b7f3f000 rw-p 00019000 08:05 1818644 /lib/ld-2.7.so
bf963000-bf979000 rw-p bffea000 00:00 0 [stack]
src.mak:17: *** [macro_test] Aborted
#0 macro_test at /opt/dev/
#1 all at /opt/dev/
remake[1]: Leaving directory `/opt/dev/
Command-line arguments:
"-C src -I /opt/dev/
makefile:4: *** [all] Error 2
#0 all at /opt/dev/
Command-line arguments: none
Try moving the project tree around your hard disk and/or add comments to the include files to see how things change.
I'm sorry that remake was unlucky to be the project to exhibit this bug - it just happened to be the loser when I copied this bare-bones example into my bug staging area - make works in "/opt/dev/
Also, as a remake newbie; when it comes to macros, is there a way of viewing macro expansions?
Changed in remake (Ubuntu): | |
status: | Fix Committed → Fix Released |
Modifying debian/rules by adding "--with-dmalloc" to the ./configure invokation and rebuilding provides an interim solution.
The package would then require libdmalloc5 (5.5.1-1) in addition for installation.
Should I report this against the "make" package as well ?
I'll leave it to your judgement as only you will know if this is relevant to "upstream" - in your case, "make".