I noticed every time I close xow with CTRL+C (when running from cli) there is a segfault:
ddragic:pts/1:xow $ ./xow
2020-04-11 14:03:28 INFO - xow v0.4-9-g7675112 ©Severin v. W.
2020-04-11 14:03:30 DEBUG - Opening device...
2020-04-11 14:03:30 INFO - Dongle plugged in
2020-04-11 14:03:30 DEBUG - Firmware loaded
2020-04-11 14:03:31 DEBUG - ASIC version: 7632
2020-04-11 14:03:31 DEBUG - MAC version: 7662
2020-04-11 14:03:31 DEBUG - Chip id: 7613
2020-04-11 14:03:31 INFO - Wireless address: 62:45:b5:01:9a:09
2020-04-11 14:03:31 INFO - Dongle initialized
2020-04-11 14:03:34 DEBUG - Client associating: 7e:ed:8c:1c:8f:74
2020-04-11 14:03:34 INFO - Controller '1' connected
2020-04-11 14:03:34 INFO - Product ID: 02ea
2020-04-11 14:03:34 DEBUG - Firmware version: 3.1.1221.0
2020-04-11 14:03:34 DEBUG - Hardware version: 1284.1.1.1
2020-04-11 14:03:35 INFO - Serial number: 03600079292806
2020-04-11 14:03:38 DEBUG - Battery type: 1, level: 2
2020-04-11 14:03:58 DEBUG - Battery type: 1, level: 2
^C2020-04-11 14:03:59 DEBUG - Stop signal received
2020-04-11 14:03:59 DEBUG - Closing device...
2020-04-11 14:03:59 INFO - Dongle power-off
xow: io.c:2116: handle_events: Assertion `ctx->pollfds_cnt >= internal_nfds' failed.
Segmentation fault (core dumped)
Sometimes the last line is Aborted (core dumped)
instead of Segmentation fault.
Everything seems to power down correctly, the controller turns off and so does the adapter (light goes out), but it always segfaults.
This is on Fedora 31 x64 with libusbx-1.0.22-4.fc31.
gdb backtrace:
#0 discard_urbs (itransfer=itransfer@entry=0x7f9194002fb0, first=first@entry=0, last_plus_one=1) at os/linux_usbfs.c:1830
#1 0x00007f91a1a8b7ed in op_cancel_transfer (itransfer=0x7f9194002fb0) at os/linux_usbfs.c:2256
#2 0x00007f91a1a890d9 in libusb_cancel_transfer (transfer=<optimized out>) at io.c:1572
#3 0x00007f91a1a8b03d in sync_transfer_wait_for_completion (transfer=transfer@entry=0x7f9194003020) at sync.c:57
#4 0x00007f91a1a8b10b in do_sync_bulk_transfer (dev_handle=0x7f919c000de0, endpoint=<optimized out>, buffer=buffer@entry=0x7f919bffeca0 "\006", length=length@entry=512,
transferred=transferred@entry=0x7f919bffec5c, timeout=timeout@entry=0, type=2 '\002') at sync.c:191
#5 0x00007f91a1a8b423 in libusb_bulk_transfer (dev_handle=<optimized out>, endpoint=<optimized out>, data=data@entry=0x7f919bffeca0 "\006", length=length@entry=512,
transferred=transferred@entry=0x7f919bffec5c, timeout=timeout@entry=0) at sync.c:273
#6 0x0000000000410059 in UsbDevice::bulkRead (this=this@entry=0x7ffe9fe69980, endpoint=endpoint@entry=5 '\005', buffer=...) at /usr/include/c++/9/array:234
#7 0x000000000040c76d in Mt76::readBulkPackets (this=0x7ffe9fe69980, endpoint=5 '\005') at dongle/mt76.cpp:950
#8 0x000000000040c806 in std::__invoke_impl<void, void (Mt76::*)(unsigned char), Mt76*, int> (__t=<optimized out>, __f=<optimized out>)
at /usr/include/c++/9/bits/invoke.h:89
#9 std::__invoke<void (Mt76::*)(unsigned char), Mt76*, int> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
#10 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
#11 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
#12 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> > >::_M_run (this=<optimized out>)
at /usr/include/c++/9/thread:195
#13 0x00007f91a1cb83d4 in execute_native_thread_routine () from /lib64/libstdc++.so.6
#14 0x00007f91a1a664e2 in start_thread () from /lib64/libpthread.so.0
#15 0x00007f91a197b6a3 in clone () from /lib64/libc.so.6
gdb backtrace full:
#0 discard_urbs (itransfer=itransfer@entry=0x7f9194002fb0, first=first@entry=0, last_plus_one=1) at os/linux_usbfs.c:1830
transfer = 0x7f9194003020
tpriv = 0x7f9194003060
dpriv = 0x50
i = 0
ret = 0
urb = 0x7f9194002770
__FUNCTION__ = "discard_urbs"
#1 0x00007f91a1a8b7ed in op_cancel_transfer (itransfer=0x7f9194002fb0) at os/linux_usbfs.c:2256
tpriv = 0x7f9194003060
transfer = 0x7f9194003020
r = <optimized out>
#2 0x00007f91a1a890d9 in libusb_cancel_transfer (transfer=<optimized out>) at io.c:1572
itransfer = <optimized out>
r = <optimized out>
__FUNCTION__ = "libusb_cancel_transfer"
#3 0x00007f91a1a8b03d in sync_transfer_wait_for_completion (transfer=transfer@entry=0x7f9194003020) at sync.c:57
r = <optimized out>
completed = 0x7f919bffeb84
ctx = 0x22413a0
__FUNCTION__ = "sync_transfer_wait_for_completion"
#4 0x00007f91a1a8b10b in do_sync_bulk_transfer (dev_handle=0x7f919c000de0, endpoint=<optimized out>, buffer=buffer@entry=0x7f919bffeca0 "\006", length=length@entry=512,
transferred=transferred@entry=0x7f919bffec5c, timeout=timeout@entry=0, type=2 '\002') at sync.c:191
transfer = 0x7f9194003020
completed = 0
r = 0
__FUNCTION__ = "do_sync_bulk_transfer"
#5 0x00007f91a1a8b423 in libusb_bulk_transfer (dev_handle=<optimized out>, endpoint=<optimized out>, data=data@entry=0x7f919bffeca0 "\006", length=length@entry=512,
transferred=transferred@entry=0x7f919bffec5c, timeout=timeout@entry=0) at sync.c:273
No locals.
#6 0x0000000000410059 in UsbDevice::bulkRead (this=this@entry=0x7ffe9fe69980, endpoint=endpoint@entry=5 '\005', buffer=...) at /usr/include/c++/9/array:234
transferred = 0
error = <optimized out>
#7 0x000000000040c76d in Mt76::readBulkPackets (this=0x7ffe9fe69980, endpoint=5 '\005') at dongle/mt76.cpp:950
packet = {data = std::vector of length 528, capacity 528 = {176 '\260', 20 '\024', 0 '\000', 148 '\224', 145 '\221', 127 '\177', 0 '\000', 0 '\000', 208 '\320',
8 '\b', 0 '\000', 148 '\224', 145 '\221', 127 '\177', 0 '\000', 0 '\000', 201 '\311', 200 '\310', 170 '\252', 2 '\002', 64 '@', 166 '\246', 164 '\244',
165 '\245', 0 '\000', 100 'd', 201 '\311', 200 '\310', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 136 '\210', 17 '\021',
160 '\240', 0 '\000', 98 'b', 69 'E', 181 '\265', 1 '\001', 154 '\232', 9 '\t', 126 '~', 237 '\355', 140 '\214', 28 '\034', 143 '\217', 116 't', 98 'b',
69 'E', 181 '\265', 1 '\001', 154 '\232', 9 '\t', 32 ' ', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 32 ' ', 1 '\001', 4 '\004', 134 '\206',
1 '\001', 0 '\000', 0 '\000', 68 'D', 0 '\000', 192 '\300', 74 'J', 55 '7', 57 '9', 50 '2', 57 '9', 50 '2', 56 '8', 48 '0', 54 '6', 80 'P', 0 '\000',
192 '\300', 74 'J', 4 '\004', 5 '\005', 1 '\001', 0 '\000', 1 '\001', 0 '\000', 1 '\001', 0 '\000', 92 '\\', 0 '\000', 192 '\300', 74 'J', 13 '\r', 103 'g',
1 '\001', 153 '\231', 231 '\347', 0 '\000', 0 '\000', 0 '\000', 4 '\004', 0 '\000', 0 '\000', 0 '\000', 37 '%', 99 'c', 1 '\001', 157 '\235', 231 '\347',
0 '\000', 0 '\000', 0 '\000', 4 '\004', 0 '\000', 0 '\000', 0 '\000', 37 '%', 99 'c', 1 '\001', 161 '\241', 240 '\360', 0 '\000', 0 '\000', 0 '\000', 40 '(',
2 '\002', 0 '\000', 0 '\000', 132 '\204', 128 '\200', 160 '\240', 74 'J', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000'...}}
--Type <RET> for more, q to quit, c to continue without paging--
buffer = {data = {
_M_elems = "\006\000`J\003\000\002\000\001H\000\000\006\000`J\311Ȫ\002@\246\244\245\000d\311\310\000\000\000\000\000\000\000\000\210\021\240\000bE\265\001\232\t~\355\214\034\217tbE\265\001\232\t \000\000\000\000\000\003 \001\004\206\001\000\000D\000\300J79292806P\000\300J\004\005\001\000\001\000\001\000\\\000\300J\rg\001\231\347\000\000\000\004\000\000\000%c\001\235\347\000\000\000\004\000\000\000%c\001\241\360\000\000\000(\002\000\000\204\200\240J", '\000' <repeats 371 times>}}
transferred = <optimized out>
#8 0x000000000040c806 in std::__invoke_impl<void, void (Mt76::*)(unsigned char), Mt76*, int> (__t=<optimized out>, __f=<optimized out>)
at /usr/include/c++/9/bits/invoke.h:89
No locals.
#9 std::__invoke<void (Mt76::*)(unsigned char), Mt76*, int> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#10 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
No locals.
#11 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
No locals.
#12 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> > >::_M_run (this=<optimized out>)
at /usr/include/c++/9/thread:195
No locals.
#13 0x00007f91a1cb83d4 in execute_native_thread_routine () from /lib64/libstdc++.so.6
No symbol table info available.
#14 0x00007f91a1a664e2 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#15 0x00007f91a197b6a3 in clone () from /lib64/libc.so.6
No symbol table info available.
gdb backtrace full for Aborted
case:
#0 0x00007f301f0d2625 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007f301f0bb8d9 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007f301f0bb7a9 in __assert_fail_base.cold () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007f301f0caa66 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007f301f2a5a70 in handle_events (ctx=ctx@entry=0x23c73a0, tv=<optimized out>, tv=<optimized out>) at io.c:2116
r = <optimized out>
ipollfd = <optimized out>
nfds = 0
internal_nfds = 2
fds = 0x0
i = -1
timeout_ms = <optimized out>
__FUNCTION__ = "handle_events"
__PRETTY_FUNCTION__ = "handle_events"
#5 0x00007f301f2a662c in libusb_handle_events_timeout_completed (ctx=ctx@entry=0x23c73a0, tv=tv@entry=0x7f301d05db10, completed=completed@entry=0x7f301d05db84)
at io.c:2348
r = <optimized out>
poll_timeout = {tv_sec = 60, tv_usec = 0}
__FUNCTION__ = "libusb_handle_events_timeout_completed"
#6 0x00007f301f2a66d4 in libusb_handle_events_completed (ctx=ctx@entry=0x23c73a0, completed=completed@entry=0x7f301d05db84) at io.c:2447
tv = {tv_sec = 60, tv_usec = 0}
#7 0x00007f301f2a7009 in sync_transfer_wait_for_completion (transfer=transfer@entry=0x7f3014002220) at sync.c:51
r = <optimized out>
completed = 0x7f301d05db84
ctx = 0x23c73a0
__FUNCTION__ = "sync_transfer_wait_for_completion"
#8 0x00007f301f2a710b in do_sync_bulk_transfer (dev_handle=0x7f3018000de0, endpoint=<optimized out>, buffer=buffer@entry=0x7f301d05dca0 "d", length=length@entry=512,
transferred=transferred@entry=0x7f301d05dc5c, timeout=timeout@entry=0, type=2 '\002') at sync.c:191
transfer = 0x7f3014002220
completed = 0
r = 0
__FUNCTION__ = "do_sync_bulk_transfer"
#9 0x00007f301f2a7423 in libusb_bulk_transfer (dev_handle=<optimized out>, endpoint=<optimized out>, data=data@entry=0x7f301d05dca0 "d", length=length@entry=512,
transferred=transferred@entry=0x7f301d05dc5c, timeout=timeout@entry=0) at sync.c:273
No locals.
#10 0x0000000000410059 in UsbDevice::bulkRead (this=this@entry=0x7ffeb051d0b0, endpoint=endpoint@entry=4 '\004', buffer=...) at /usr/include/c++/9/array:234
transferred = 0
error = <optimized out>
#11 0x000000000040c76d in Mt76::readBulkPackets (this=0x7ffeb051d0b0, endpoint=4 '\004') at dongle/mt76.cpp:950
packet = {data = std::vector of length 620, capacity 620 = {0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 208 '\320', 8 '\b',
0 '\000', 20 '\024', 48 '0', 127 '\177', 0 '\000', 0 '\000', 193 '\301', 199 '\307', 163 '\243', 2 '\002', 64 '@', 173 '\255', 149 '\225', 149 '\225',
0 '\000', 82 'R', 193 '\301', 199 '\307', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 136 '\210', 17 '\021', 60 '<',
0 '\000', 98 'b', 69 'E', 181 '\265', 1 '\001', 154 '\232', 9 '\t', 126 '~', 237 '\355', 140 '\214', 28 '\034', 143 '\217', 116 't', 96 '`', 69 'E',
181 '\265', 1 '\001', 154 '\232', 9 '\t', 16 '\020', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 3 '\003', 32 ' ', 1 '\001', 35 '#', 134 '\206',
--Type <RET> for more, q to quit, c to continue without paging--
3 '\003', 0 '\000', 0 '\000', 2 '\002', 3 '\003', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 1 '\001',
0 '\000', 2 '\002', 1 '\001', 11 '\v', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 100 'd', 0 '\000', 8 '\b', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000',
0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000', 0 '\000'...}}
buffer = {data = {
_M_elems = "d\000\b\000\222`\000\000\001HA\000\020\000\a@\301ǣ\002@\255\225\225\000R\301\307\000\000\000\000\000\000\000\000\210\021<\000bE\265\001\232\t~\355\214\034\217t`E\265\001\232\t\020\000\000\000\000\000\003 \001#\206\003\000\000\002\003\000\000\000\000\000\000\000\000\000\001\000\002\001\v", '\000' <repeats 16 times>, "d\000\b", '\000' <repeats 404 times>}}
transferred = <optimized out>
#12 0x000000000040c806 in std::__invoke_impl<void, void (Mt76::*)(unsigned char), Mt76*, int> (__t=<optimized out>, __f=<optimized out>)
at /usr/include/c++/9/bits/invoke.h:89
No locals.
#13 std::__invoke<void (Mt76::*)(unsigned char), Mt76*, int> (__fn=<optimized out>) at /usr/include/c++/9/bits/invoke.h:95
No locals.
#14 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::_M_invoke<0ul, 1ul, 2ul> (this=<optimized out>) at /usr/include/c++/9/thread:244
No locals.
#15 std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> >::operator() (this=<optimized out>) at /usr/include/c++/9/thread:251
No locals.
#16 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (Mt76::*)(unsigned char), Mt76*, int> > >::_M_run (this=<optimized out>)
at /usr/include/c++/9/thread:195
No locals.
#17 0x00007f301f4d43d4 in execute_native_thread_routine () from /lib64/libstdc++.so.6
No symbol table info available.
#18 0x00007f301f2824e2 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
#19 0x00007f301f1976a3 in clone () from /lib64/libc.so.6
No symbol table info available.
I hope some of this is helpful.