iotaledger / entangled

enTangle'd is an amalgamation of all things Tangle
Apache License 2.0
113 stars 66 forks source link

MAM - Use of uninitialised value of size 8 (mam_api_load) #1467

Open kuhlmannmarkus opened 4 years ago

kuhlmannmarkus commented 4 years ago

Describe the bug A Use of uninitialised value of size 8 appears in 2 different constellations in mam_api_load. Valgrind Info 1: ==10878== at 0x294F8B: mam_channel_t_set_contains (mam_channel_t_set.c:62) ==10878== by 0x293994: mam_channel_t_set_add (mam_channel_t_set.c:15) ==10878== by 0x2938F3: mam_channels_deserialize (channel.c:206) ==10878== by 0x281E15: mam_api_deserialize (api.c:795) ==10878== by 0x282281: mam_api_load (api.c:892)

Valgrind Info 2: ==10878== at 0x294031: mam_channel_t_set_add (mam_channel_t_set.c:20) ==10878== by 0x2938F3: mam_channels_deserialize (channel.c:206) ==10878== by 0x281E15: mam_api_deserialize (api.c:795) ==10878== by 0x282281: mam_api_load (api.c:892)

To Reproduce Steps to reproduce the behavior: Use mam_api_load.

Expected behavior Use of uninitialised value should not happen.

Desktop (please complete the following information):

thibault-martinez commented 4 years ago

Can you provide a full minimum example that produce this issue please ?

kuhlmannmarkus commented 4 years ago

You can simply run mam/api/tests/test_api through valgrind. It exposes a similar behaviour.