Re: [Cppcms-users] SV occurs at json_rpc_server::return_result(cppcms::json::array()) with aio::io_
Brought to you by:
artyom-beilis
|
From: Artyom B. <art...@gm...> - 2016-04-04 10:59:15
|
Do you provide a full sample that reproduces the issue? For example in
m2 below you can't call ja.push_back(a) as ja is const.
According to the crash it looks like you are derefenecing deleted
object, i.e. something passed by reference and out of stack
or something like that.
Full sample would help me to check the issue.
Artyom
On Mon, Apr 4, 2016 at 1:14 PM, CN <cn...@fa...> wrote:
> The actual json::array passed to boost::bind() is a nested "deep"
> object, like so:
>
> void m2(booster::shared_ptr<cppcms::rpc::json_call> requester
> ,int size,const cppcms::json::array &ja)
> {
> cppcms::json::array a;
> a.resize(3);
> a[0]=cppcms::json::array();
> a[0].array().push_back("a");
> a[0].array().push_back(1);
> a[1]=cppcms::json::array();
> a[1].array().push_back("b");
> a[2]=cppcms::json::array();
> a[2].array().push_back("c");
> ja.push_back(a);
> io_service.post(boost::bind(&report_service::m1,this,requester,size,ja));
> }
>
> After restructuring my code, gdb now reports the location of segment
> fault at line# 280 in json.cpp:
>
> memset(&m,0,sizeof(m));
>
> If I comment out this line, my progam does not crash here any more.
>
> My question now is:
>
> With the line
> static_cast<array *>(ptr())->~array();
> in place, is it necessary to call memset()?
>
> Best regards,
> CN
>
> --
> http://www.fastmail.com - Or how I learned to stop worrying and
> love email again
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Cppcms-users mailing list
> Cpp...@li...
> https://lists.sourceforge.net/lists/listinfo/cppcms-users
|