Boost logo

Boost :

From: Domenico Andreoli (cavok_at_[hidden])
Date: 2005-01-17 06:06:16


hi all,

boost debian package version 1.32.0-2 has been reported the following
bug. i didn't find anything in the archive. is it a new entry?

cheers
domenico

----- Forwarded message from Vassilii Khachaturov <vassilii_at_[hidden]> -----

Date: Sun, 16 Jan 2005 19:06:00 +0200
From: Vassilii Khachaturov <vassilii_at_[hidden]>
Subject: Bug#290782: multi_array.hpp: rebasing via range causes a crash while reindex works

When a multi_array rebasing to 1 is attempted via extent_range,
a segmentation fault happens on accessing the boundary element.
Workaround: use reindex. See the snippet below.
The 1.32.0-2 was built locally from the source package.

-- Transcript of a crash:
vassilii_at_ilmarinen:$ make t-boost-multiarray-reindex1
g++ -Wall -O3 -g -ansi -pedantic-errors -MMD t-boost-multiarray-reindex1.cpp -o t-boost-multiarray-reindex1
vassilii_at_ilmarinen:$ ./t-boost-multiarray-reindex1
Segmentation fault

-- Test that causes the crash (t-boost-multiarray-reindex1.cpp):
#include <boost/multi_array.hpp>

int main()
{
        typedef boost::multi_array<float, 1> arr;

        float pi = 3.14;

#ifdef WORKAROUND
        arr a(boost::extents[ 1 ]);
        a.reindex(1);
#else
        arr a(boost::extents[ arr::extent_range(1, 1) ]);
#endif
        a[1] = pi;
        return 0;
}

----- End forwarded message -----

-----[ Domenico Andreoli, aka cavok
 --[ http://people.debian.org/~cavok/gpgkey.asc
   ---[ 3A0F 2F80 F79C 678A 8936 4FEE 0677 9033 A20E BC50


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk