Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The program crashes when executing solve() #1041

Open
CChyyyyyy opened this issue Jan 10, 2024 · 3 comments
Open

The program crashes when executing solve() #1041

CChyyyyyy opened this issue Jan 10, 2024 · 3 comments

Comments

@CChyyyyyy
Copy link

CChyyyyyy commented Jan 10, 2024

When I executed the solve() interface, a double free error occurred in the program, causing the program to crash. The stack is as shown below. What is the reason for this?

Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139762692249152) at ./nptl/pthread_kill.c:44
44        ./nptl/pthread_kill.c: No such file or directory.
[Current thread is 1 (Thread 0x7f1d099fd640 (LWP 388526))]
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=139762692249152) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=139762692249152) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=139762692249152, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007f1d2ce7f476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007f1d2ce657f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007f1d2cec6676 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f1d2d018b77 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007f1d2ceddcfc in malloc_printerr (str=str@entry=0x7f1d2d01b790 "double free or corruption (out)") at ./malloc/malloc.c:5664
#7  0x00007f1d2cedfe70 in _int_free (av=0x7f1d2d056c80 <main_arena>, p=0x3d50ef0, have_lock=<optimized out>) at ./malloc/malloc.c:4588
#8  0x00007f1d2cee2453 in __GI___libc_free (mem=<optimized out>) at ./malloc/malloc.c:3391
#9  0x00000000012102de in ceres::internal::EigenSparseCholeskyTemplate<Eigen::SimplicialLDLT<Eigen::SparseMatrix<double, 0, int>, 2, Eigen::NaturalOrdering<int> > >::~EigenSparseCholeskyTemplate() ()
#10 0x000000000110a633 in ceres::internal::SparseNormalCholeskySolver::~SparseNormalCholeskySolver() ()
#11 0x000000000110a6c9 in ceres::internal::SparseNormalCholeskySolver::~SparseNormalCholeskySolver() ()
#12 0x00000000010179a6 in ceres::Solver::Solve(ceres::Solver::Options const&, ceres::Problem*, ceres::Solver::Summary*) ()
#13 0x0000000001018da9 in ceres::Solve(ceres::Solver::Options const&, ceres::Problem*, ceres::Solver::Summary*) ()
@sandwichmaker
Copy link
Contributor

sandwichmaker commented Jan 10, 2024 via email

@CChyyyyyy
Copy link
Author

CChyyyyyy commented Jan 10, 2024

Thank you for your reply. This is a bug with a very low probability of occurrence. I currently cannot provide code to reproduce it stably. I am checking my code, but I have not found any problems. Do you have any troubleshooting ideas? By the way, I would like to ask why ~SparseNormalCholeskySolver() calls ~SparseNormalCholeskySolver() in the stack

#10 0x000000000110a633 in ceres::internal::SparseNormalCholeskySolver::~SparseNormalCholeskySolver() ()
#11 0x000000000110a6c9 in ceres::internal::SparseNormalCholeskySolver::~SparseNormalCholeskySolver() ()

@sandwichmaker
Copy link
Contributor

The destructor calling the destructor again does not seem right. This looks like some kind of linking problem, this should not happen. Are you sure that you are not mixing multiple versions of ceres solver in your system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants