SIGABRT on exit
I have a ros2 component which is using external libraries. It is basically a wrapper which accesses the functions of the shared libraries and does certain further computations. The component is working fine however sometimes when I exit the node using ctrl-c or by implementing a rclcpp::shutdown I receive a SIGARBT error saying "corrupted size vs. prev size in fastbins". This does indicate being a memory issue and I have tried finding the problem using valgrind and gdb but I am unable to track.
I attach gdb with the component and let it run, I have recorded the backtrace and I see that eporisma::fastrtps is being called right after the exit and from my understanding there is where the issue lies.
corrupted size vs. prev_size in fastbins
Thread 1 "ai-muster" 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 0x00007ffff79b8859 in __GI_abort () at abort.c:79
#2 0x00007ffff7a2326e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff7b4d298 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3 0x00007ffff7a2b2fc in malloc_printerr (str=str@entry=0x7ffff7b4f2a8 "corrupted size vs. prev_size in fastbins") at malloc.c:5347
#4 0x00007ffff7a2bacc in malloc_consolidate (av=av@entry=0x7ffff7b82b80 <main_arena>) at malloc.c:4493
#5 0x00007ffff7a2cfe0 in _int_free (av=0x7ffff7b82b80 <main_arena>, p=0x555555664390, have_lock=<optimized out>) at malloc.c:4400
#6 0x00007ffff71b3059 in eprosima::fastrtps::types::TypeObjectFactory::~TypeObjectFactory() () from /opt/ros/foxy/lib/libfastrtps.so.2
#7 0x00007ffff71b3172 in eprosima::fastrtps::types::TypeObjectFactory::delete_instance() () from /opt/ros/foxy/lib/libfastrtps.so.2
#8 0x00007ffff71be932 in eprosima::fastrtps::types::TypeObjectFactoryReleaser::~TypeObjectFactoryReleaser() () from /opt/ros/foxy/lib/libfastrtps.so.2
#9 0x00007ffff79dc8a7 in __run_exit_handlers (status=0, listp=0x7ffff7b82718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#10 0x00007ffff79dca60 in __GI_exit (status=<optimized out>) at exit.c:139
#11 0x00007ffff79ba08a in __libc_start_main (main=0x555555558b08 <main(int, char**)>, argc=4, argv=0x7fffffffe1b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffe1a8) at ../csu/libc-start.c:342
#12 0x0000555555558a2e in _start ()
p.s This is the first question that I am asking, I apologize beforehand if I have not formulated correctly
Asked by sultan.shahrukh on 2022-08-19 04:11:23 UTC
Comments