[Trilinos-Users] Unexpected Memory Issue with AztecOO

Heroux, Michael A maherou at sandia.gov
Sat Mar 26 10:01:15 EDT 2016


Corey,

This could very likely be a bug.  AFAIK, no one uses the default constructor for AztecOO.  Sorry  for difficulty. 

With current efforts focused on newer packages (e.g., Belos), it is very unlikely we will get around to fixing this problem.

Your use case is supported in general, if you construct a non-trivial AztecOO instance and then reset the RHS pointer to your new b vector, or modify the values of the previous b vector.

I hope this helps.

Mike
________________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Corey A. Henderson <cahenderson at wisc.edu>
Sent: Thursday, March 24, 2016 9:49 PM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] Unexpected Memory Issue with AztecOO

I am creating a solver class where I wish to reuse the same AztecOO
instance to repeatedly call the .Iterate() method as the b vector
changes in an Ax=b problem statement.

I encountered an unexpected memory error when using AztecOO as a class
member in C++. The AztecOO destructor throws a memory corruption core
dump when my instance is destroyed. I was able to resolve it by using
a pointer and allocating the instance on the heap and using delete in
my destructor, but I don't feel that should be necessary.

The "bug" I saw can be easily reproduced by creating an instance of
AztecOO on the stack and then triggering the destructor by replacing
it with another instance. Like so:

//AztecOOMemTest.cpp
#include "AztecOO.h"

int main(int argc, char **argv) {
    AztecOO solver;
    solver = AztecOO();
}

The error is:
*** Error in `./AztecOOMemTest': double free or corruption (fasttop):
0x0000000002496de0 ***
Aborted (core dumped)

Is this expected behaviour? The documentation is not really clear on
whether the default constructor is supported. I'm not a C++ expert so
it's also possible I am doing something really dumb.

Regards,

--
Corey A. Henderson
PhD Candidate and NSF Graduate Fellow
Dept. of Engineering Physics
Univ. of Wisconsin - Madison
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org
https://trilinos.org/mailman/listinfo/trilinos-users


More information about the Trilinos-Users mailing list