Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segfault in websocket test #1416

Closed
gdamore opened this issue Jan 21, 2021 · 4 comments
Closed

Segfault in websocket test #1416

gdamore opened this issue Jan 21, 2021 · 4 comments
Milestone

Comments

@gdamore
Copy link
Contributor

gdamore commented Jan 21, 2021

websocket test failure:

35/82 Test #35: nng.supplemental.websocket_test .............***Failed 0.79 sec
Test websocket stream wildcard:
websocket_test.c:36: Check nng_stream_listener_alloc(&l, "ws://127.0.0.1:0/test") succeeds... ok
websocket_test.c:38: Check nng_stream_listener_listen(l) succeeds... ok
websocket_test.c:43: Check nng_stream_listener_get(l, NNG_OPT_LOCADDR, &sa1, &sz) succeeds... ok
websocket_test.c:44: Check sz == sizeof(sa1)... ok
websocket_test.c:45: Check sa1.s_in.sa_port != 0... ok
websocket_test.c:46: Check sa1.s_family == NNG_AF_INET... ok
websocket_test.c:47: Check nuts_be32(sa1.s_in.sa_addr) == 0x7F000001u... ok
websocket_test.c:52: Check nng_stream_dialer_alloc(&d, uri) succeeds... ok
websocket_test.c:53: Check nng_aio_alloc(&daio, NULL, NULL) succeeds... ok
websocket_test.c:54: Check nng_aio_alloc(&laio, NULL, NULL) succeeds... ok
websocket_test.c:55: Check nng_aio_alloc(&aio1, NULL, NULL) succeeds... ok
websocket_test.c:56: Check nng_aio_alloc(&aio2, NULL, NULL) succeeds... ok
websocket_test.c:68: Check nng_aio_result(laio) succeeds... ok
websocket_test.c:69: Check nng_aio_result(daio) succeeds... ok
websocket_test.c:72: Check c1 != NULL... ok
websocket_test.c:73: Check c2 != NULL... ok
websocket_test.c:76: Check nng_stream_get_addr(c2, NNG_OPT_REMADDR, &sa2) succeeds... ok
websocket_test.c:77: Check sa1.s_family == sa2.s_family... ok
websocket_test.c:78: Check sa1.s_in.sa_addr == sa2.s_in.sa_addr... ok
websocket_test.c:79: Check sa1.s_in.sa_port == sa2.s_in.sa_port... ok
websocket_test.c:81: Check nng_stream_get_addr(c1, NNG_OPT_REMADDR, &sa1) succeeds... ok
websocket_test.c:82: Check nng_stream_get_addr(c2, NNG_OPT_LOCADDR, &sa2) succeeds... ok
websocket_test.c:83: Check sa1.s_family == sa2.s_family... ok
websocket_test.c:84: Check sa1.s_in.sa_addr == sa2.s_in.sa_addr... ok
websocket_test.c:85: Check sa1.s_in.sa_port == sa2.s_in.sa_port... ok
websocket_test.c:95: Check nng_aio_set_iov(aio1, 1, &iov) succeeds... ok
websocket_test.c:99: Check nng_aio_set_iov(aio2, 1, &iov) succeeds... ok
websocket_test.c:106: Check nng_aio_result(aio1) succeeds... ok
websocket_test.c:107: Check nng_aio_count(aio1) == 5... ok
websocket_test.c:109: Check nng_aio_result(aio2) succeeds... ok
websocket_test.c:110: Check nng_aio_count(aio2) == 5... ok
websocket_test.c:111: Check memcmp(buf1, buf2, 5) == 0... ok
SUCCESS: All conditions have passed.
Duration: 0.049140 secs

Test websocket conn properties:
ThreadSanitizer:DEADLYSIGNAL
==18807==ERROR: ThreadSanitizer: SEGV on unknown address 0x000000000020 (pc 0x0000004e0a9e bp 0x7ffd438aea20 sp 0x7ffd438ae9b0 T18807)
==18807==The signal is caused by a READ memory access.
==18807==Hint: address points to the zero page.
#0 nni_stream_get /home/runner/work/nng/nng/build/../src/core/stream.c:132:13 (websocket_test+0x4e0a9d)
#1 nng_stream_get_addr /home/runner/work/nng/nng/build/../src/core/stream.c:336:10 (websocket_test+0x4e1923)
#2 test_websocket_conn_props /home/runner/work/nng/nng/build/../src/supplemental/websocket/websocket_test.c:167:2 (websocket_test+0x4b9875)
#3 test_do_run_ /home/runner/work/nng/nng/build/../src/testing/acutest.h:1026:9 (websocket_test+0x4be396)
#4 test_run_ /home/runner/work/nng/nng/build/../src/testing/acutest.h:1122:23 (websocket_test+0x4b7bf6)
#5 main /home/runner/work/nng/nng/build/../src/testing/acutest.h:1724:13 (websocket_test+0x4b5284)
#6 __libc_start_main (libc.so.6+0x21bf6)
#7 _start (websocket_test+0x41d519)

ThreadSanitizer can not provide additional info.
SUMMARY: ThreadSanitizer: SEGV /home/runner/work/nng/nng/build/../src/core/stream.c:132:13 in nni_stream_get
==18807==ABORTING
ERROR: Unexpected exit code [66]

@gdamore gdamore added this to the v1.4 milestone Jan 21, 2021
@gdamore
Copy link
Contributor Author

gdamore commented Jan 21, 2021

This specific panic seems hard to understand, because of the test at websocket_test.c:164 -- the stream pointer should not be NULL, but it looks for all the world like it is NULL in this test failure.

@gdamore
Copy link
Contributor Author

gdamore commented Jan 25, 2021

I suspect other corruption elsewhere. I could understand if the function pointer was NULL, but not the handle itself.

@gdamore
Copy link
Contributor Author

gdamore commented Jan 25, 2021

I haven't seen this one again. I'm not going to hold 1.4 for it.

@gdamore gdamore modified the milestones: v1.4, v1.5 Jan 25, 2021
@gdamore
Copy link
Contributor Author

gdamore commented Aug 23, 2021

Have not seen this one since this instance. I'm tempted to close it as not-reproducible.

@gdamore gdamore closed this as completed Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant