View Issue Details

IDProjectCategoryView StatusLast Update
0003480GNUnettestbed servicepublic2018-06-07 00:25
ReporterBart Polot Assigned ToSree Harsha Totakura  
PrioritynormalSeveritycrashReproducibilityunable to reproduce
Status closedResolutionfixed 
Product Version0.11.0pre66 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003480: Test crash on Ctrl+C
DescriptionIs this a testbed bug or am I doing something wrong?

(gdb) bt
#0 0x00007fba575fad67 in raise () from /usr/lib/libc.so.6
#1 0x00007fba575fc118 in abort () from /usr/lib/libc.so.6
#2 0x00007fba5991b7b4 in GNUNET_abort () at common_logging.c:289
#3 0x00007fba592d809d in check_readiness (op=0x14e1a40) at testbed_api_operations.c:743
#4 0x00007fba592d970f in recheck_waiting (opq=0x14c9dc0) at testbed_api_operations.c:1110
#5 0x00007fba592da1da in GNUNET_TESTBED_operation_release_ (op=0x14e1ab0) at testbed_api_operations.c:1294
#6 0x00007fba592d024b in GNUNET_TESTBED_operation_done (operation=0x14e1ab0) at testbed_api.c:1895
#7 0x0000000000401e1f in disconnect_cadet_peers (cls=0x1c0, tc=0x7fffdf9d79a0) at test_cadet.c:263
#8 0x00007fba59953076 in run_ready (rs=0x14885c0, ws=0x1488650) at scheduler.c:595
#9 0x00007fba5995391d in GNUNET_SCHEDULER_run (task=0x7fba5994dd97 <program_main>, task_cls=0x7fffdf9d7c30)
    at scheduler.c:817
#10 0x00007fba5994e928 in GNUNET_PROGRAM_run2 (argc=3, argv=0x7fffdf9d7dd0, binaryName=0x4055e4 "test_cadet_small",
    binaryHelp=0x7fba592eb329 "nohelp", options=0x7fffdf9d7d90, task=0x7fba592e28b5 <run>, task_cls=0x1486510,
    run_without_scheduler=0) at program.c:286
#11 0x00007fba5994ea7f in GNUNET_PROGRAM_run (argc=3, argv=0x7fffdf9d7dd0, binaryName=0x4055e4 "test_cadet_small",
    binaryHelp=0x7fba592eb329 "nohelp", options=0x7fffdf9d7d90, task=0x7fba592e28b5 <run>, task_cls=0x1486510)
    at program.c:325
#12 0x00007fba592e2bbc in GNUNET_TESTBED_test_run (testname=0x4055e4 "test_cadet_small",
    cfg_filename=0x405584 "test_cadet_drop.conf", num_peers=2, event_mask=0, cc=0x0, cc_cls=0x0,
    test_master=0x404c23 <cadet_test_run>, test_master_cls=0x1486430) at testbed_api_test.c:151
#13 0x0000000000404f9d in GNUNET_CADET_TEST_run (testname=0x4055e4 "test_cadet_small",
    cfgname=0x405584 "test_cadet_drop.conf", num_peers=2, tmain=0x403d80 <tmain>, tmain_cls=0x0,
    new_channel=0x4032a2 <incoming_channel>, cleaner=0x40358f <channel_cleaner>, handlers=0x6064e0 <handlers>,
    ports=0x6066c8 <ports>) at cadet_test_lib.c:288
#14 0x0000000000404770 in main (argc=1, argv=0x7fffdf9d7fd8) at test_cadet.c:968
(gdb)
Additional Information#0 0x00007fba575fad67 in raise () from /usr/lib/libc.so.6
No symbol table info available.
#1 0x00007fba575fc118 in abort () from /usr/lib/libc.so.6
No symbol table info available.
#2 0x00007fba5991b7b4 in GNUNET_abort () at common_logging.c:289
No locals.
#3 0x00007fba592d809d in check_readiness (op=0x14e1a40) at testbed_api_operations.c:743
        evict_ops = 0x14e1ab0
        ops = 0x4050e8
        n_ops = 32698
        n_evict_ops = 1496157920
        i = 0
        __FUNCTION__ = "check_readiness"
