You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered an error when using the following line of code, which runs in a loop to publish at 20Hz: sensor_msgs::ImagePtr img_ptr = cv_bridge::CvImage(std_msgs::Header(), "bgr8", img).toImageMsg();
I've used GDB to try to get more information on it and got the following:
malloc(): memory corruption
Thread 1 "img_pub" 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) info source
Current source file is ../sysdeps/unix/sysv/linux/raise.c
Compilation directory is /build/glibc-2ORdQG/glibc-2.27/signal
Source language is c.
Producer is GNU C11 7.5.0 -mtune=generic -march=x86-64 -g -O2 -O3 -std=gnu11 -fgnu89-inline -fmerge-all-constants -frounding-math -fstack-protector-strong -fPIC -ftls-model=initial-exec -fstack-protector-strong.
Compiled with DWARF 2 debugging format.
Does not include preprocessor macro info.
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007ffff52a78b1 in __GI_abort () at abort.c:79 #2 0x00007ffff52f0907 in __libc_message (action=action@entry=do_abort,
fmt=fmt@entry=0x7ffff541ddfa "%s\n") at ../sysdeps/posix/libc_fatal.c:181 #3 0x00007ffff52f797a in malloc_printerr (
str=str@entry=0x7ffff541c06e "malloc(): memory corruption")
at malloc.c:5350 #4 0x00007ffff52fba04 in _int_malloc (
av=av@entry=0x7ffff5652c40 <main_arena>, bytes=bytes@entry=1080000)
at malloc.c:3738 #5 0x00007ffff52fe35d in _GI___libc_malloc (bytes=1080000) at malloc.c:3065 #6 0x00007ffff5ca1298 in operator new(unsigned long) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #7 0x00007ffff71f4ed4 in cv_bridge::CvImage::toImageMsg(sensor_msgs::Image<std::allocator >&) const () from /opt/ros/melodic/lib/libcv_bridge.so #8 0x00007ffff71f5e7c in cv_bridge::CvImage::toImageMsg() const ()
from /opt/ros/melodic/lib/libcv_bridge.so #9 0x00005555555a9d49 in ImgPub::publishImage (this=0x7fffffffb670)
at /home/james1/Documents/catkin_ws/src/img_pub/src/img_pub.cpp:447 #10 0x00005555555a9fb3 in ImgPub::publishOutputs (this=0x7fffffffb670)
at /home/james1/Documents/catkin_ws/src/img_pub/src/img_pub.cpp:468
My environment is:
Ubuntu 18.04
ROS Melodic
OpenCV 3.2.0
cv_bridge 1.13.0
The text was updated successfully, but these errors were encountered:
I've encountered an error when using the following line of code, which runs in a loop to publish at 20Hz:
sensor_msgs::ImagePtr img_ptr = cv_bridge::CvImage(std_msgs::Header(), "bgr8", img).toImageMsg();
I've used GDB to try to get more information on it and got the following:
My environment is:
The text was updated successfully, but these errors were encountered: