View Issue Details

IDProjectCategoryView StatusLast Update
0003995GNUnetutil librarypublic2018-06-07 00:24
ReporterFlorian DoldAssigned ToChristian Grothoff 
Status closedResolutionfixed 
Product Version0.10.1 
Target Version0.11.0pre66Fixed in Version0.11.0pre66 
Summary0003995: undefined behavior in GNUNET_array_grow
DescriptionThis is nit-picky, but technically there is undefined behavior in GNUNET_array_grow, when 'size != 0' but the pointer is not NULL.

Should we try to be UndefinedBehaviorSanitizer-clean in general?
Steps To ReproduceCompile gnunet with -fsanitize=undefined and run something that sets up a testbed.
Additional Informationcommon_allocation.c:373:5: runtime error: null pointer passed as argument 2, which is declared to never be null
    #0 0x7f0830250829 in GNUNET_xgrow_ /home/dold/repos/gnunet/src/util/common_allocation.c:373
    #1 0x7f082fc37d78 in GNUNET_TESTBED_host_create_with_id /home/dold/repos/gnunet/src/testbed/testbed_api_hosts.c:347
    #2 0x7f082fc37faa in GNUNET_TESTBED_host_create /home/dold/repos/gnunet/src/testbed/testbed_api_hosts.c:374
    #3 0x7f082fc67127 in GNUNET_TESTBED_run /home/dold/repos/gnunet/src/testbed/testbed_api_testbed.c:1280
    #4 0x7f082fc68eec in run /home/dold/repos/gnunet/src/testbed/testbed_api_test.c:82
    #5 0x7f08302d9997 in program_main /home/dold/repos/gnunet/src/util/program.c:84
    #6 0x7f08302e6e6e in run_ready /home/dold/repos/gnunet/src/util/scheduler.c:587
    #7 0x7f08302e7c89 in GNUNET_SCHEDULER_run /home/dold/repos/gnunet/src/util/scheduler.c:868
    #8 0x7f08302dabdd in GNUNET_PROGRAM_run2 /home/dold/repos/gnunet/src/util/program.c:302
    #9 0x7f08302daea6 in GNUNET_PROGRAM_run /home/dold/repos/gnunet/src/util/program.c:341
    #10 0x7f082fc69461 in GNUNET_TESTBED_test_run /home/dold/repos/gnunet/src/testbed/testbed_api_test.c:151
    #11 0x40352d in run /home/dold/repos/gnunet/src/consensus/gnunet-consensus-profiler.c:421
    #12 0x7f08302dac13 in GNUNET_PROGRAM_run2 /home/dold/repos/gnunet/src/util/program.c:307
    #13 0x4035c7 in main /home/dold/repos/gnunet/src/consensus/gnunet-consensus-profiler.c:457
    #14 0x7f082cbc560f in __libc_start_main (/usr/lib/
    #15 0x401b28 in _start (/home/dold/repos/gnunet/src/consensus/.libs/lt-gnunet-consensus-profiler+0x401b28)
TagsNo tags attached.


Florian Dold

2015-09-28 22:47

developer   ~0009658

Fixed in r36384 (trivial fix, just add a NULL check)

Christian Grothoff

2015-09-28 23:06

manager   ~0009659

Well, I must admit I personally don't care about bogus warnings where we memcpy exactly 0 bytes from a NULL pointer, but if it makes you/gcc/libc happier...

Issue History

Date Modified Username Field Change
2015-09-28 22:37 Florian Dold New Issue
2015-09-28 22:37 Florian Dold Status new => assigned
2015-09-28 22:37 Florian Dold Assigned To => Christian Grothoff
2015-09-28 22:47 Florian Dold Note Added: 0009658
2015-09-28 22:47 Florian Dold Status assigned => feedback
2015-09-28 23:06 Christian Grothoff Note Added: 0009659
2015-09-28 23:06 Christian Grothoff Status feedback => resolved
2015-09-28 23:06 Christian Grothoff Fixed in Version => 0.11.0pre66
2015-09-28 23:06 Christian Grothoff Resolution open => fixed
2015-09-28 23:07 Christian Grothoff Product Version => 0.10.1
2015-09-28 23:07 Christian Grothoff Target Version SVN HEAD => 0.11.0pre66
2018-06-07 00:24 Christian Grothoff Status resolved => closed