CodeJuan / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

HEAPCHECK=normal gets stuck on ArchLinux #396

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I have a small ArchLinux setup with the newest Kernel/compiler/perftool 
version. Tcmalloc works fine as it boosts my performance significantly! But 
HEAPCHECK does not work.

What steps will reproduce the problem?
1. Install basic ArchLinux system
2. compile any code with whatever gcc version linked with newest tcmalloc
3. env HEAPCHECK=normal ./test

What is the expected output? What do you see instead?
Expected: At least any output from perftools
Observed: The program gets stuck without any load! This issue is independent 
off the actual program. So following example will also not work:
int main(){
    return 0;
}

What version of the product are you using? On what operating system?
svn revision 132
libunwind-0.99 (I've read that there are problems with newer versions)
#uname -r
2.6.32-LTS or 3.1.9-2-ARCH

Please provide any additional information below.

With the same tcmalloc and libunwind version everything works fine on a 
Scientific Linux system (2.6.32). Independent on which machine I've compiled my 
test code.

How can I debug this? Strace doesn't help as I get following output (which 
confirms that tcmalloc ist at least doing something):
strace env HEAPCHECK=normal ./test

...
close(3)                                = 0
write(2, "Someone is ptrace()ing us; will "..., 48Someone is ptrace()ing us; 
will turn itself off
) = 48
write(2, "Turning perftools heap leak chec"..., 41Turning perftools heap leak 
checking off
) = 41
...

What are the libraries that I can compare between my working SL and my broken 
Arch PCs to find some differences that probably lead to my problem?

Original issue reported on code.google.com by kunze.jo...@gmail.com on 19 Jan 2012 at 5:11

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Update:
Actually I meant svn revision 133

I'm running on a x86_64:
#uname -a
Linux na62-farm-dell1 3.1.9-2-ARCH #1 SMP PREEMPT Sat Jan 14 09:11:37 CET 2012 
x86_64 Intel(R) Xeon(R) CPU X5670 @ 2.93GHz GenuineIntel GNU/Linux

An example with PERFTOOLS_VERBOSE=10:

