View Issue Details

IDProjectCategoryView StatusLast Update
0005826libmicrohttpdbuild systempublic2019-08-28 09:12
ReporterTuxHandwerkerAssigned ToChristian Grothoff 
PrioritynormalSeverityminorReproducibilityalways
Status assignedResolutionopen 
PlatformX86_64OSCentOSOS Version7.6
Product Version0.9.66 
Target VersionFixed in Version 
Summary0005826: Software tests fails using gcc 8.3.1
Descriptionmake check will fail's with:
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src/include -I../../src/microhttpd -fvisibility=hidden -I/builddir/build/BUILD/gvm-helper-0.0.1/libassuan-2.5.3/src -I/builddir/build/BUILD/gvm-helper-0.0.1/libgpg-error-1.36/src -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fno-strict-aliasing -c -o test_md5.o test_md5.c
test_md5.c: In function 'test1_str':
test_md5.c:226:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units1_num; i++)
   ^
test_md5.c:226:3: note: use option -std=c99 or -std=gnu99 to compile your code
test_md5.c: In function 'test1_bin':
test_md5.c:243:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units2_num; i++)
   ^
test_md5.c: In function 'test2_str':
test_md5.c:261:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units1_num; i++)
   ^
test_md5.c: In function 'test2_bin':
test_md5.c:280:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units2_num; i++)
TagsNo tags attached.

Activities

TuxHandwerker

2019-08-13 09:29

reporter  

config.log (221,228 bytes)

TuxHandwerker

2019-08-13 09:41

reporter   ~0014781

set -std=c99 will allow to pass the test_md5 tests, but result later in an coredump:
PASS: test_str_compare
PASS: test_str_to_value
PASS: test_str_token
PASS: test_http_reasons
PASS: test_md5
PASS: test_sha256
PASS: test_start_stop
PASS: test_daemon
PASS: test_options
PASS: test_upgrade
../../build-aux/test-driver: line 107: 13539 Aborted (core dumped) "$@" > $log_file 2>&1
FAIL: test_upgrade_large
PASS: test_upgrade_tls
../../build-aux/test-driver: line 107: 13652 Aborted (core dumped) "$@" > $log_file 2>&1
FAIL: test_upgrade_large_tls
PASS: test_postprocessor
PASS: test_postprocessor_large
PASS: test_postprocessor_amp
PASS: test_shutdown_select
PASS: test_shutdown_poll

TuxHandwerker

2019-08-13 09:43

reporter   ~0014782

Hint: I added this patch, to build it.
https://git.gnunet.org/libmicrohttpd.git/commit/?id=b84ee1fa41c53c43aa7ed1583c36af5cb7c77a0f

Christian Grothoff

2019-08-24 00:06

manager   ~0014807

55618b10..8eae5667 fixes the c99 issues reported in test_md5.c.

Christian Grothoff

2019-08-24 00:08

manager   ~0014808

As for the crashes, Git master fixes some issues with respect to the upgrade_large tests -- could you please try if the latest version fixes those crashes? If not, a valgrind report or stack trace from gdb would be helpful...

TuxHandwerker

2019-08-26 09:44

reporter   ~0014809

test_sha256.c need also patching for gcc 8.1 without explicit set -std=c99 call:
test_sha256.c: In function 'test1_str':
test_sha256.c:251:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units1_num; i++)
   ^
test_sha256.c:251:3: note: use option -std=c99 or -std=gnu99 to compile your code
test_sha256.c: In function 'test1_bin':
test_sha256.c:268:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units2_num; i++)
   ^
test_sha256.c: In function 'test2_str':
test_sha256.c:286:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units1_num; i++)
   ^
test_sha256.c: In function 'test2_bin':
test_sha256.c:305:3: error: 'for' loop initial declarations are only allowed in C99 mode
   for (unsigned int i = 0; i < units2_num; i++)
   ^

TuxHandwerker

2019-08-26 10:00

reporter   ~0014810

The git master version of test_upgrade_large don't compile:
test_upgrade_large.c: In function 'run_usock':
test_upgrade_large.c:708:23: error: 'MHD_UPGRADE_ACTION_CORK_OFF' undeclared (first use in this function)
                       MHD_UPGRADE_ACTION_CORK_OFF);
                       ^
test_upgrade_large.c:708:23: note: each undeclared identifier is reported only once for each function it appears in
test_upgrade_large.c: In function 'kick_select':
test_upgrade_large.c:583:11: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
     write (kicker[1], "K", 1);
           ^
test_upgrade_large.c: In function 'run_mhd_select_loop':
test_upgrade_large.c:940:9: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
         (void) read (kicker[0], drain, sizeof (drain));
         ^
test_upgrade_large.c: In function 'run_mhd_epoll_loop':
test_upgrade_large.c:1012:9: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
         (void) read (kicker[0], drain, sizeof (drain));
         ^
