SIGABRT on deconstructor Centos

24 views
Skip to first unread message

Timothy Sutton

unread,
Aug 31, 2022, 11:36:44 AM8/31/22
to Protocol Buffers
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;
}





Timothy Sutton

unread,
Aug 31, 2022, 11:37:48 AM8/31/22
to Protocol Buffers
Sorry forgot to add this information, g++ complier and protoc version I am using 


[tsutton@ssa-syr-g1x-dev01 simple_proto]$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[tsutton@ssa-syr-g1x-dev01 simple_proto]$ protoc --version
libprotoc 3.21.5

Timothy Sutton

unread,
Aug 31, 2022, 12:26:37 PM8/31/22
to Protocol Buffers
Reply all
Reply to author
Forward
0 new messages