Actions
Bug #4700
open'socket' C test fails when there is no IPv6
Start date:
08/09/2020
Due date:
% Done:
0%
Spec Reference:
Description
When building libosmocore (I did inside the ttcn3-tests docker container 'nonjenkins-bsc'), make check may fail the socket.c test;
when I revert this patch, the error no longer happens:
osmo_sock_init2: improve support for AF_UNSPEC 2c962f5de1eeea119cfac7d9d92db31c570353b9 I397c633931fd00d4f083955a3c49a40fb002d766
This is the test failure output:
49: socket FAILED (testsuite.at:313)
# -*- compilation -*- 49. testsuite.at:308: testing socket ... ../../../src/libosmocore/tests/testsuite.at:313: $abs_top_builddir/tests/socket/socket_test --- experr 2020-08-09 17:51:39.081588010 +0000 +++ /src/make/libosmocore/tests/testsuite.dir/at-groups/49/stderr 2020-08-09 17:51:39.093588179 +0000 @@ -2,3 +2,7 @@ invalid: you have to specify either BIND or CONNECT flags Unable to find a common protocol (IPv4 or IPv6) for local host: 127.0.0.1 and remote host: ::1. Unable to find a common protocol (IPv4 or IPv6) for local host: ::1 and remote host: 127.0.0.1. +unable to bind socket: ::1:0: Cannot assign requested address +no suitable local addr found for: ::1:0 +Assert failed fd >= 0 ../../../src/libosmocore/tests/socket/socket_test.c:142 +/src/make/libosmocore/tests/testsuite.dir/at-groups/49/test-source: line 27: 20251 Aborted $abs_top_builddir/tests/socket/socket_test --- expout 2020-08-09 17:51:39.081588010 +0000 +++ /src/make/libosmocore/tests/testsuite.dir/at-groups/49/stdout 2020-08-09 17:51:39.089588123 +0000 @@ -9,3 +9,9 @@ Checking osmo_sock_init2(AF_UNSPEC) must fail on mixed IPv6 & IPv4 Checking osmo_sock_init2(AF_UNSPEC) BIND + CONNECT on IPv4 Checking osmo_sock_init2(AF_UNSPEC) BIND + CONNECT on IPv6 +backtrace() returned 6 addresses +/src/make/libosmocore/src/.libs/libosmocore.so.12(+0xdda0b) [0x7f89ded74a0b] +/src/make/libosmocore/src/.libs/libosmocore.so.12(osmo_panic+0x14b) [0x7f89ded7491b] +/src/make/libosmocore/tests/socket/socket_test(+0x1cc8) [0x558ed77eccc8] +/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1) [0x7f89dd7d02e1] +/src/make/libosmocore/tests/socket/socket_test(+0x1eda) [0x558ed77eceda] ../../../src/libosmocore/tests/testsuite.at:313: exit code was 134, expected 0 49. testsuite.at:308: 49. socket (testsuite.at:308): FAILED (testsuite.at:313)
Actions