Open lcp opened 5 years ago
The issue exists in the trunk as well. The reason, as you described, is Leaf data structure with extra padding member and the constructor value sequence (1, 2)
does not match structure layout any more. Need to think how to resolve this automatically.
I found a regression since 0.6.0. If there is a struct member is aligned, Leaf() may consider the padded space as a valid member.
Here is the bug reproducer for x86_64:
The code looked legit but it failed with the following error.
The program worked again when I added a bytes parameter to Leaf() like this:
or added
__attribute__((packed))
tostruct test
, so it's obvious an issue about padding.Since the issue happened between 0.5.0 and 0.6.0, it's likely related to https://github.com/iovisor/bcc/commit/538a84e1f821a97468a55d0e97a5c0a4617a1271 and https://github.com/iovisor/bcc/commit/b32b4a5fffb61ae6fd5e75e30c06763ade8ed1a4.