genivi-ipc@lists.genivi.org

Development list for inter process communication (IPC) related topics

View all threads

CommonAPI Compile Option

郭方强
Mon, May 15, 2017 7:39 AM

Dear All:

We are using CommonAPI and CommonAPI-DBus  in our linux system as IPC .

We find that if we compile source code with options as follow:

SECURITY_CFLAGS = "-fstack-protector-strong -pie -fpie -Wa,--noexecstack"
SECURITY_LDFLAGS = "-Wl,-z,relro,-z,now,-z,noexecstack"

we will get an Assert Aborted,we our binary runs,
source code as bellow(autogen by fidl file),red line assert failed.

void VehicleDataServiceStubDefault::fireVehicleStatusEvent(const ::v1::vehicledata::VehicleDataService::GetCmdID &_item_index, const ::v1::vehicledata::VehicleDataService::ValueUnion &item_data) {
if (!item_index.validate()) {
return;
}
assert((CommonAPI::Stub<VehicleDataServiceStubAdapter, VehicleDataServiceStubRemoteEvent>::stubAdapter
.lock()) !=NULL);
auto stubAdapter = CommonAPI::Stub<VehicleDataServiceStubAdapter, VehicleDataServiceStubRemoteEvent>::stubAdapter
.lock();
if (stubAdapter)
stubAdapter->fireVehicleStatusEvent(_item_index, _item_data);
}

CommonAPI version: 3.1.5

if without those SECURITY flags. Everything is OK.
Any guy know why?
Many thanks!

Best Regards!

Dear All: We are using CommonAPI and CommonAPI-DBus in our linux system as IPC . We find that if we compile source code with options as follow: SECURITY_CFLAGS = "-fstack-protector-strong -pie -fpie -Wa,--noexecstack" SECURITY_LDFLAGS = "-Wl,-z,relro,-z,now,-z,noexecstack" we will get an Assert Aborted,we our binary runs, source code as bellow(autogen by fidl file),red line assert failed. void VehicleDataServiceStubDefault::fireVehicleStatusEvent(const ::v1::vehicledata::VehicleDataService::GetCmdID &_item_index, const ::v1::vehicledata::VehicleDataService::ValueUnion &_item_data) { if (!_item_index.validate()) { return; } assert((CommonAPI::Stub<VehicleDataServiceStubAdapter, VehicleDataServiceStubRemoteEvent>::stubAdapter_.lock()) !=NULL); auto stubAdapter = CommonAPI::Stub<VehicleDataServiceStubAdapter, VehicleDataServiceStubRemoteEvent>::stubAdapter_.lock(); if (stubAdapter) stubAdapter->fireVehicleStatusEvent(_item_index, _item_data); } CommonAPI version: 3.1.5 if without those SECURITY flags. Everything is OK. Any guy know why? Many thanks! Best Regards!