# export PERFTOOLS_VERBOSE=10
# env HEAPCHECK=normal ./test
AddNewHook(0x7f0af728d6d0)
AddDeleteHook(0x7f0af728d5f0)
MemoryRegionMap Init
AddMmapHook(0x7f0af72a3180)
AddMremapHook(0x7f0af72a30d0)
AddSbrkHook(0x7f0af72a3030)
AddMunmapHook(0x7f0af72a2ac0)
MMap = 0x7f0af76dc000 of 65536 at 0 prot 3 flags 34 fd -1 offs 0
MMap = 0x7f0af7700000 of 4096 at 0 prot 3 flags 34 fd -1 offs 0
New global region 0x7f0af7700000..0x7f0af7701000 from (nil)
Saving recursive insert of region 0x7f0af7700000..0x7f0af7701000 from (nil)
MMap = 0x7f0af76ff000 of 4096 at 0 prot 3 flags 34 fd -1 offs 0
New global region 0x7f0af76ff000..0x7f0af7700000 from (nil)
Saving recursive insert of region 0x7f0af76ff000..0x7f0af7700000 from (nil)
Found hooked allocator at 2: 0x7f0af72ac2cb <- 0x7f0af729d54d
New global region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d
Saving recursive insert of region 0x7f0af76dc000..0x7f0af76ec000 from 
0x7f0af729d54d
Initializing region set
Inserting region 0x7f0af76ff000..0x7f0af7700000 from (nil)
MMap = 0x7f0af76cc000 of 65536 at 0 prot 3 flags 34 fd -1 offs 0
Found hooked allocator at 2: 0x7f0af72ac2cb <- 0x7f0af729d54d
New global region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d
Saving recursive insert of region 0x7f0af76cc000..0x7f0af76dc000 from 
0x7f0af729d54d
Inserted region 0x7f0af76ff000..0x7f0af7700000 :
List of regions:
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
End of regions list
Inserting region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d
Inserted region 0x7f0af76cc000..0x7f0af76dc000 :
List of regions:
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
End of regions list
Inserting region 0x7f0af7700000..0x7f0af7701000 from (nil)
Inserted region 0x7f0af7700000..0x7f0af7701000 :
List of regions:
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Inserting region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d
Inserted region 0x7f0af76dc000..0x7f0af76ec000 :
List of regions:
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
MemoryRegionMap Init done
MMap = 0x7f0af76bc000 of 65536 at 0 prot 3 flags 34 fd -1 offs 0
Found hooked allocator at 2: 0x7f0af72ac2cb <- 0x7f0af729d54d
New global region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d
Inserting region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d
Inserted region 0x7f0af76bc000..0x7f0af76cc000 :
List of regions:
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
MMap = 0x7f0af755c000 of 1441792 at 0 prot 3 flags 34 fd -1 offs 0
Found hooked allocator at 2: 0x7f0af72ac2cb <- 0x7f0af729d54d
New global region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d
Inserting region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d
Inserted region 0x7f0af755c000..0x7f0af76bc000 :
List of regions:
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Starting tracking the heap
Sbrk = 0xe9e000 of 131072
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xe9e000..0xebe000 from 0x7f0af7294bf9
Inserting region 0xe9e000..0xebe000 from 0x7f0af7294bf9
Inserted region 0xe9e000..0xebe000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xebe000 of 131072
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xebe000..0xede000 from 0x7f0af7294bf9
Inserting region 0xebe000..0xede000 from 0x7f0af7294bf9
Inserted region 0xebe000..0xede000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xede000 of 131072
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xede000..0xefe000 from 0x7f0af7294bf9
Inserting region 0xede000..0xefe000 from 0x7f0af7294bf9
Inserted region 0xede000..0xefe000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xefe000 of 536768
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xefe000..0xf810c0 from 0x7f0af7294bf9
Inserting region 0xefe000..0xf810c0 from 0x7f0af7294bf9
Inserted region 0xefe000..0xf810c0 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xf810c0 of 32768
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xf810c0..0xf890c0 from 0x7f0af7294bf9
Inserting region 0xf810c0..0xf890c0 from 0x7f0af7294bf9
Inserted region 0xf810c0..0xf890c0 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xf890c0 of 131072
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9
Inserting region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9
Inserted region 0xf890c0..0xfa90c0 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0xfa90c0 of 1048576
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9
Inserting region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9
Inserted region 0xfa90c0..0x10a90c0 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0x10a90c0 of 3904
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294c3e
New global region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e
Inserting region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e
Inserted region 0x10a90c0..0x10aa000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0x10aa000 of 32768
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0x10aa000..0x10b2000 from 0x7f0af7294bf9
Inserting region 0x10aa000..0x10b2000 from 0x7f0af7294bf9
Inserted region 0x10aa000..0x10b2000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e stack=0
Memory region 0x10aa000..0x10b2000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0x10b2000 of 16384
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0x10b2000..0x10b6000 from 0x7f0af7294bf9
Inserting region 0x10b2000..0x10b6000 from 0x7f0af7294bf9
Inserted region 0x10b2000..0x10b6000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e stack=0
Memory region 0x10aa000..0x10b2000 from 0x7f0af7294bf9 stack=0
Memory region 0x10b2000..0x10b6000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Sbrk = 0x10b6000 of 16384
Found hooked allocator at 2: 0x7f0af72ac450 <- 0x7f0af7294bf9
New global region 0x10b6000..0x10ba000 from 0x7f0af7294bf9
Inserting region 0x10b6000..0x10ba000 from 0x7f0af7294bf9
Inserted region 0x10b6000..0x10ba000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e stack=0
Memory region 0x10aa000..0x10b2000 from 0x7f0af7294bf9 stack=0
Memory region 0x10b2000..0x10b6000 from 0x7f0af7294bf9 stack=0
Memory region 0x10b6000..0x10ba000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Recording Alloc: 0xfaa000 of 1; 0
Found hooked allocator at 2: 0x7f0af72a658b <- 0x7f0af728a79f
MMap = 0x7f0af753c000 of 131072 at 0 prot 3 flags 34 fd -1 offs 0
Found hooked allocator at 2: 0x7f0af72ac2cb <- 0x7f0af729d54d
New global region 0x7f0af753c000..0x7f0af755c000 from 0x7f0af729d54d
Inserting region 0x7f0af753c000..0x7f0af755c000 from 0x7f0af729d54d
Inserted region 0x7f0af753c000..0x7f0af755c000 :
List of regions:
Memory region 0xe9e000..0xebe000 from 0x7f0af7294bf9 stack=0
Memory region 0xebe000..0xede000 from 0x7f0af7294bf9 stack=0
Memory region 0xede000..0xefe000 from 0x7f0af7294bf9 stack=0
Memory region 0xefe000..0xf810c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf810c0..0xf890c0 from 0x7f0af7294bf9 stack=0
Memory region 0xf890c0..0xfa90c0 from 0x7f0af7294bf9 stack=0
Memory region 0xfa90c0..0x10a90c0 from 0x7f0af7294bf9 stack=0
Memory region 0x10a90c0..0x10aa000 from 0x7f0af7294c3e stack=0
Memory region 0x10aa000..0x10b2000 from 0x7f0af7294bf9 stack=0
Memory region 0x10b2000..0x10b6000 from 0x7f0af7294bf9 stack=0
Memory region 0x10b6000..0x10ba000 from 0x7f0af7294bf9 stack=0
Memory region 0x7f0af753c000..0x7f0af755c000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af755c000..0x7f0af76bc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76bc000..0x7f0af76cc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76cc000..0x7f0af76dc000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76dc000..0x7f0af76ec000 from 0x7f0af729d54d stack=0
Memory region 0x7f0af76ff000..0x7f0af7700000 from 0x0 stack=0
Memory region 0x7f0af7700000..0x7f0af7701000 from 0x0 stack=0
End of regions list
Alloc Recorded: 0xfaa000 of 1
Recording Free 0xfaa000
Free Recorded: 0xfaa000
Recording Alloc: 0xfaa008 of 1; 0
Found hooked allocator at 2: 0x7f0af72a658b <- 0x7f0af728a7b6
Alloc Recorded: 0xfaa008 of 1
Recording Free 0xfaa008
Free Recorded: 0xfaa008
Recording Alloc: 0xfac000 of 16; 0
Found hooked allocator at 2: 0x7f0af72a9e50 <- 0x7f0af728a7d1
Alloc Recorded: 0xfac000 of 16
Recording Alloc: 0xfaa008 of 8; 0
Found hooked allocator at 2: 0x7f0af72a9e50 <- 0x7f0af729c60e
Alloc Recorded: 0xfaa008 of 8
Got pointer into 0xfaa008 at +0 offset
Going to ignore live object at 0xfaa008 of 8 bytes
Recording Alloc: 0xfae000 of 31; 0
Found hooked allocator at 2: 0x7f0af72a9e50 <- 0x7f0af700f5b9
Alloc Recorded: 0xfae000 of 31
Recording Alloc: 0xfae040 of 30; 0
Found hooked allocator at 2: 0x7f0af72a9e50 <- 0x7f0af700f5b9
Alloc Recorded: 0xfae040 of 30
Recording Alloc: 0xfae020 of 29; 0
Found hooked allocator at 2: 0x7f0af72a9e50 <- 0x7f0af700f5b9
Alloc Recorded: 0xfae020 of 29
<GoogleModuleObject> constructing: init_start
Recording Alloc: 0xfb0000 of 256; 0
Found hooked allocator at 2: 0x7f0af72a8f4b <- 0x7f0af6719bad