make[3]: Leaving directory `/builddir/build/BUILD/gvm-helper-0.0.1/libmicrohttpd-0.9.66/src/microhttpd'
make[2]: Leaving directory `/builddir/build/BUILD/gvm-helper-0.0.1/libmicrohttpd-0.9.66/src/microhttpd'
make[3]: *** [test_upgrade_large-test_upgrade_large.o] Error 1
make[2]: *** [check-am] Error 2
make[1]: make[1]: Leaving directory `/builddir/build/BUILD/gvm-helper-0.0.1/libmicrohttpd-0.9.66/src'

Christian Grothoff

2019-08-26 11:17

manager   ~0014811

That's strange, can you try building using 'make install' instead of just 'make'?

TuxHandwerker

2019-08-26 11:31

reporter   ~0014812

It will only happens at the test stage called via "make check".
The normal build an install stage will work, but the test stage will fails.

Christian Grothoff

2019-08-27 15:20

manager   ~0014813

I can only imagine that somehow you have an 'old' version of microhttpd.h installed somewhere on your system, and somehow gcc finds that one before the one from src/include/. Please check your system for outdated 'microhttpd.h' files.

TuxHandwerker

2019-08-28 09:09

reporter   ~0014820

Today I tried the last git master version.
Because of note https://bugs.gnunet.org/view.php?id=5826#c14809, it must use "-std=c99" to build it.
But the tests are still fails with core dump.
For test_upgrade_large with:
(gdb) where
#0 0x00007f670e0f42c7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
#1 0x00007f670e0f59b8 in __GI_abort () at abort.c:90
#2 0x00005604c7f7ce45 in recv_hdr (sock=0x5604c9a61760) at test_upgrade_large.c:641
#3 run_usock_client (cls=0x5604c9a61760) at test_upgrade_large.c:736
#4 0x00007f670e492dd5 in start_thread (arg=0x7f670cc73700) at pthread_create.c:307
#5 0x00007f670e1bc02d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

TuxHandwerker

2019-08-28 09:12

reporter   ~0014821

(gdb) bt full:
#0 0x00007f670e0f42c7 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:55
        resultvar = 0
        pid = 14965
        selftid = 14984
#1 0x00007f670e0f59b8 in __GI_abort () at abort.c:90
        save_stage = 2
        act = {__sigaction_handler = {sa_handler = 0x7f670cc72e40, sa_sigaction = 0x7f670cc72e40}, sa_mask = {__val = {0, 0, 140080598064141, 0, 94578534766392, 39, 70368744177669, 16, 140080572739280,
              140080572739216, 94578534763353, 0, 140080598063773, 1, 140080572739303, 1}}, sa_flags = 5, sa_restorer = 0x801000}
        sigs = {__val = {32, 0 <repeats 15 times>}}
#2 0x00005604c7f7ce45 in recv_hdr (sock=0x5604c9a61760) at test_upgrade_large.c:641
        i = 0
        next = 13 '\r'
        c = 0 '\000'
        ret = -1
#3 run_usock_client (cls=0x5604c9a61760) at test_upgrade_large.c:736
        sock = 0x5604c9a61760
#4 0x00007f670e492dd5 in start_thread (arg=0x7f670cc73700) at pthread_create.c:307
        __res = <optimized out>
        pd = 0x7f670cc73700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140080572741376, -3442794773719681955, 0, 8392704, 0, 140080572741376, 3384074596664603741, 3384069150701253725}, mask_was_saved = 0}}, priv = {pad = {0x0,
              0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
#5 0x00007f670e1bc02d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Issue History

Date Modified Username Field Change
2019-08-13 09:29 TuxHandwerker New Issue
2019-08-13 09:29 TuxHandwerker File Added: config.log
2019-08-13 09:41 TuxHandwerker Note Added: 0014781
2019-08-13 09:43 TuxHandwerker Note Added: 0014782
2019-08-24 00:06 Christian Grothoff Note Added: 0014807
2019-08-24 00:08 Christian Grothoff Note Added: 0014808
2019-08-24 00:08 Christian Grothoff Assigned To => Christian Grothoff
2019-08-24 00:08 Christian Grothoff Status new => feedback
2019-08-26 09:44 TuxHandwerker Note Added: 0014809
2019-08-26 09:44 TuxHandwerker Status feedback => assigned
2019-08-26 10:00 TuxHandwerker Note Added: 0014810
2019-08-26 11:17 Christian Grothoff Note Added: 0014811
2019-08-26 11:31 TuxHandwerker Note Added: 0014812
2019-08-27 15:20 Christian Grothoff Note Added: 0014813
2019-08-28 09:09 TuxHandwerker Note Added: 0014820
2019-08-28 09:12 TuxHandwerker Note Added: 0014821