Setting a breakpoint on malloc when running Ltest-nomalloc shows that
fopen() indirectly allocates memory. I am not sure how to prevent that,
but here's a backtrace for our mutual amusement and consideration.

#0  malloc (s=352) at Gtest-nomalloc.c:46
#1  0xb7e61adf in ?? () from /lib/libc.so.6
#2  0xb7e61bac in fopen () from /lib/libc.so.6
#3  0xb7f967ce in load_debug_frame (
    file=0xbfffcf40 ".../libunwind/tests/.libs/Ltest-nomalloc",
buf=0xbfffcf3c, bufsize=0xbfffcf38, is_local=1)
    at dwarf/Gfind_proc_info-lsb.c:120
#4  0xb7f9740d in locate_debug_info (as=0xb7fa5340, info=0xbfffe164,
    addr=134514522, dlname=0xb7ffa17c "") at dwarf/Gfind_proc_info-lsb.c:343
#5  0xb7f976cb in _ULx86_dwarf_find_debug_frame (found=0,
di_debug=0xbfffe284,
    info=0xbfffe164, ip=134514522) at dwarf/Gfind_proc_info-lsb.c:435
#6  0xb7f983f3 in callback (info=0xbfffe164, size=40, ptr=0xbfffe244)
    at dwarf/Gfind_proc_info-lsb.c:746
#7  0xb7f0d4bd in dl_iterate_phdr () from /lib/libc.so.6
#8  0xb7f98507 in _ULx86_dwarf_find_proc_info (as=0xb7fa5340, ip=134514522,
    pi=0xbfffe864, need_unwind_info=1, arg=0xbfffe7f8)
    at dwarf/Gfind_proc_info-lsb.c:771
#9  0xb7f93109 in fetch_proc_info (c=0xbfffe7f8, ip=134514522,
    need_unwind_info=1) at dwarf/Gparser.c:422
#10 0xb7f940f6 in _ULx86_dwarf_find_save_locs (c=0xbfffe7f8)
    at dwarf/Gparser.c:852
#11 0xb7f953ee in _ULx86_dwarf_step (c=0xbfffe7f8) at dwarf/Gstep.c:34
#12 0xb7f9c227 in _ULx86_step (cursor=0xbfffe7f8) at x86/Gstep.c:38
#13 0x080487f3 in do_backtrace () at Gtest-nomalloc.c:75
#14 0x08048826 in foo3 () at Gtest-nomalloc.c:88
#15 0x08048833 in foo2 () at Gtest-nomalloc.c:94
#16 0x08048840 in foo1 () at Gtest-nomalloc.c:100
#17 0x08048850 in main (argc=1, argv=0xbfffeae4) at Gtest-nomalloc.c:106

-- 
Zach Welch
CodeSourcery
[email protected]
(650) 331-3385 x743

_______________________________________________
Libunwind-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/libunwind-devel

Reply via email to