This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

colortail-0.3.0 / *** glibc detected *** ./colortail: munmap_chunk():invalid pointer: 0x0000000001528718 ***


Hi,

Others also have also reported this problem:
http://bugs.archlinux.org/task/14963

Colortail 0.3.0:
http://joakimandersson.se/files/colortail-0.3.0.tar.gz

GCC 3.0 patch for colortail-0.3.0:
http://joakimandersson.se/files/colortail-0.3.0-gcc3.patch.gz

Patch for gcc-4.4.0 for colortail:
http://bugs.archlinux.org/task/14963

Steps:
1. Patch colortail-0.3.0 w/gcc3 patch.
2. Patch colortail-0.3.0 with gcc-4.4.0 patch above.
3. Compile, but when you run it, it fails.

With older versions of GCC, it was possible to compile this and it worked, now it fails if you try to build it with any recent version of GCC and GLIBC on 32bit or 64bit Linux.

Adding some debug messages:
print_to_stdout:: before coredump
TailFile.cc:      cout << "print_to_stdout:: before coredump" << endl;

580    if (m_colorizer)
581    {
582       // colorize the string
583       const char *buf = m_colorizer->colorize(str);
584       // print the new colorized string
585       cout << buf;
586       // free the mem
587       cout << "print_to_stdout:: before coredump" << endl;
588       delete buf;

Commenting out delelte buf also fails, it is able to display a few lines
but when it goes to the next few lines after that, it emits a similar
error message:

$ ./colortail -k ~/conf.colortail -f /var/log/messages ==> /var/log/messages <==
TailFile::print: bfore fgets()
print_to_stdout:: before coredump
print_to_stdout:: text will not appear
TailFile::print: bfore fgets()
print_to_stdout:: before coredump
print_to_stdout:: text will not appear
TailFile::print: bfore fgets()
print_to_stdout:: before coredump
print_to_stdout:: text will not appear
TailFile::print: bfore fgets()
print_to_stdout:: before coredump
print_to_stdout:: text will not appear
TailFile::print: bfore fgets()


It works for awhile, but:

# echo test >> /var/log/messages # echo test >> /var/log/messages # echo test >> /var/log/messages # echo test >> /var/log/messages # echo test >> /var/log/messages

Then again, boom:
==> /var/log/messages <==
test

print_to_stdout:: before coredump
print_to_stdout:: text will not appear
follow_print:: before delete str
*** glibc detected *** ./colortail: munmap_chunk(): invalid pointer: 0x000000000124f5b8 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f11c25dfdb6]
./colortail[0x40704e]
./colortail[0x40406c]
./colortail[0x40828f]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f11c258da8d]
./colortail[0x4022f9]
======= Memory map: ========
00400000-0040b000 r-xp 00000000 08:12 412789987                          /home/war/c/colortail-0.3.0/colortail
0060b000-0060c000 rw-p 0000b000 08:12 412789987                          /home/w

How it fails normally (without anything commented out)

$ ./colortail -k ~/conf.colortail -f /var/log/dmesg
==> /var/log/dmesg <==
[ 7.258416] Adding 16787884k swap on /dev/sdb1. Priority:-1 extents:1 across:16787884k


*** glibc detected *** ./colortail: munmap_chunk(): invalid pointer: 0x0000000001676b98 ***
======= Backtrace: =========
/lib/libc.so.6[0x7f5a4d38ddb6]
./colortail[0x4070bf]
./colortail[0x403f97]
./colortail[0x40802f]
/lib/libc.so.6(__libc_start_main+0xfd)[0x7f5a4d33ba8d]
./colortail[0x4022f9]
======= Memory map: ========
00400000-0040b000 r-xp 00000000 08:12 136413967 /home/user/colortail-0.3.0/colortail
0060a000-0060b000 rw-p 0000a000 08:12 136413967 /home/user/colortail-0.3.0/colortail
01603000-01687000 rw-p 00000000 00:00 0 [heap]
7f5a4d31d000-7f5a4d467000 r-xp 00000000 08:12 6546446 /lib/libc-2.10.1.so
7f5a4d467000-7f5a4d666000 ---p 0014a000 08:12 6546446 /lib/libc-2.10.1.so
7f5a4d666000-7f5a4d66a000 r--p 00149000 08:12 6546446 /lib/libc-2.10.1.so
7f5a4d66a000-7f5a4d66b000 rw-p 0014d000 08:12 6546446 /lib/libc-2.10.1.so
7f5a4d66b000-7f5a4d670000 rw-p 00000000 00:00 0 7f5a4d670000-7f5a4d68a000 r-xp 00000000 08:12 6519556 /lib/libgcc_s.so.1
7f5a4d68a000-7f5a4d889000 ---p 0001a000 08:12 6519556 /lib/libgcc_s.so.1
7f5a4d889000-7f5a4d88a000 rw-p 00019000 08:12 6519556 /lib/libgcc_s.so.1
7f5a4d88a000-7f5a4d90b000 r-xp 00000000 08:12 6548518 /lib/libm-2.10.1.so
7f5a4d90b000-7f5a4db0a000 ---p 00081000 08:12 6548518 /lib/libm-2.10.1.so
7f5a4db0a000-7f5a4db0b000 r--p 00080000 08:12 6548518 /lib/libm-2.10.1.so
7f5a4db0b000-7f5a4db0c000 rw-p 00081000 08:12 6548518 /lib/libm-2.10.1.so
7f5a4db0c000-7f5a4dbfe000 r-xp 00000000 08:12 134223479 /usr/lib/libstdc++.so.6.0.13
7f5a4dbfe000-7f5a4ddfe000 ---p 000f2000 08:12 134223479 /usr/lib/libstdc++.so.6.0.13
7f5a4ddfe000-7f5a4de05000 r--p 000f2000 08:12 134223479 /usr/lib/libstdc++.so.6.0.13
7f5a4de05000-7f5a4de07000 rw-p 000f9000 08:12 134223479 /usr/lib/libstdc++.so.6.0.13
7f5a4de07000-7f5a4de1c000 rw-p 00000000 00:00 0 7f5a4de1c000-7f5a4de39000 r-xp 00000000 08:12 6546457 /lib/ld-2.10.1.so
7f5a4e026000-7f5a4e029000 rw-p 00000000 00:00 0 7f5a4e033000-7f5a4e038000 rw-p 00000000 00:00 0 7f5a4e038000-7f5a4e039000 r--p 0001c000 08:12 6546457 /lib/ld-2.10.1.so
7f5a4e039000-7f5a4e03a000 rw-p 0001d000 08:12 6546457 /lib/ld-2.10.1.so
7fffe2407000-7fffe241c000 rw-p 00000000 00:00 0 [stack]
7fffe2475000-7fffe2476000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)


