Comment 9 for bug 1718668

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Position slightly changed getopt.c, line 1188 -> getopt.c, line 735
But way more important the "good case" does not hit the getopt at all.

The backtrace finds the true reason which is that it stopped using its gnulib implementation.
The configure still detects to use the local gnulib thing and sets posixly, but debugging shows:

Artful:
#0 getopt (argc=7, argv=0x7fffffffe270, optstring=0x55555555bf5a "abp:q:") at getopt.c:735
#1 0x0000555555554f37 in getopt_loop (argc=7, argv=0x7fffffffe270, options=0x55555555bf5a "abp:q:", a_seen=0x7fffffffe1b0, b_seen=0x7fffffffe1b4, p_value=0x7fffffffe210,
    q_value=0x7fffffffe218, non_options_count=0x7fffffffe1b8, non_options=0x7fffffffe220, unrecognized=0x7fffffffe1bc, message_issued=0x7fffffffe1ae) at ../../../../gnulib/tests/test-getopt.h:43
#2 0x00005555555591f4 in test_getopt () at ../../../../gnulib/tests/test-getopt.h:748
#3 0x000055555555bb24 in main () at ../../../../gnulib/tests/test-getopt-main.h:65
(gdb) frame 1
#1 0x0000555555554f37 in getopt_loop (argc=7, argv=0x7fffffffe270, options=0x55555555bf5a "abp:q:", a_seen=0x7fffffffe1b0, b_seen=0x7fffffffe1b4, p_value=0x7fffffffe210,
    q_value=0x7fffffffe218, non_options_count=0x7fffffffe1b8, non_options=0x7fffffffe220, unrecognized=0x7fffffffe1bc, message_issued=0x7fffffffe1ae) at ../../../../gnulib/tests/test-getopt.h:43

Zesty:
#0 rpl_getopt (argc=7, argv=0x7fffffffe220, optstring=0x55555555ce0a "abp:q:") at ../../../../gnulib/lib/getopt.c:739
#1 0x000055555555508d in getopt_loop (argc=7, argv=0x7fffffffe220, options=0x55555555ce0a "abp:q:", a_seen=0x7fffffffe160, b_seen=0x7fffffffe164, p_value=0x7fffffffe1c0,
    q_value=0x7fffffffe1c8, non_options_count=0x7fffffffe168, non_options=0x7fffffffe1d0, unrecognized=0x7fffffffe16c, message_issued=0x7fffffffe15e) at ../../../../gnulib/tests/test-getopt.h:43
#2 0x000055555555934a in test_getopt () at ../../../../gnulib/tests/test-getopt.h:748
#3 0x000055555555bc7a in main () at ../../../../gnulib/tests/test-getopt-main.h:65

rpl_getopt in zesty (which behaves correctly, but getopt in artful now.
Also the ENV has not set the posixly_correct env as it expects gnulib which is correct

So the error is that it uses the glibc's getopt instead of it's bundled gnulib.
TBD: check linking and build in that regard