Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when passed an unrecognized long option #10

Open
ticalc-travis opened this issue Apr 20, 2015 · 0 comments
Open

Crash when passed an unrecognized long option #10

ticalc-travis opened this issue Apr 20, 2015 · 0 comments

Comments

@ticalc-travis
Copy link

I see a crash, both with 0.27.2 and the git version, when passing unrecognized long options, apparently due to the long_options struct in i7z.c not being properly terminated.

$ i7z --version
zsh: segmentation fault (core dumped) i7z --version

Backtrace:
Thread 1 (Thread 0x7ffff7fbf700 (LWP 5425)):
#0 0x00007ffff743110c in __strncmp_sse2 () from /usr/lib/libc.so.6

No symbol table info available.
#1 0x00007ffff747f4b7 in _getopt_internal_r () from /usr/lib/libc.so.6

No symbol table info available.
#2 0x00007ffff7480201 in _getopt_internal () from /usr/lib/libc.so.6

No symbol table info available.
#3 0x00007ffff748027e in getopt_long () from /usr/lib/libc.so.6

No symbol table info available.
#4 0x0000000000401629 in main (argc=2, argv=0x7fffffffe638) at i7z.c:441

    option_index = 0
    log_file_name = "\000\000\000\000\000\000\000\000\257\067\336\367\377\177\000\000\000\000\000\000\000\000\000\000,6\336\367\000\000\000\000\001\000\000\000\000\000\000\000\001\335\377\377\377\17
    log_file_name2 = "\264\341\377\377\377\177\000\000\200B\336\367\377\177\000\000\000\000\000\000\000\000\000\000\\\270\335\367\377\177\000\000H\265\335\367\377\177\000\000\270\341\377\377\377\177
    chi = {max_online_cpu = 0, num_sockets = 0, sibling_num = {0 <repeats 128 times>},
      processor_num = {0 <repeats 128 times>}, package_num = {0 <repeats 128 times>},
      coreid_num = {0 <repeats 48 times>, -136439751, 32767, 0, 0, 1675264, 0, 1675216, 0,
        1675216, 0, 0, 0, 5, 0, 3772416, 0, 3796992, 0, 3795200, 0, 3813200, 0, 1675264, 0, 3,
        32767, 0, 0, 28672, 0, 26668, 0, 26668, 0, 0, 0, 5, 32767, 2121728, 0, -136400236,
        32767, 2126444, 0, -147040927, 32767, 0, 0, -136432483, 32767, 2187264, 0, -136400236,
        0, 1, 0, -141172204, 32767, 0, 0, -136432483, 32767, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
        -136439830, 32767, 0, 0, -136444392, 32767, 390676, 0}, display_cores = {390676, 0,
        -9312, 32767, 0, 0, 2486272, 0, -136373794, 32767, 4, 0, 47, 0, 0, 0, -136420871,
        32767, -8928, 32767, -134467976, 32767, 19, 0, 4196875, 0, 1836017711, 1, 10, 0,
        1768697698, 1932419938, 1, 0, -8928, 32767, -136421849, 32767, 2147479968, 3, -8928,
        32767, -134475776, 32767, -136438680, 32767, -8880, 32767, -136400236, 32767, 0, 3,
        -138952089, 32767, 0, 0, -136432483, 32767, -1279, 4095, -9232, 0, 1, 0, -134467976,
        32767, 4196875, 0, -134225664, 32767, 6, 0, -143335424, 32767, 65037, 0, 529053, 0, 1,
        0, 33261, 0, 0, 0, 0, 0, 1984416, 0, 4096, 0, 3880, 0, 1429418557, 0, 597366993, 0,
        1410679597, 0, 0, 0, 1412366343, 0, 928956310, 0, 0, 0, 0, 0, 0, 0, -134271763, 32767,
        4196875, 0, -134225616, 32767, 0, 0, -134230016, 32767, -134271763, 32767, 0, 0,
        -136432084, 32767, 0, 0}, HT = 176}
    socket_0 = {max_cpu = 0, socket_num = 0, processor_num = {-1, -1, -1, -1, -1, -1, -1, -1,
        0 <repeats 24 times>}, num_physical_cores = 0, num_logical_cores = 0}
    socket_1 = {max_cpu = 0, socket_num = 1, processor_num = {-1, -1, -1, -1, -1, -1, -1, -1,
        0 <repeats 24 times>}, num_physical_cores = 0, num_logical_cores = 0}
    c = <optimized out>
    presupplied_socket_info = false
    long_options = {{name = 0x4096dc "write", has_arg = 1, flag = 0x0, val = 119}, {
        name = 0x40916c "socket0", has_arg = 1, flag = 0x0, val = 122}, {
        name = 0x409174 "socket1", has_arg = 1, flag = 0x0, val = 121}, {
        name = 0x40917c "logfile", has_arg = 1, flag = 0x0, val = 108}, {
        name = 0x409184 "help", has_arg = 0, flag = 0x0, val = 104}, {name = 0x409189 "nogui",
        has_arg = 0, flag = 0x0, val = 110}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant