Bug 175261 - Using mudflap and glibc mtrace together hangs your program.
Using mudflap and glibc mtrace together hangs your program.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: glibc (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-12-08 05:57 EST by Scott Tsai
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 2.3.90-19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-12-21 09:34:56 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test program that hangs (186 bytes, text/plain)
2005-12-08 05:57 EST, Scott Tsai
no flags Details

  None (edit)
Description Scott Tsai 2005-12-08 05:57:24 EST
Description of problem:
Linking a program with -lmudflap and using glibc mtrace will cause the program
to hang at run time.

Version-Release number of selected component (if applicable):
gcc-4.0.2-8.fc4
glibc-2.3.5-10.3
kernel-2.6.14-1.1644_FC4

How reproducible:
always

Steps to Reproduce:
1. build the attached file with: gcc -fmudflap -lmudflap -o t t.c
2. MALLOC_TRACE=mtrace.log ./t

  
Actual results:
program hangs before returning from first malloc() call.

Expected results:
If mudflap and mtrace cant be used together then aborting at link time or run
time with an error message is really preferred.

Additional info:
strace log (manually aborted):
execve("./t", ["./t"], [/* 41 vars */]) = 0
brk(0)                                  = 0x964d000
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7ffd000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=162874, ...}) = 0
old_mmap(NULL, 162874, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd5000
close(3)                                = 0
open("/usr/lib/libmudflap.so.0", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\220D\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=107904, ...}) = 0
old_mmap(NULL, 949796, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
0xb42000
old_mmap(0xb5c000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x19000) = 0xb5c000
old_mmap(0xb5e000, 835108, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb5e000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\212n\247"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1485672, ...}) = 0
old_mmap(0xa62000, 1215452, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x111000
old_mmap(0x234000, 16384, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x123000) = 0x234000
old_mmap(0x238000, 7132, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x238000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\0L\273"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=16244, ...}) = 0
old_mmap(0xbb4000, 12408, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0x23a000
old_mmap(0x23c000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x23c000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xb7fd4000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fd49e0, limit:1048575,
seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0,
useable:1}) = 0
mprotect(0x23c000, 4096, PROT_READ)     = 0
mprotect(0x234000, 8192, PROT_READ)     = 0
mprotect(0xa5e000, 4096, PROT_READ)     = 0
munmap(0xb7fd5000, 162874)              = 0
brk(0)                                  = 0x964d000
brk(0x966e000)                          = 0x966e000
gettimeofday({1134039511, 115635}, NULL) = 0
gettimeofday({1134039511, 115674}, NULL) = 0
gettimeofday({1134039511, 115707}, NULL) = 0
gettimeofday({1134039511, 115740}, NULL) = 0
gettimeofday({1134039511, 115794}, NULL) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=162874, ...}) = 0
old_mmap(NULL, 162874, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fd5000
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200\326"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=40112, ...}) = 0
old_mmap(0xdcc000, 37576, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0)
= 0xdcc000
old_mmap(0xdd5000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0xdd5000
close(3)                                = 0
munmap(0xb7fd5000, 162874)              = 0
gettimeofday({1134039511, 116589}, NULL) = 0
open("log", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
fcntl64(3, F_GETFD)                     = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
write(2, "before malloc\n", 14)         = 14
gettimeofday({1134039511, 116985}, NULL) = 0
futex(0x237d08, FUTEX_WAIT, 2, NULL)    = -1 EINTR (Interrupted system call)
--- SIGINT (Interrupt) @ 0 (0) ---
+++ killed by SIGINT +++
Comment 1 Scott Tsai 2005-12-08 05:57:24 EST
Created attachment 122025 [details]
test program that hangs
Comment 2 Jakub Jelinek 2005-12-21 09:34:56 EST
Should be fixed in glibc-2.3.90-19 and later.

Note You need to log in before you can comment on or make changes to this bug.