#4 0x00007fba592d970f in recheck_waiting (opq=0x14c9dc0) at testbed_api_operations.c:1110
        entry = 0x14e1b90
        entry2 = 0xdf0adba0df0adba
#5 0x00007fba592da1da in GNUNET_TESTBED_operation_release_ (op=0x14e1ab0) at testbed_api_operations.c:1294
        entry = 0x14e17c0
        opq = 0x14c9dc0
        i = 0
        __FUNCTION__ = "GNUNET_TESTBED_operation_release_"
#6 0x00007fba592d024b in GNUNET_TESTBED_operation_done (operation=0x14e1ab0) at testbed_api.c:1895
No locals.
#7 0x0000000000401e1f in disconnect_cadet_peers (cls=0x1c0, tc=0x7fffdf9d79a0) at test_cadet.c:263
        line = 448
        i = 0
        __FUNCTION__ = "disconnect_cadet_peers"
#8 0x00007fba59953076 in run_ready (rs=0x14885c0, ws=0x1488650) at scheduler.c:595
        p = GNUNET_SCHEDULER_PRIORITY_SHUTDOWN
        pos = 0x14e1dd0
        tc = {reason = GNUNET_SCHEDULER_REASON_SHUTDOWN, read_ready = 0x14885c0, write_ready = 0x1488650}
        __FUNCTION__ = "run_ready"
#9 0x00007fba5995391d in GNUNET_SCHEDULER_run (task=0x7fba5994dd97 <program_main>, task_cls=0x7fffdf9d7c30)
    at scheduler.c:817
        rs = 0x14885c0
        ws = 0x1488650
        timeout = {rel_value_us = 0}
        ret = 4
        shc_int = 0x149e7a0
        shc_term = 0x149e860
        shc_quit = 0x149e9e0
        shc_hup = 0x149eaa0
        shc_pipe = 0x149e920
        last_tr = 5187
        busy_wait_warning = 0
        pr = 0x14886e0
        c = 0 '\000'
        __FUNCTION__ = "GNUNET_SCHEDULER_run"
#10 0x00007fba5994e928 in GNUNET_PROGRAM_run2 (argc=3, argv=0x7fffdf9d7dd0, binaryName=0x4055e4 "test_cadet_small",
    binaryHelp=0x7fba592eb329 "nohelp", options=0x7fffdf9d7d90, task=0x7fba592e28b5 <run>, task_cls=0x1486510,
    run_without_scheduler=0) at program.c:286
        cc = {args = 0x7fffdf9d7de8, cfgfile = 0x1488850 "test_cadet_drop.conf", task = 0x7fba592e28b5 <run>,
          task_cls = 0x1486510, cfg = 0x1486560}
        path = 0x1484700 "\240\207H\001"
        loglev = 0x0
        logfile = 0x0
        cfg_fn = 0x1488720 "~/.config/gnunet.conf"
        xdg = 0x0
        ret = 3
        cnt = 5
        skew_offset = 4294967295
        skew_variance = 140438336729278
        clock_offset = 1
---Type <return> to continue, or q <return> to quit---
        cfg = 0x1486560
        defoptions = {{shortName = 99 'c', name = 0x7fba5996da50 "config",
            argumentHelp = 0x7fba5996da57 "FILENAME",
            description = 0x7fba5996da60 "use configuration file FILENAME", require_argument = 1,
            processor = 0x7fba59940455 <GNUNET_GETOPT_set_string>, scls = 0x7fffdf9d7c38}, {shortName = 104 'h',
            name = 0x7fba5996da80 "help", argumentHelp = 0x0, description = 0x7fba5996da85 "print this help",
            require_argument = 0, processor = 0x7fba5993fef3 <GNUNET_GETOPT_format_help_>, scls = 0x7fba592eb329}, {
            shortName = 76 'L', name = 0x7fba5996da95 "log", argumentHelp = 0x7fba5996da99 "LOGLEVEL",
            description = 0x7fba5996daa8 "configure logging to use LOGLEVEL", require_argument = 1,
            processor = 0x7fba59940455 <GNUNET_GETOPT_set_string>, scls = 0x7fffdf9d7c28}, {shortName = 108 'l',
            name = 0x7fba5996daca "logfile", argumentHelp = 0x7fba5996dad2 "LOGFILE",
            description = 0x7fba5996dae0 "configure logging to write logs to LOGFILE", require_argument = 1,
            processor = 0x7fba59940455 <GNUNET_GETOPT_set_string>, scls = 0x7fffdf9d7c20}, {shortName = 118 'v',
            name = 0x7fba5996db0b "version", argumentHelp = 0x0,
            description = 0x7fba5996db13 "print the version number", require_argument = 0,
            processor = 0x7fba5993fead <GNUNET_GETOPT_print_version_>, scls = 0x7fba5996db2c}}
        allopts = 0x14885c0
        gargs = 0x0
        lpfx = 0x1488740 "\340\206H\001"
        spc = 0x0
        __FUNCTION__ = "GNUNET_PROGRAM_run2"
