1
votes

i'm writing a small tool written in c and met on a segmentation fault which i don't know currently how to resolve. Running in GDB gives me the following hint:

    Program received signal SIGSEGV, Segmentation fault. 
    __strlen_sse42 () at ../sysdeps/x86_64/multiarch/strlen-sse4.S:32 
    ../sysdeps/x86_64/multiarch/strlen-sse4.S: File or Directory not found 
    in ../sysdeps/x86_64/multiarch/strlen-sse4.S
    (gdb) bt
    0  __strlen_sse42 () at ../sysdeps/x86_64/multiarch/strlen-sse4.S:32
    1  0x00007ffff764fed8 in strdup_and_subst_obj () from /usr/lib/libgvc.so.5
    2  0x00007ffff7650631 in make_label () from /usr/lib/libgvc.so.5
    3  0x00007ffff765a6d1 in common_init_node_opt () from /usr/lib/libgvc.so.5
    4  0x00007ffff309d700 in dot_init_node_edge () from 
    usr/lib/graphviz/libgvplugin_dot_layout.so.6
    5  0x00007ffff309dcd8 in dot_layout () from /usr/lib/graphviz/libgvplugin_dot_layout.so.6
    6  0x00007ffff7633a94 in gvLayoutJobs () from /usr/lib/libgvc.so.5
    7  0x00007ffff7639425 in gvLayout () from /usr/lib/libgvc.so.5
    8  0x0000000000400eef in main ()

I would say: i'm missing a specific dependency on my system or in my executable (Ubuntu 11.04 64-Bit) Would be very grateful for any advice :]

I'm currently using:

gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2

Edit:

(gdb) info registers

    rax            0x6380e0 6521056
    rbx            0x62dc14 6478868
    rcx            0x0  0
    rdx            0x0  0
    rsi            0x639770 6526832
    rdi            0x0  0
    rbp            0x639770 0x639770
    rsp            0x7fffffffd358   0x7fffffffd358
    r8             0x0  0
    r9             0x0  0
    r10            0x7fffffffd140   140737488343360
    r11            0x7ffff764fda0   140737343978912
    r12            0x62dc14 6478868
    r13            0x639770 6526832
    r14            0x0  0
    r15            0x7ffff7671d85   140737344118149
    rip            0x7ffff6d7d49f   0x7ffff6d7d49f 
    eflags         0x10246  [ PF ZF IF RF ]
    cs             0x33 51
    ss             0x2b 43
    ds             0x0  0
    es             0x0  0
    fs             0x0  0
    gs             0x0  0
1
To make a guess: Your hardware does not support SSE4 which your program seems to use. Can you give the lines with which you compiled?Nobody moving away from SE
It could be. Maybe its also a problem relating to the library (libgraphviz) i use, because i have no explicit calls to the api for sse4 or any other SIMD parallization in my programm. It seems the current version of libgraphviz managed by the standard ubuntu repositories are depending on this instructions for some optimization. But i dont know how its internal organized.Ruun
FWIW line 32 in glibc-2.14's strlen-sse4.S is pcmpeqb (%rdi), %xmm1 which is only a SSE2 instruction. OTOH it is the first place in that function where the string is accessed. Could you dump the registers at the crash site and attach it to your post (info registers)?user786653
I edited my posting to attach the output. I hope thats the information you wanted. Btw. I found out: In another project (completely different from this) i also get the same error, when i use Boost in C++, which is using sse for algorithm optimization in that place.Ruun

1 Answers

2
votes

Segmentation fault is usually a null pointer dereference. Given that libc is pretty solid, you most likely want to recompile your program with debug symbols, and get the debug variant of the Ubuntu package for libgvc.

The "Missing strlen_sse4.S" is just the debugger complaining that it can't find the file to give you a listing of the crash site. You need only get a copy of glibc source to examine the file.