Even though the discussion points that the issue should be solved with the curl version 7.32, I was getting the crash even with curl version of 7.52-DEV on ubuntu 18.04 with gazebo.
A backtrace of the crash on running gazebo with gdb:
*** longjmp causes uninitialized stack frame ***: /home/$USER/gazebo-11.8.1/bin/gzclient terminated
Thread 1 "gzclient" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) backtrace
#0 0x00007ffff5397fb7 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff5399921 in __GI_abort () at abort.c:79
#2 0x00007ffff53e2967 in __libc_message (action=action@entry=(do_abort | do_backtrace), fmt=fmt@entry=0x7ffff550f8fb "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:181
#3 0x00007ffff548db8f in __GI___fortify_fail_abort (need_backtrace=need_backtrace@entry=true, msg=0x7ffff550f8b0 <longjmp_msg> "longjmp causes uninitialized stack frame") at fortify_fail.c:33
#4 0x00007ffff548dbb1 in __GI___fortify_fail (msg=<optimized out>) at fortify_fail.c:44
#5 0x00007ffff548da4d in ____longjmp_chk () at ../sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S:100
#6 0x00007ffff548d9ab in __longjmp_chk (env=0x7ffff012fb40 <curl_jmpenv>, val=<optimized out>)
at ../setjmp/longjmp.c:39
#7 0x00007fffefec8745 in () at /usr/local/lib/libcurl.so
#8 0x00007ffff5398040 in <signal handler called> () at /lib/x86_64-linux-gnu/libc.so.6
#9 0x00007ffff546dcb9 in __GI___poll (fds=0x555559cbe2f0, nfds=4, timeout=7)
at ../sysdeps/unix/sysv/linux/poll.c:29
#10 0x00007fffed4c56e9 in () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007fffed4c57fc in g_main_context_iteration () at /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff694a88f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#13 0x00007ffff68ef90a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#14 0x00007ffff68f89b4 in QCoreApplication::exec() () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#15 0x00007ffff725a856 in gazebo::gui::run(int, char**) (_argc=<optimized out>, _argv=0x7fffffffb4a8)
at /home/$USER/gazebo-11.8.1/source/gazebo/gui/GuiIface.cc:442
#16 0x00005555555579f4 in main(int, char**) (_argc=1, _argv=0x7fffffffb4a8)
at /home/$USER/gazebo-11.8.1/source/gazebo/gui/main.cc:32
Looking closely at the crash, libcurl.so
was accessed in frame #7
and then the crash happened eventually (frames #6
to #0
)
This crash usually happens within 15 minutes of running gazebo, even when the program is left running idle with an empty simulation, i.e., no model loaded in the simulation and no computation happening, just the gazebo client (gzclient
) running by itself with gazebo server (gzserver
) running on another shell
On checking the curl version ( using curl --version
) in my ubuntu system I get
curl 7.52.1-DEV (Linux) libcurl/7.52.1-DEV OpenSSL/1.0.2n zlib/1.2.11
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: IPv6 Largefile NTLM SSL libz UnixSockets HTTPS-proxy
The curl version above is clearly higher than 7.32 but I still get the crash.
Test with curl
I removed the curl shipped by default with ubuntu 18.04 LTS and installed the latest curl ( version 7.79.1 as of 17.09.2021) from source :
git clone https://github.com/curl/curl.git
cd curl
./buildconf
./configure --with-{dict,file,ftp,ftps,gopher,gophers,http,https,imap,imaps,mqtt,pop3,pop3s,rtsp,smb,smbs,smtp,smtps,telnet,tftp}
make
sudo make install
sudo ldconfig
After this I again ran my program and left it running overnight, this time with a simulation doing computation in a loop, for more than 15 hours and in the morning the simulation was running.
So for me the problem of gazebo crashing seems solved with new version of curl.