ser2net: gensio.c:2667: gensio_list_add_tail: Assertion failed
Hi,
I successfully built the latest ser2net on a Raspberry Pi, but when I tried to run it it aborts with this error:
ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed.
I have tried this on a pi4 running the latest OS (2021-01-11-raspios-buster-armhf), and on a pi3B running an older OS.
According to strace, the ser2net configuration file is never opened.
I'm not sure if this is useful: the abort happens right after ser2net talks to DBUS: send - "AUTH EXTERNAL 31303030" read - "OK fa4443262b67f5cb6c32a80b60462" send - "NEGOTIATE_UNIX_FD" read - "AGREE_UNIX_FD" send - "BEGIN"
Last few lines of strace output:
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 6 connect(6, {sa_family=AF_UNIX, sun_path="/var/run/dbus/system_bus_socket"}, 33) = 0 fcntl64(6, F_GETFL) = 0x2 (flags O_RDWR) fcntl64(6, F_SETFL, O_RDWR|O_NONBLOCK) = 0 geteuid32() = 1000 getsockname(6, {sa_family=AF_UNIX}, [128->2]) = 0 poll([{fd=6, events=POLLOUT}], 1, 0) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "\0", 1, MSG_NOSIGNAL) = 1 send(6, "AUTH EXTERNAL 31303030\r\n", 24, MSG_NOSIGNAL) = 24 poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6, revents=POLLIN}]) read(6, "OK fa4443262b67f5cb6c32a80b60462"..., 2048) = 37 poll([{fd=6, events=POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "NEGOTIATE_UNIX_FD\r\n", 19, MSG_NOSIGNAL) = 19 poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6, revents=POLLIN}]) read(6, "AGREE_UNIX_FD\r\n", 2048) = 15 poll([{fd=6, events=POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "BEGIN\r\n", 7, MSG_NOSIGNAL) = 7 poll([{fd=6, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) sendmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\0\25\0\0\0/org/fre"..., iov_len=128}, {iov_base="", iov_len=0}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 128 clock_gettime(CLOCK_MONOTONIC, {tv_sec=536, tv_nsec=962047310}) = 0 poll([{fd=6, events=POLLIN}], 1, 25000) = 1 ([{fd=6, revents=POLLIN}]) recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\2\1\1\n\0\0\0\1\0\0\0=\0\0\0\6\1s\0\5\0\0\0:1.25\0\0\0"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 260 recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable) write(2, "ser2net: gensio.c:2667: gensio_l"..., 129ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. ) = 129 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fe3000 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0 getpid() = 12191 gettid() = 12191 tgkill(12191, 12191, SIGABRT) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=12191, si_uid=1000} --- +++ killed by SIGABRT +++
On Mon, Mar 08, 2021 at 06:10:26AM -0800, Will Scales wrote:
Hi,
I successfully built the latest ser2net on a Raspberry Pi, but when I tried to run it it aborts with this error:
"Latest Version" is not really very helpful, it depends on if you compiled it yourself, if not what OS, etc. Can you give a version of ser2net and the gensio library?
ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed.
I have tried this on a pi4 running the latest OS (2021-01-11-raspios-buster-armhf), and on a pi3B running an older OS.
According to strace, the ser2net configuration file is never opened.
Yeah, this is mdns stuff happening at startup. Can you give your ser2net.yaml file. And a traceback would be most helpful, if you can get that.
-corey
I'm not sure if this is useful: the abort happens right after ser2net talks to DBUS: send - "AUTH EXTERNAL 31303030" read - "OK fa4443262b67f5cb6c32a80b60462" send - "NEGOTIATE_UNIX_FD" read - "AGREE_UNIX_FD" send - "BEGIN"
Last few lines of strace output:
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 6 connect(6, {sa_family=AF_UNIX, sun_path="/var/run/dbus/system_bus_socket"}, 33) = 0 fcntl64(6, F_GETFL) = 0x2 (flags O_RDWR) fcntl64(6, F_SETFL, O_RDWR|O_NONBLOCK) = 0 geteuid32() = 1000 getsockname(6, {sa_family=AF_UNIX}, [128->2]) = 0 poll([{fd=6, events=POLLOUT}], 1, 0) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "\0", 1, MSG_NOSIGNAL) = 1 send(6, "AUTH EXTERNAL 31303030\r\n", 24, MSG_NOSIGNAL) = 24 poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6, revents=POLLIN}]) read(6, "OK fa4443262b67f5cb6c32a80b60462"..., 2048) = 37 poll([{fd=6, events=POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "NEGOTIATE_UNIX_FD\r\n", 19, MSG_NOSIGNAL) = 19 poll([{fd=6, events=POLLIN}], 1, -1) = 1 ([{fd=6, revents=POLLIN}]) read(6, "AGREE_UNIX_FD\r\n", 2048) = 15 poll([{fd=6, events=POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) send(6, "BEGIN\r\n", 7, MSG_NOSIGNAL) = 7 poll([{fd=6, events=POLLIN|POLLOUT}], 1, -1) = 1 ([{fd=6, revents=POLLOUT}]) sendmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\1\0\1\0\0\0\0\1\0\0\0n\0\0\0\1\1o\0\25\0\0\0/org/fre"..., iov_len=128}, {iov_base="", iov_len=0}], msg_iovlen=2, msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 128 clock_gettime(CLOCK_MONOTONIC, {tv_sec=536, tv_nsec=962047310}) = 0 poll([{fd=6, events=POLLIN}], 1, 25000) = 1 ([{fd=6, revents=POLLIN}]) recvmsg(6, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="l\2\1\1\n\0\0\0\1\0\0\0=\0\0\0\6\1s\0\5\0\0\0:1.25\0\0\0"..., iov_len=2048}], msg_iovlen=1, msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 260 recvmsg(6, {msg_namelen=0}, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable) write(2, "ser2net: gensio.c:2667: gensio_l"..., 129ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. ) = 129 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb6fe3000 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0 getpid() = 12191 gettid() = 12191 tgkill(12191, 12191, SIGABRT) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=12191, si_uid=1000} --- +++ killed by SIGABRT +++
-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/cminyard/ser2net/issues/47
I compiled it myself. Here are the exact steps I used:
cd git clone https://github.com/cminyard/gensio.git cd gensio/ sudo apt install gcc git swig python3-dev libssl-dev pkg-config libavahi-client-dev avahi-daemon libtool autoconf automake make libsctp-dev libpam-dev libwrap0-dev ./reconf ./configure make -j4 sudo make install sudo ldconfig cd git clone https://github.com/cminyard/ser2net.git cd ser2net/ ./reconf sudo apt install libyaml-dev ./configure make -j4 sudo make install sudo mkdir /usr/local/etc/ser2net sudo vi /usr/local/etc/ser2net/ser2net.yaml
Output:
pi@raspberrypi:~ $ ser2net -v ser2net version 4.3.3
pi@raspberrypi:~ $ ser2net -d ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
pi@raspberrypi:~ $ ser2net -d -c /usr/local/etc/ser2net/ser2net.yaml ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
pi@raspberrypi:~ $ sudo ser2net -d -c /usr/local/etc/ser2net/ser2net.yaml ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
How can I find the gensio library version? I am using the example yaml file from the ser2net README.rst
I will attempt to get a traceback.
My goal is to get the CTS/DTR stuff working (issue #46).
Thanks.
On Mon, Mar 08, 2021 at 07:33:18AM -0800, Will Scales wrote:
I compiled it myself. Here are the exact steps I used:
cd git clone https://github.com/cminyard/gensio.git cd gensio/ sudo apt install gcc git swig python3-dev libssl-dev pkg-config libavahi-client-dev avahi-daemon libtool autoconf automake make libsctp-dev libpam-dev libwrap0-dev ./reconf ./configure make -j4 sudo make install sudo ldconfig cd git clone https://github.com/cminyard/ser2net.git cd ser2net/ ./reconf sudo apt install libyaml-dev ./configure make -j4 sudo make install sudo mkdir /usr/local/etc/ser2net sudo vi /usr/local/etc/ser2net/ser2net.yaml
Output:
pi@raspberrypi:~ $ ser2net -v ser2net version 4.3.3
pi@raspberrypi:~ $ ser2net -d ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
pi@raspberrypi:~ $ ser2net -d -c /usr/local/etc/ser2net/ser2net.yaml ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
pi@raspberrypi:~ $ sudo ser2net -d -c /usr/local/etc/ser2net/ser2net.yaml ser2net: gensio.c:2667: gensio_list_add_tail: Assertion `link->list == NULL && link->next == NULL && link->prev == NULL' failed. Aborted
How can I find the gensio library version?
That's bleeding edge.
I am using the example yaml file from the ser2net README.rst
I will attempt to get a traceback.
My goal is to get the CTS/DTR stuff working (issue #46).
Ah, yes.
The master branch is moving pretty fast and obviously, have broken things. The 2.2.x branch is the stable one right now.
However, I would like to debug this. There is probably something on your network that is messing up the mdns code. A traceback will tell me at least which list has the issue.
To get a traceback, from the build directory, run
./libtool execute gdb --args ./ser2net -d run
Then when it crashes
bt
-corey
Thanks.
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/cminyard/ser2net/issues/47#issuecomment-792834976
Here's the traceback:
Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0xb6cf4230 in __GI_abort () at abort.c:79 #2 0xb6d01bb8 in __assert_fail_base (fmt=0xb6e086b0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0xb6f5dd90 "link->list == NULL && link->next == NULL && link->prev == NULL", assertion@entry=0xb6ff62d0 "", file=0xb6f5dacc "gensio.c", file@entry=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail", line=2683, line@entry=3068167856, function=function@entry=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail") at assert.c:92 #3 0xb6d01c6c in __GI___assert_fail (assertion=0xb6ff62d0 "", file=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail", line=3068167856, function=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail") at assert.c:101 #4 0xb6f045d4 in gensio_list_add_tail () from /usr/local/lib/libgensio.so.0 #5 0xb6f4d87c in gensio_avahi_timeout_new () from /usr/local/lib/libgensio.so.0 #6 0xb6edf23c in avahi_dbus_connection_glue () from /lib/arm-linux-gnueabihf/libavahi-client.so.3 #7 0xb6ed7378 in avahi_client_new () from /lib/arm-linux-gnueabihf/libavahi-client.so.3 #8 0xb6f4c744 in gensio_alloc_mdns () from /usr/local/lib/libgensio.so.0 #9 0x0001e0e4 in init_dataxfer () #10 0x0001ff44 in main ()
The line numbers in the traceback may not be correct because I added a few lines earlier to gensio.c in an attempt to get the backtrace() function to work
On Mon, Mar 08, 2021 at 08:18:52AM -0800, Will Scales wrote:
Here's the traceback:
Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0xb6cf4230 in __GI_abort () at abort.c:79 #2 0xb6d01bb8 in __assert_fail_base (fmt=0xb6e086b0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0xb6f5dd90 "link->list == NULL && link->next == NULL && link->prev == NULL", assertion@entry=0xb6ff62d0 "", file=0xb6f5dacc "gensio.c", file@entry=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail", line=2683, line@entry=3068167856, function=function@entry=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail") at assert.c:92 #3 0xb6d01c6c in __GI___assert_fail (assertion=0xb6ff62d0 "", file=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail", line=3068167856, function=0xb6f5e254 <PRETTY_FUNCTION.9509> "gensio_list_add_tail") at assert.c:101 #4 0xb6f045d4 in gensio_list_add_tail () from /usr/local/lib/libgensio.so.0 #5 0xb6f4d87c in gensio_avahi_timeout_new () from /usr/local/lib/libgensio.so.0
Well, that wasn't what I expected. I have a Pi, so I loaded it onto there and I was able to reproduce. It was a dumb mistake, zalloc wasn't zeroing memory in that configuration. I hadn't done extensive testing, so this hadn't been uncovered yet.
Anyway, change is pushed into git. You can use master, with the caveat that it is bleeding edge, or you can switch to the 2.2.x branch. Unless you need to develop in C++ or need to run on Windows, there is probably not a strong reason to use master.
-corey
#6 0xb6edf23c in avahi_dbus_connection_glue () from /lib/arm-linux-gnueabihf/libavahi-client.so.3 #7 0xb6ed7378 in avahi_client_new () from /lib/arm-linux-gnueabihf/libavahi-client.so.3 #8 0xb6f4c744 in gensio_alloc_mdns () from /usr/local/lib/libgensio.so.0 #9 0x0001e0e4 in init_dataxfer () #10 0x0001ff44 in main ()
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/cminyard/ser2net/issues/47#issuecomment-792870531
It is no longer aborting. Thank you!
I am using the bleeding edge branch because I need the recent CTS/DTR changes.
Edit: sorry I just noticed your earlier comment that RTS/DTR changes were also added to 2.2.x branch
On Mon, Mar 08, 2021 at 10:08:27AM -0800, Will Scales wrote:
It is no longer aborting. Thank you!
I am using the bleeding edge branch because I need the recent CTS/DTR changes.
Ah, I backported those to the 2.2.x branch.