Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] OMPI seg fault by a class with weird address.
From: Belaid MOA (belaid_moa_at_[hidden])
Date: 2011-03-15 02:16:35


Hi Jack,
1- Where is your main function to see how you called your class?
2- I do not see the implementation of GetPosition, GetName, etc.?

With best regards,
-Belaid.
  

From: dtustudy68_at_[hidden]
To: users_at_[hidden]
Date: Mon, 14 Mar 2011 19:04:12 -0600
Subject: [OMPI users] OMPI seg fault by a class with weird address.

Hi,
I got a run-time error of a Open MPI C++ program.
The following output is from gdb:
--------------------------------------------------------------------------Program received signal SIGSEGV, Segmentation fault.0x00002aaaab3b0b81 in opal_memory_ptmalloc2_int_malloc () from /opt/openmpi-1.3.4-gnu/lib/libopen-pal.so.0
At the point
Breakpoint 9, Index::Index (this=0x7fffffffcb80) at src/index.cpp:2020 Name(0) {}
The Index has been called before this point and no problem:-------------------------------------------------------Breakpoint 9, Index::Index (this=0x117d800) at src/index.cpp:2020 Name(0) {}(gdb) cContinuing.
Breakpoint 9, Index::Index (this=0x117d860) at src/index.cpp:2020 Name(0) {}(gdb) cContinuing.----------------------------------------------------------------------------
It seems that the 0x7fffffffcb80 address is a problem.
But, I donot know the reason and how to remove the bug.
Any help is really appreciated.
thanks
the following is the index definition.
---------------------------------------------------------class Index { public: Index(); Index(const Index& rhs); ~Index(); Index& operator=(const Index& rhs); vector<int> GetPosition() const; vector<int> GetColumn() const; vector<int> GetYear() const; vector<string> GetName() const; int GetPosition(const int idx) const; int GetColumn(const int idx) const; int GetYear(const int idx) const; string GetName(const int idx) const; int GetSize() const; void Add(const int idx, const int col, const string& name); void Add(const int idx, const int col, const int year, const string& name); void Add(const int idx, const Step& col, const string& name); void WriteFile(const char* fileinput) const; private: vector<int> Position; vector<int> Column; vector<int> Year; vector<string> Name;};// Contructors and destructor for the Index classIndex::Index() : Position(0), Column(0), Year(0), Name(0) {}
Index::Index(const Index& rhs) : Position(rhs.GetPosition()), Column(rhs.GetColumn()), Year(rhs.GetYear()), Name(rhs.GetName()) {}
Index::~Index() {}
Index& Index::operator=(const Index& rhs) { Position = rhs.GetPosition(); Column = rhs.GetColumn(), Year = rhs.GetYear(), Name = rhs.GetName(); return *this;}----------------------------------------------------------

                                               

_______________________________________________
users mailing list
users_at_[hidden]
http://www.open-mpi.org/mailman/listinfo.cgi/users