Boost logo

Boost Users :

Subject: [Boost-users] [phoenix] segmentation fault with valarray
From: Philipp Schwaha (philipp_at_[hidden])
Date: 2013-01-29 08:35:55


Hi all!

I have worked with phoenix together with valarray and am currently
stumbling over a case of segmentation fault.

I construct the following phoenix expression

boost::phoenix::at_c<0>(arg1) += boost::phoenix::at_c<1>(arg1) /
val(mass) * arg2

I then feed a std::tuple<std::valarray<double>, std::valarray<double>>
to it. It compiles nicely with gcc (4.6 & 4.7) using boost 1.52 as well
as trunk. The resulting executable then proceeds to segfault, however. I
have put together a small example (c++11) demonstrating my problem.

The valarray's memory should already be reserved from original
initialization. Performing the same operations manually with just the
valarray not in phoenix seems to work fine.
Am I missing something or doing something stupid here?

thanks for any help!

cheers
        Philipp




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net