'make check' fails in CentOS
nxtreaming opened this issue · 4 comments
The latest git version
make check
........
........
PASS: tests/choose
PASS: tests/sleep
PASS: tests/fdwait
lt-tcp: tests/tcp.c:78: main: Assertion `extension ({ size_t **s1_len, __s2_len; (_builtin_constant_p (mill_ipaddrstr(addr, ipstr)) && __builtin_constant_p ("127.0.0.1") && (_s1_len = strlen (mill_ipaddrstr(addr, ipstr)), s2_len = strlen ("127.0.0.1"), (!((size_t)(const void *)((mill_ipaddrstr(addr, ipstr)) + 1) - (size_t)(const void *)(mill_ipaddrstr(addr, ipstr)) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("127.0.0.1") + 1) - (size_t)(const void *)("127.0.0.1") == 1) || __s2_len >= 4)) ? builtin_strcmp (mill_ipaddrstr(addr, ipstr), "127.0.0.1") : (builtin_constant_p (mill_ipaddrstr(addr, ipstr)) && ((size_t)(const void *)((mill_ipaddrstr(addr, ipstr)) + 1) - (size_t)(const void *)(mill_ipaddrstr(addr, ipstr)) == 1) && (_s1_len = strlen (mill_ipaddrstr(addr, ipstr)), __s1_len < 4) ? (__builtin_constant_p ("127.0.0.1") && ((size_t)(const void )(("127.0.0.1") + 1) - (size_t)(const void )("127.0.0.1") == 1) ? _builtin_strcmp (mill_ipaddrstr(addr, ipstr), "127.0.0.1") : (__extension ({ **const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("127.0.0.1"); register int __result = (((__const unsigned char *) (_const char *) (mill_ipaddrstr(addr, ipstr)))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (_const char *) (mill_ipaddrstr(addr, ipstr)))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (_const char *) (mill_ipaddrstr(addr, ipstr)))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (_const char *) (mill_ipaddrstr(addr, ipstr)))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("127.0.0.1") && ((size_t)(const void )(("127.0.0.1") + 1) - (size_t)(const void )("127.0.0.1") == 1) && (__s2_len = strlen ("127.0.0.1"), _s2_len < 4) ? (builtin_constant_p (mill_ipaddrstr(addr, ipstr)) && ((size_t)(const void *)((mill_ipaddrstr(addr, ipstr)) + 1) - (size_t)(const void *)(mill_ipaddrstr(addr, ipstr)) == 1) ? _builtin_strcmp (mill_ipaddrstr(addr, ipstr), "127.0.0.1") : (__extension ({ __const unsigned char *__s1 = (__const unsigned char *) (_const char *) (mill_ipaddrstr(addr, ipstr)); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[3]); } } __result; }))) : _builtin_strcmp (mill_ipaddrstr(addr, ipstr), "127.0.0.1")))); }) == 0' failed.
/bin/sh: line 5: 6694 已放弃 (core dumped) ${dir}$tst
FAIL: tests/tcp
lt-udp: tests/udp.c:58: main: Assertion `extension ({ size_t **s1_len, __s2_len; (__builtin_constant_p (ipstr) && __builtin_constant_p ("127.0.0.1") && (__s1_len = strlen (ipstr), __s2_len = strlen ("127.0.0.1"), (!((size_t)(const void *)((ipstr) + 1) - (size_t)(const void *)(ipstr) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("127.0.0.1") + 1) - (size_t)(const void *)("127.0.0.1") == 1) || __s2_len >= 4)) ? __builtin_strcmp (ipstr, "127.0.0.1") : (__builtin_constant_p (ipstr) && ((size_t)(const void *)((ipstr) + 1) - (size_t)(const void *)(ipstr) == 1) && (__s1_len = strlen (ipstr), __s1_len < 4) ? (__builtin_constant_p ("127.0.0.1") && ((size_t)(const void )(("127.0.0.1") + 1) - (size_t)(const void )("127.0.0.1") == 1) ? __builtin_strcmp (ipstr, "127.0.0.1") : (__extension ({ **const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("127.0.0.1"); register int __result = (((__const unsigned char *) (__const char *) (ipstr))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ipstr))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (ipstr))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (ipstr))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("127.0.0.1") && ((size_t)(const void *)(("127.0.0.1") + 1) - (size_t)(const void *)("127.0.0.1") == 1) && (__s2_len = strlen ("127.0.0.1"), __s2_len < 4) ? (__builtin_constant_p (ipstr) && ((size_t)(const void )((ipstr) + 1) - (size_t)(const void )(ipstr) == 1) ? __builtin_strcmp (ipstr, "127.0.0.1") : (__extension ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (ipstr); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("127.0.0.1"))[3]); } } __result; }))) : __builtin_strcmp (ipstr, "127.0.0.1")))); }) == 0' failed.
/bin/sh: line 5: 6715 已放弃 (core dumped) ${dir}$tst
FAIL: tests/udp
PASS: tests/unix
PASS: tests/signals
PASS: tests/overload
PASS: tests/ip
PASS: tests/file
PASS: tests/mfork1
PASS: tests/mfork2
PASS: tests/mfork3
2 of 17 tests failed
Wow, that's supposed to be expansion of strcmp and assert? That's atrocious.
Anyway, I don't have an CentOS box, so can you just have a look what the value of ipstr is after the call to ipaddrstr?
I debug the issue
Breakpoint 3, main () at tcp.c:79
79 assert(strcmp(ipstr, "127.0.0.1") == 0);
(gdb) p ipstr
$2 = "192.168.14.1", '\000' <repeats 12 times>"\360, J\334\367\377\177\000\000\001", '\000' <repeats 12 times>
(gdb)
my computer is configured by following:
[root@localhost tests]# ifconfig
em1 Link encap:Ethernet HWaddr B0:83:FE:E6:CC:36
inet6 addr: fe80::b283:feff:fee6:cc36/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:70882286 errors:0 dropped:0 overruns:0 frame:0
TX packets:109460218 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16948064200 (15.7 GiB) TX bytes:141108519432 (131.4 GiB)
Interrupt:35
em2 Link encap:Ethernet HWaddr B0:83:FE:E6:CC:37
inet addr:192.168.14.1 Bcast:192.168.14.255 Mask:255.255.255.0
inet6 addr: fe80::b283:feff:fee6:cc37/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2374441764 errors:0 dropped:0 overruns:0 frame:0
TX packets:2058571346 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2485691111882 (2.2 TiB) TX bytes:1856800462037 (1.6 TiB)
Interrupt:38
em3 Link encap:Ethernet HWaddr B0:83:FE:E6:CC:38
inet6 addr: fe80::b283:feff:fee6:cc38/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:97790121 errors:0 dropped:0 overruns:0 frame:0
TX packets:123893721 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:68353452714 (63.6 GiB) TX bytes:121339069407 (113.0 GiB)
Interrupt:34
em4 Link encap:Ethernet HWaddr B0:83:FE:E6:CC:39
inet addr:203.8.8.8 Bcast:203.110.164.255 Mask:255.255.255.224
inet6 addr: fe80::b283:feff:fee6:cc39/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6536016572 errors:0 dropped:0 overruns:0 frame:0
TX packets:9827243939 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3158155083867 (2.8 TiB) TX bytes:12690358405488 (11.5 TiB)
Interrupt:36
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:4118796 errors:0 dropped:0 overruns:0 frame:0
TX packets:4118796 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1717431740 (1.5 GiB) TX bytes:1717431740 (1.5 GiB)
em2(192.168.14.1) is my intranet, em4 is my public IP address.
So the "assert(strcmp(ipaddrstr(addr, ipstr), "127.0.0.1") == 0);" is wrong!
Pleas reference #151