And that's it. No more output and no return of the program.

Original comment by kunze.jo...@gmail.com on 19 Jan 2012 at 5:39

GoogleCodeExporter commented 9 years ago
[I'm sorry for the late response.  When I renamed the project to gperftools I 
forgot to re-enable email alerts, so I haven't been getting bug reports.  I 
just happened to notice now.]

You can debug this in gdb.  You'll need to do something like
   env HEAP_CHECK_RUN_UNDER_GDB=1 HEAPCHECK=normal gdb ./test

then type 'run'.  If it hangs, you can do control-C and 'bt' to see where it's 
hanging.  Hopefully that will give some clue.

You don't mention, but are you using libunwind?  Try running configure with 
--enable-frame-pointers to see if that makes the problem go away.

Original comment by csilv...@gmail.com on 26 Jan 2012 at 1:17

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for your answer!

So at first I'm using libunwind-0.99 as I mentioned above. Is there a newer 
version that works with tcmalloc? I remember that I had problems with the 
newest version a few months ago...

I just configured perftools with --enable-frame-pointers and reinstalled but 
nothing changed with small test programs. With my real program I get a lot of 
errors (looks like some 32-bit windows files are included that mismatch with 
the rest)

On the other hand your gdb proposal helped much more. The full reproducable 
shell code:

