Re: [Cppcms-users] SV occurs at json_rpc_server::return_result(cppcms::json::array()) with aio::io_
Brought to you by:
artyom-beilis
From: CN <cn...@fa...> - 2016-04-04 10:14:30
|
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 |