This bugzilla service is closed. All entries have been migrated to
Bug 858 - Memory allocation problem in ArpackGeneralizedSelfAdjointEigenSolver
Summary: Memory allocation problem in ArpackGeneralizedSelfAdjointEigenSolver
Alias: None
Product: Eigen
Classification: Unclassified
Component: Unsupported modules (show other bugs)
Version: unspecified
Hardware: All All
: Normal Crash
Assignee: Nobody
Keywords: test-needed
Depends on:
Reported: 2014-08-20 11:08 UTC by Elisa Friebel
Modified: 2019-12-04 13:36 UTC (History)
4 users (show)

Use matching desctructor (1.04 KB, patch)
2014-08-20 11:08 UTC, Elisa Friebel
no flags Details | Diff

Description Elisa Friebel 2014-08-20 11:08:33 UTC
Created attachment 485 [details]
Use matching desctructor

While searching for a bug, valgrind discovered some discrepancies in the unsupported ArpackGeneralizedSelfAdjointEigenSolver module. A memory allocation by new[] was freed by calling delete.
Enclosed please find a version using new[] and delete[].
Comment 1 Christoph Hertzberg 2014-08-20 12:30:04 UTC
Using new[] and delete[] as suggested is not exception-safe (delete instead of delete[] is entirely wrong, of course). I would suggest replacing all new[]s by ei_declare_aligned_stack_constructed_variable (this falls back to an automatically destructed malloc for arrays above EIGEN_STACK_ALLOCATION_LIMIT). This should be more efficient and safely avoid memory leaks.

It would be nice to have some unit-tests for ArpackSupport.
Comment 2 Jim Garrison 2014-09-06 07:04:32 UTC
I have fixed this and a few other things in my branch at

This branch includes a couple other fixes as well -- see bug #230, where I initially posted some of these changes.

Feel free to pull this branch any time.  I also plan to continue working on it to make the Arpack wrapper support complex matrices as well (which I will follow up on in bug #230).
Comment 3 Nobody 2019-12-04 13:36:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.