#11 0x00007fba5994ea7f in GNUNET_PROGRAM_run (argc=3, argv=0x7fffdf9d7dd0, binaryName=0x4055e4 "test_cadet_small",
    binaryHelp=0x7fba592eb329 "nohelp", options=0x7fffdf9d7d90, task=0x7fba592e28b5 <run>, task_cls=0x1486510)
    at program.c:325
No locals.
#12 0x00007fba592e2bbc in GNUNET_TESTBED_test_run (testname=0x4055e4 "test_cadet_small",
    cfg_filename=0x405584 "test_cadet_drop.conf", num_peers=2, event_mask=0, cc=0x0, cc_cls=0x0,
    test_master=0x404c23 <cadet_test_run>, test_master_cls=0x1486430) at testbed_api_test.c:151
        argv2 = {0x14864d0 "test_cadet_small", 0x7fba592eb2f0 "-c", 0x14864f0 "test_cadet_drop.conf", 0x0}
        options = {{shortName = 0 '\000', name = 0x0, argumentHelp = 0x0, description = 0x0, require_argument = 0,
            processor = 0x0, scls = 0x0}}
        rc = 0x1486510
        ret = 0
        __FUNCTION__ = "GNUNET_TESTBED_test_run"
#13 0x0000000000404f9d in GNUNET_CADET_TEST_run (testname=0x4055e4 "test_cadet_small",
    cfgname=0x405584 "test_cadet_drop.conf", num_peers=2, tmain=0x403d80 <tmain>, tmain_cls=0x0,
    new_channel=0x4032a2 <incoming_channel>, cleaner=0x40358f <channel_cleaner>, handlers=0x6064e0 <handlers>,
    ports=0x6066c8 <ports>) at cadet_test_lib.c:288
        ctx = 0x1486430
#14 0x0000000000404770 in main (argc=1, argv=0x7fffdf9d7fd8) at test_cadet.c:968
        ports = {1, 0}
        config_file = 0x405584 "test_cadet_drop.conf"
        __FUNCTION__ = "main"
(gdb)
TagsNo tags attached.

Activities

Sree Harsha Totakura

2014-07-04 23:49

developer   ~0008508

It's a fault of testbed's API.

When you press Ctrl+C on the terminal, the testbed controller gets a SIGINT too and terminates. This results in the testbed API layer to clear up state, including operation queues. This is expected behavior.

When you press Ctrl+C on the terminal, your local scheduler, too, shutsdown and the function disconnect_cadet_peers() is scheduled which then releases testbed operations. Also expected.

Since these two events happen simultaneously, there is a race condition involved. You get the crash due to heap corruption which happens when the first event happens first.

This should be fixed by SVN 33930. Please re-open if you observe the crash again.

Issue History

Date Modified Username Field Change
2014-07-02 15:23 Bart Polot New Issue
2014-07-02 15:23 Bart Polot Status new => assigned
2014-07-02 15:23 Bart Polot Assigned To => Sree Harsha Totakura
2014-07-04 23:49 Sree Harsha Totakura Note Added: 0008508
2014-07-04 23:49 Sree Harsha Totakura Status assigned => resolved
2014-07-04 23:49 Sree Harsha Totakura Resolution open => fixed
2014-09-30 10:32 Christian Grothoff Fixed in Version => 0.11.0pre66
2014-09-30 10:32 Christian Grothoff Target Version => 0.11.0pre66
2018-06-07 00:25 Christian Grothoff Status resolved => closed