Core was generated by `./colortail -k /home/user/conf.colortail -f /var/log/dmesg'.
Program terminated with signal 6, Aborted.
#0 0x00007f5a4d34ef25 in raise () from /lib/libc.so.6
(gdb) bt
#0 0x00007f5a4d34ef25 in raise () from /lib/libc.so.6
#1 0x00007f5a4d351d60 in abort () from /lib/libc.so.6
#2 0x00007f5a4d38455d in ?? () from /lib/libc.so.6
#3 0x00007f5a4d38ddb6 in ?? () from /lib/libc.so.6
#4 0x00000000004070bf in TailFile::print (this=0x1603370,
n=<value optimized out>) at TailFile.cc:134
#5 0x0000000000403f97 in ColorTail::start (this=0x1603010, argc=5,
argv=<value optimized out>) at ColorTail.cc:226
#6 0x000000000040802f in main (argc=5, argv=0x7fffe241a6b8) at main.cc:42
(gdb) bt full
#0 0x00007f5a4d34ef25 in raise () from /lib/libc.so.6
No symbol table info available.
#1 0x00007f5a4d351d60 in abort () from /lib/libc.so.6
No symbol table info available.
#2 0x00007f5a4d38455d in ?? () from /lib/libc.so.6
No symbol table info available.
#3 0x00007f5a4d38ddb6 in ?? () from /lib/libc.so.6
No symbol table info available.
#4 0x00000000004070bf in TailFile::print (this=0x1603370,
n=<value optimized out>) at TailFile.cc:134
ret = 0x0
buf = "[ 7.258416] Adding 16787884k swap on /dev/sdb1. Priority:-1 extents:1 across:16787884k \n", '\000' <repeats 931 times>
#5 0x0000000000403f97 in ColorTail::start (this=0x1603010, argc=5,
argv=<value optimized out>) at ColorTail.cc:226
itr = {<Iterator<TailFile*>> = {_vptr.Iterator = 0x408670},
m_current = 0x16424a0, m_previous = 0x0, m_the_list = @0x1603010}
current_file = 0x1603370
last_filename = <value optimized out>
changed = <value optimized out>
optParser = {
m_error = "No error\000\000\000\000\000\000\000\000\200£Aâÿ\177\000\000\000\f2MZ\177\000\000\000\000\000\000\000\000\000\000Ð\212\002NZ\177\000\000À\2---Type <return> to continue, or q <return> to quit---
04\002NZ\177\000\000\032\025@\000\000\000\000\000HÕ2MZ\177\000\000è\b@\000\000\000\000\000\000\000\000\000\001\000\000\000\200\001\000\000\001\000\000\000\200\177@\000\000\000\000\000\000\000\000\024\000\000\000\000?ï4MZ\177\000\000\000\001", '\000' <repeats 126 times>, "Xs\003NZ\177\000\000ФAâÿ\177\000\000Íî4MZ\177", '\000' <repeats 18 times>, "\004\000\000\000\000\000\000\000íPâMZ\177\000\000#\000\000\000ÿ\177\000\000è¤Aâÿ\177\000\000pð1M"...}
options = 0x1603030
tailfile_counter = 0
__PRETTY_FUNCTION__ = "int ColorTail::start(int, char**)"
#6 0x000000000040802f in main (argc=5, argv=0x7fffe241a6b8) at main.cc:42
ret = <value optimized out>
(gdb)


Anyone have any idea what is going on?

Fedora and RHEL5 have this package in their x86_64 repos, I tried them and
to my surprise they were also broken!  If you try to use them, they fail
the exact same way, I guess not many people use this package in those
distributions, otherwise someone would have caught it!

Justin.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]