tum-vision / pnec

[CVPR 2022] README.md The Probabilistic Normal Epipolar Constraint for Frame-To-Frame Rotation Optimization under Uncertain Feature Positions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Double free or corruption (out) error

BITcats opened this issue · comments

When I run pnec on my computer and a docker container. I both met the double free or corruption (out) error. The debug information is as follows:

ubuntu18.04:~/workspace/pnec/build$ gdb pnec_vo 
GNU gdb (Ubuntu 8.1.1-0ubuntu1) 8.1.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pnec_vo...done.
(gdb) r
Starting program: /home/workspace/pnec/build/pnec_vo 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
PNEC Copyright (C) 2022 Dominik Muhle
PNEC comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it
    under certain conditions; visit
    https://github.com/tum-vision/pnec for details.

OpenCV version: 4.0.0
Eigen version: 3.3.4.0
[] Loaded camera with 2 cameras
[] K:
[718.856, 0, 607.1928;
 0, 718.856, 185.2157;
 0, 0, 1]
[] dist coefs:
[0, 0, 0, 0]

[] using image extension: .png

[] Loading images from
/home/dataset/kitti_sequences/00/image_0

[] Loading timestamps from
/home/dataset/kitti_sequences/00/times.txt

double free or corruption (out)

Program 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) bt
#0  0x00007ffff0837e87 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff08397f1 in __GI_abort () at abort.c:79
#2  0x00007ffff0882837 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff09afa7b "%s\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007ffff08898ba in malloc_printerr (str=str@entry=0x7ffff09b1788 "double free or corruption (out)") at malloc.c:5342
#4  0x00007ffff0890e4a in _int_free (have_lock=0, p=0x555555cc3c90, av=0x7ffff0be4c40 <main_arena>) at malloc.c:4308
#5  0x00007ffff0890e4a in __GI___libc_free (mem=0x555555cc3ca0) at malloc.c:3134
#6  0x0000555555621c06 in Eigen::internal::aligned_free(void*) (ptr=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:745
#7  0x0000555555621c06 in Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> >::deallocate(Eigen::Matrix<double, 2, 1, 0, 2, 1>*, unsigned long) (this=0x7fffffffc0e0, p=<optimized out>) at /usr/include/eigen3/Eigen/src/Core/util/Memory.h:747
#8  0x0000555555621c06 in std::allocator_traits<Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > >::deallocate(Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> >&, Eigen::Matrix<double, 2, 1, 0, 2, 1>*, unsigned long) (__a=..., __n=<optimized out>, __p=<optimized out>) at /usr/include/c++/9/bits/alloc_traits.h:332
#9  0x0000555555621c06 in std::_Vector_base<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > >::_M_deallocate(Eigen::Matrix<double, 2, 1, 0, 2, 1>*, unsigned long) (this=0x7fffffffc0e0, __n=<optimized out>, __p=<optimized out>)
    at /usr/include/c++/9/bits/stl_vector.h:351
#10 0x0000555555621c06 in std::_Vector_base<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > >::~_Vector_base() (this=0x7fffffffc0e0, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/stl_vector.h:332
#11 0x0000555555621c06 in std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, Eigen::aligned_allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > >::~vector() (this=0x7fffffffc0e0, __in_chrg=<optimized out>) at /usr/include/c++/9/bits/stl_vector.h:680
#12 0x0000555555621c06 in basalt::KeypointsData::~KeypointsData() (this=0x7fffffffc0e0, __in_chrg=<optimized out>) at /home/workspace/pnec/third_party/basalt/include/basalt/utils/common_types.h:95
#13 0x0000555555621c06 in basalt::KLTPatchOpticalFlow<float, basalt::Pattern52>::addPoints() (this=this@entry=0x7fffffffd290) at /home/workspace/pnec/include/features/tracking/klt_patch_optical_flow.h:337
#14 0x000055555562288c in basalt::KLTPatchOpticalFlow<float, basalt::Pattern52>::processFrame(long, std::shared_ptr<basalt::OpticalFlowInput>&) (this=0x7fffffffd290, curr_t_ns=<optimized out>, new_img_vec=
    std::shared_ptr<basalt::OpticalFlowInput> (use count 2, weak count 0) = {...}) at /usr/include/c++/9/ext/atomicity.h:82
#15 0x00005555556119e1 in pnec::frames::TrackingFrame::FindFeatures(pnec::common::FrameTiming&) (this=0x555555c98ea0, frame_timing=...) at /home/workspace/pnec/src/frames/tracking_frame.cc:60
#16 0x0000555555602898 in pnec::frames::TrackingFrame::TrackingFrame(int, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, basalt::KLTPatchOpticalFlow<float, basalt::Pattern52>&, pnec::common::FrameTiming&) (frame_timing=..., tracking=..., path="/home/dataset/kitti_sequences/00/image_0/000000.png", timestamp=0, id=0, this=0x555555c98ea0) at /home/workspace/pnec/include/frames/tracking_frame.h:61
#17 0x0000555555602898 in main (argc=<optimized out>, argv=<optimized out>) at /home/workspace/pnec/src/pnec_vo.cc:225
#18 0x00007ffff081ac87 in __libc_start_main (main=0x555555600fa0 <main>, argc=1, argv=0x7fffffffd888, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd878) at ../csu/libc-start.c:310
#19 0x00005555556069da in _start () at /usr/include/eigen3/Eigen/src/Core/EigenBase.h:48
(gdb)

It seems caused by Eigen. I search relative error in StackOverflow and get this

[Eigen static lib aligned_free "double free or corruption"](https://stackoverflow.com/questions/71647793/eigen-static-lib-aligned-free-double-free-or-corruption)

and it works.