# echo "int main(){return 0;}" > test.c
# gcc -ltcmalloc -otest test.c
# ./test
# # So here everything works fine. The program returns immediately
# env HEAPCHECK=normal ./test
^C
# # Here I had to ctr+c as the program got stuck
#
# env HEAP_CHECK_RUN_UNDER_GDB=1 HEAPCHECK=normal gdb ./test
GNU gdb (GDB) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /tmp/test...(no debugging symbols found)...done.
(gdb) run
Starting program: /tmp/test 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
^C
Program received signal SIGINT, Interrupt.
0x00007ffff787c2e0 in __nanosleep_nocancel () from /lib/libc.so.6
(gdb) bt
#0  0x00007ffff787c2e0 in __nanosleep_nocancel () from /lib/libc.so.6
#1  0x00007ffff7b9e6c9 in base::internal::SpinLockDelay (w=0x7ffff7db5210, 
value=2, loop=148) at ./src/base/spinlock_linux-inl.h:89
#2  0x00007ffff7ba0272 in SpinLock::SlowLock (this=0x7ffff7db5210) at 
src/base/spinlock.cc:132
#3  0x00007ffff7b8783c in Lock (this=0x7ffff7db5210) at src/base/spinlock.h:75
#4  SpinLockHolder (l=0x7ffff7db5210, this=0x7fffffffcbb0) at 
src/base/spinlock.h:141
#5  NewHook (ptr=0x714000, size=256) at src/heap-checker.cc:577
#6  0x00007ffff7b95f4a in MallocHook::InvokeNewHookSlow (p=0x714000, s=256) at 
src/malloc_hook.cc:525
#7  0x00007ffff7ba2f4b in InvokeNewHook (s=256, p=0x714000) at 
src/malloc_hook-inl.h:161
#8  do_realloc_with_callback (invalid_get_size_fn=<optimized out>, 
invalid_free_fn=<optimized out>, new_size=<optimized out>, old_ptr=<optimized 
out>)
    at src/tcmalloc.cc:1213
#9  do_realloc (new_size=<optimized out>, old_ptr=<optimized out>) at 
src/tcmalloc.cc:1220
#10 tc_realloc (old_ptr=<optimized out>, new_size=256) at src/tcmalloc.cc:1518
#11 0x00007ffff7822bad in _IO_vfscanf_internal () from /lib/libc.so.6
#12 0x00007ffff7832c10 in vsscanf () from /lib/libc.so.6
#13 0x00007ffff782d2c7 in sscanf () from /lib/libc.so.6
#14 0x00007ffff7b9f49b in ProcMapsIterator::NextExt (this=0x7fffffffe7c0, 
start=0x7fffffffe858, end=0x7fffffffe860, flags=0x7fffffffe878, 
    offset=0x7fffffffe868, inode=0x7fffffffe870, filename=0x7fffffffe880, file_mapping=0x0, file_pages=0x0, anon_mapping=0x0, anon_pages=0x0, dev=0x0)
    at src/base/sysinfo.cc:713
#15 0x00007ffff7b9f7af in ProcMapsIterator::Next (this=<optimized out>, 
start=<optimized out>, end=<optimized out>, flags=<optimized out>, 
    offset=<optimized out>, inode=<optimized out>, filename=0x7fffffffe880) at src/base/sysinfo.cc:653
#16 0x00007ffff7b8a0b1 in HeapLeakChecker::UseProcMapsLocked 
(proc_maps_task=HeapLeakChecker::DISABLE_LIBRARY_ALLOCS) at 
src/heap-checker.cc:905
#17 0x00007ffff7b8a7d8 in HeapLeakChecker_InternalInitStart () at 
src/heap-checker.cc:1993
#18 0x00007ffff7b8215c in google_init_module_init_start () at 
src/heap-checker.cc:2083
#19 GoogleInitializer (dtor=0, ctor=<optimized out>, name=0x7ffff7ba7522 
"init_start", this=0x7ffff7db5250) at src/base/googleinit.h:45
#20 __static_initialization_and_destruction_0 (__initialize_p=<optimized out>, 
__priority=<optimized out>) at src/heap-checker.cc:2083
#21 _GLOBAL__sub_I_heap_checker.cc(void) () at src/heap-checker.cc:2333
#22 0x00007ffff7dea47e in call_init () from /lib/ld-linux-x86-64.so.2
#23 0x00007ffff7dea566 in _dl_init_internal () from /lib/ld-linux-x86-64.so.2
#24 0x00007ffff7ddd75a in _dl_start_user () from /lib/ld-linux-x86-64.so.2
#25 0x0000000000000001 in ?? ()
#26 0x00007fffffffed24 in ?? ()
#27 0x0000000000000000 in ?? ()
(gdb)

So what now? 

Original comment by kunze.jo...@gmail.com on 26 Jan 2012 at 3:22

GoogleCodeExporter commented 9 years ago
I solved this by backporting the following glibc commit
20b38e0301279a37a3f1e769843933bcc0d5f736
to Arch's glibc package (glibc-2.15-4), and recompiling google-perftools with 
it.

Apparently sscanf always calls malloc instead of alloca which triggers some 
deadlock. Here's the mailing list thread:
http://comments.gmane.org/gmane.comp.lib.glibc.alpha/17093

Good luck.

Original comment by Ran...@gmail.com on 30 Jan 2012 at 12:53

GoogleCodeExporter commented 9 years ago
Thank you very much for this post! Sounds like this is the problem, but I'm 
currently not able to compile glibc. make -j48 ends with following:

/performance/glibc/build/math/libm_pic.a(e_atan2.os): In function 
`__ieee754_atan2':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/e_atan2.c:15: undefined 
reference to `__ieee754_atan2_avx'
/performance/glibc/build/math/libm_pic.a(e_exp.os): In function `__ieee754_exp':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/e_exp.c:15: undefined 
reference to `__ieee754_exp_avx'
/performance/glibc/build/math/libm_pic.a(e_log.os): In function `__ieee754_log':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/e_log.c:15: undefined 
reference to `__ieee754_log_avx'
/performance/glibc/build/math/libm_pic.a(s_atan.os): In function `atan':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/s_atan.c:15: undefined 
reference to `__atan_avx'
/performance/glibc/build/math/libm_pic.a(s_sin.os): In function `__cos':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/s_sin.c:20: undefined 
reference to `__cos_avx'
/performance/glibc/build/math/libm_pic.a(s_sin.os): In function `__sin':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/s_sin.c:24: undefined 
reference to `__sin_avx'
/performance/glibc/build/math/libm_pic.a(s_tan.os): In function `tan':
/performance/glibc/math/../sysdeps/x86_64/fpu/multiarch/s_tan.c:15: undefined 
reference to `__tan_avx'
collect2: ld returned 1 exit status
make[2]: *** [/performance/glibc/build/math/libm.so] Error 1
make[2]: Leaving directory `/performance/glibc/math'
make[1]: *** [math/others] Error 2
make[1]: Leaving directory `/performance/glibc'
make: *** [all] Error 2

Well I hope that I will find some more time to investigate on this or probably 
a glibc 2.16 release with this issue fixed is faster than me ;-)

Original comment by kunze.jo...@gmail.com on 1 Feb 2012 at 2:24

GoogleCodeExporter commented 9 years ago
Glad to hear that the problem was diagnosed.  It doesn't sound like a perftools 
issue, so I'm closing the bug.  (Feel free to reopen if I'm mistaken.)

Original comment by csilv...@gmail.com on 1 Feb 2012 at 6:35