gcc - Why gcov will cause program crash? -


i using gcov test program (add "-fprofile-arcs -ftest-coverage") on linux, program crash after start:

(gdb) bt #0  0x00000034e433386f in __strlen_sse42 () /lib64/libc.so.6 #1  0x000000000053c57a in __gcov_init () #2  0x000000000053c4b9 in _global__i_65535_0_g_st_rerun_cmd_param ()     @ source/rerun/aicent_ara_rerun.c:963 #3  0x000000000053dc26 in __do_global_ctors_aux () #4  0x0000000000403743 in _init () #5  0x00007fff6d6b3ce8 in ?? () #6  0x000000000053db55 in __libc_csu_init () #7  0x00000034e421ecb0 in __libc_start_main () /lib64/libc.so.6 #8  0x0000000000404449 in _start () 

from __gcov_init() source (http://www.coreboot.org/~stepan/coreboot-coverage/lib/libgcov.c.gcov.html) ,

...... size_t filename_length = strlen(info->filename); ...... 

i can see root cause "info->filename" invalid (after disassembling code, address 0x57c4ac00000000, , indeed invalid).

i don't know how analyse bug, give clues? in advance!

p.s. linux environment:

[root@localhost rel_1_3_3_20140902]# uname -a linux localhost.localdomain 2.6.32-431.el6.x86_64 #1 smp sun nov 10 22:19:54 est 2013 x86_64 x86_64 x86_64 gnu/linux 

gcc version:

[root@localhost rel_1_3_3_20140902]# gcc -v using built-in specs. target: x86_64-redhat-linux configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux thread model: posix gcc version 4.4.7 20120313 (red hat 4.4.7-4) (gcc) 

the root cause of issue using -fpack-struct=4 compile option on 64-bit linux. detailed information, can refer https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43341.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -