[Coin-discuss] Segmentation fault in CoinPackedMatrix
Matthew Galati
magh at lehigh.edu
Wed Jan 21 14:24:41 EST 2004
Hi Jespser,
I cannot seem to repeat the stack dump you posted earlier (using gcc
3.3.2 or MSVC6). But here is a guess... check your Coin lib Makefile and
see if you are compiling with -DCOIN_DEBUG. If so, you will see, in
CoinPackedMatrix::appendMajorVector, that if any of your row indices are
greater than minorDim_, that it will throw. If you are not using a
try/catch block, the code will just crash and exit. Does your code
snippet (below) crash and produce the stack you posted earlier? I am not
sure why the throw block is in appendMajorVector when COIN_DEBUG is
defined, since later in the function, it calls the resize function.
Unless someone knows that the resize function might (?) have a bug. A
quick fix, if you want, is to set the row dimension before hand, so that
appendCol does not get into the resize function (
check.setDimensions(0,2) ).
Matt
>Here is the smallest example that I could think off... ;-)
>
>#include <CoinPackedMatrix.hpp>
>#include <CoinPackedVector.hpp>
>
>int main(int argc, char** argv) {
> CoinPackedMatrix check;
> CoinPackedVector z;
> z.insert(1,-1);
> check.appendCol(z);
>}
>
>I'm running on Linux with g++ (GCC) 3.2.3 20030502 (Red Hat Linux
>3.2.3-20).
>
>Hope that this is helpful.
>
>On Wed, 21 Jan 2004, J P Fasano wrote:
>
>
>
>>
>>
>>Can you provide a small test case which recreates the problem?
>>
>>JP Fasano
>>jpfasano at us.ibm.com
>>(914)945-1324 (tie line 862-1324)
>>COIN www.coin-or.org
>>
>>_______________________________________________
>>Coin-discuss mailing list
>>Coin-discuss at www-124.ibm.com
>>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
>>
>>
>>
>
>
>
--
Matthew Galati
ISE Lehigh University
IBM Service Parts Solutions
610.758.4042 (Office)
610.882.0779 (Home)
magh at lehigh.edu, magal11 at us.ibm.com
http://sagan.ie.lehigh.edu/mgalati/
More information about the Coin-discuss
mailing list