I am getting a sigabrt when my deconstructor is being called. I have a fairly proto file. Which is below highlighted in yellow (sorry I cant do attachments). I did a simple main to create my Data and then assign a heartbeat, and then try to unassign the heartbeat and this creates a SIGABRT with _int_free() issue. My quick main application is highlighted in red below.
syntax = "proto3";
package common;
option java_package = "com.corporate";
option java_multiple_files = true;
enum Kind {
COMMON = 0;
}
message Data { //header.kind == "COMMON"
oneof content {
Heartbeat heartbeat = 1;
Acknowledge acknowledge = 2;
DataUpdateRequest dataupdateRequest = 3;
}
}
message Heartbeat {
}
message Acknowledge {
uint64 counter = 1; //counter from originating message
AcknowledgeKind kind = 2;
}
message DataUpdateRequest {
}
enum AcknowledgeKind {
ACKNOWLEDGE_OK = 0; //the originating messages has been accepted
ACKNOWLEDGE_ERROR = 1; //processing error during processing of message
ACKNOWLEDGE_ERROR_NOT_IMPLEMENTED = 2; //the processing of the originating messages is not implemented
ACKNOWLEDGE_ERROR_NOT_FOUND = 3; //the processing of the originating message could not be performed, the referenced object was not found
}
#include <iostream>
using namespace std;
#include "src/main/cpp/proto_api/common/data.pb.h"
int main(int argc, char **argv) {
// Simple example of destructor failure
while(true){
common::Data data;
common::Heartbeat heartbeat;
data.set_allocated_heartbeat(&heartbeat);
cerr << "Created data and heartbeat" << endl;
try {
data.clear_heartbeat();
} catch (const std::exception& e)
{
cerr << " Exception " << e.what() << endl;
}
}
return 0;
}