![]() |
Blitz Bugs : |
From: Sami Kukkonen (sami_at_[hidden])
Date: 2003-11-20 11:50:22
This could be more of a compiler limitation issue but I want to report
it anyway.
I compiled Blitz++ 0.7 on OS X 10.2.8 with gcc (GCC) 3.1 20020420
(prerelease). I noticed that if -finline-functions option is used
during compilation, Blitz++ causes a segmentation violation when the
attached code snippet (taken from arrayresize.cpp test) is executed.
The problem went away when I specified -finline-limit=300.
{
// One-dimensional resizeAndPreserve
Array<int,1> A(5);
A = 0, 1, 2, 3, 4;
A.resizeAndPreserve(10);
A(Range(5,toEnd)) = 0;
}
Here's the stack trace:
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x00055d58 in blitz::Array<int, 1>& blitz::Array<int,
1>::evaluateWithStackTraversal1<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExp
rConstant<int> >, blitz::_bz_update<int, int>
>(blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprConstant<int> >,
blitz::_bz_update<int, int>) ()
(gdb) where
#0 0x00055d58 in blitz::Array<int, 1>& blitz::Array<int,
1>::evaluateWithStackTraversal1<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExp
rConstant<int> >, blitz::_bz_update<int, int>
>(blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprConstant<int> >,
blitz::_bz_update<int, int>) ()
#1 0x00055780 in blitz::Array<int, 1>& blitz::Array<int,
1>::evaluate<blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprConstant<int> >,
blitz::_bz_update<int, int>
>(blitz::_bz_ArrayExpr<blitz::_bz_ArrayExprConstant<int> >,
blitz::_bz_update<int, int>) ()
-- Sami Kukkonen <sami_at_[hidden]> "In space, nobody hears you reboot."