riebl/vanetza

free(): corrupted unsorted chunks

Closed this issue · 1 comments

Hi,
I'm trying to receive UDP packets (CAM) from an OBU using Vanetza. On Wireshark, I get this CAM (length: 69).
Header: 00 34 00
Payload: 02 02 fc 16 30 a6 66 1d 40 57 f8 dc f0 0e ad 7a 10 00 00 00 00 00 30 d4 1e 00 00 0f df ff fe 82 f0 8d 00
03 ff 05 ff f8 00 00 0d ff ff 7f ff d8 ce 00 00 00
Metadata: 01 d1 07 00 00 01 95 0a 34 c0 7b 01 00 00

If I decode the payload using an ASN.1 decoder, I get a correct xml format.

However, when executing Vanetza, I get the error: free(): corrupted unsorted chunks
The complete message is:

m2m@m2m-NUC4:~/Desktop/vanetza/build/bin$ sudo ./socktap-mqtt -l udp --gpsd-host localhost --mac-address 00:00:00:00:00:01
Starting runtime at 2021-Sep-07 12:24:21.566215
Using MAC address: 00:00:00:00:00:01.
free(): corrupted unsorted chunks
Aborted

I'm using a Vanetza version from November 2020, in case this issue (if it is the case) is solved in current version, please, let me know. Otherwise, do you know which could be the cause?
Thanks!

riebl commented

I don't remember to have seen this error before. I assume that the memory management related to asn1c data structures is somehow screwed up. The reason for this could be either a bug or a misuse of the asn1c API, e.g. that a structure is explicitly freed which is part of a larger/outer structure.
Can you provide a stack trace? Does the error occur with the shipped CamApplication of socktap or is it some custom code?