[spirit] [test] Double deletion problem?

View: New views
4 Messages — Rating Filter:   Alert me  

[spirit] [test] Double deletion problem?

by Alastair Rankine-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, I found an issue with testing my Spirit app, but after some
investigation it seems to be more of an issue with Boost Test.

The error message is as follows:


Running 2 test cases...

*** No errors detected
spirit2(53940) malloc: *** error for object 0x30001013006d0: pointer
being freed was not allocated
*** set a breakpoint in malloc_error_break to debug


As the error message suggests I set a breakpoint and got this stack trace:


(gdb) bt
#0  0x00007fff88021b91 in malloc_error_break ()
#1  0x00007fff87f4b083 in free ()
#2  0x000000010006c3ac in boost::unit_test::framework_impl::clear
(this=0x1000deec0) at framework.ipp:133
#3  0x000000010006c4aa in
boost::unit_test::framework_impl::~framework_impl (this=0x1000deec0) at
framework.ipp:122
#4  0x000000010006da1e in __tcf_1 () at framework.ipp:225
#5  0x00007fff87f57274 in __cxa_finalize ()
#6  0x00007fff87f5718c in exit ()
#7  0x000000010000b7bb in start () at unit_test_parameters.ipp:172



Complete code is below. It is compiled on MacOS 10.6.1 with the default
gcc 4.2 compiler against boost 1.40 (installed via MacPorts).

I note that if the problem disappears when the two
BOOST_AUTO_TEST_SUITE lines are removed. Also it disappears when one of
the test cases is commented out.

Any help appreciated.



#define BOOST_TEST_MODULE spirit test
#include <boost/test/included/unit_test.hpp>

#include <boost/spirit/include/qi.hpp>

namespace qi = boost::spirit::qi;

template <typename Iterator>
struct MyGrammar : public qi::grammar<Iterator>
{
    MyGrammar()
        : MyGrammar::base_type(sp)
    {
        using boost::spirit::char_;

        sp = char_(' ');
    }

    qi::rule<Iterator> sp;
};

BOOST_AUTO_TEST_SUITE(SpiritTest)

BOOST_AUTO_TEST_CASE(Test1)
{
    MyGrammar<std::string::const_iterator> parser;
}

BOOST_AUTO_TEST_CASE(Test2)
{
    MyGrammar<std::string::const_iterator> parser;
}

BOOST_AUTO_TEST_SUITE_END()


_______________________________________________
Boost-Testing mailing list
Boost-Testing@...
http://lists.boost.org/mailman/listinfo.cgi/boost-testing

Re: [spirit] [test] Double deletion problem?

by Beman Dawes :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Sep 14, 2009 at 5:37 PM, Alastair Rankine <arsptr@...> wrote:
Hi, I found an issue with testing my Spirit app, but after some investigation it seems to be more of an issue with Boost Test.

The error message is as follows:


Running 2 test cases...

*** No errors detected
spirit2(53940) malloc: *** error for object 0x30001013006d0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug


As the error message suggests I set a breakpoint and got this stack trace:


(gdb) bt
#0  0x00007fff88021b91 in malloc_error_break ()
#1  0x00007fff87f4b083 in free ()
#2  0x000000010006c3ac in boost::unit_test::framework_impl::clear (this=0x1000deec0) at framework.ipp:133
#3  0x000000010006c4aa in boost::unit_test::framework_impl::~framework_impl (this=0x1000deec0) at framework.ipp:122
#4  0x000000010006da1e in __tcf_1 () at framework.ipp:225
#5  0x00007fff87f57274 in __cxa_finalize ()
#6  0x00007fff87f5718c in exit ()
#7  0x000000010000b7bb in start () at unit_test_parameters.ipp:172


Did this get resolved?

--Beman

_______________________________________________
Boost-Testing mailing list
Boost-Testing@...
http://lists.boost.org/mailman/listinfo.cgi/boost-testing

Re: [spirit] [test] Double deletion problem?

by Gennadiy Rozental-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Beman Dawes <bdawes <at> acm.org> writes:

> Did this get resolved?--Beman

I am looking into this. I hope to get a hold of this platform next weekend.

Genandiy

_______________________________________________
Boost-Testing mailing list
Boost-Testing@...
http://lists.boost.org/mailman/listinfo.cgi/boost-testing

Re: [spirit] [test] Double deletion problem?

by Gennadiy Rozental-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Gennadiy Rozental wrote:
> Beman Dawes <bdawes <at> acm.org> writes:
>
>> Did this get resolved?--Beman
>
> I am looking into this. I hope to get a hold of this platform next weekend.

Got one now. This should be resolved.

Gennadiy
_______________________________________________
Boost-Testing mailing list
Boost-Testing@...
http://lists.boost.org/mailman/listinfo.cgi/boost-testing