You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've come across a behavior that looks very suspicious while when declaring multiple variables in one line and then updating one of the values. I'm using CLang 14, couldn't get 15+ to work, even in Godbolt, which is also failing: https://godbolt.org/z/vh1rWT79a, so I'm not sure if this is a CLang bug (or was, couldn't test newer versions).
What's the catch here? Am I missing something? Was this known and fixed after CLang 14? Is this even a bug? I'm a bit lost and some help would be appreciated 😅 .
I've built BCC from source from the master branch, at rev cb1ba20f4800f556dc940682ba7016c50bd0a3ac. Kernel is 6.11.0-061100-generic.
I've come across a behavior that looks very suspicious while when declaring multiple variables in one line and then updating one of the values. I'm using CLang 14, couldn't get 15+ to work, even in Godbolt, which is also failing: https://godbolt.org/z/vh1rWT79a, so I'm not sure if this is a CLang bug (or was, couldn't test newer versions).
Here's a reproduction:
When attached to a kprobe (say
sys_sync
), the output looks like:The first print contains the wrong value for
last_key
, should be0
as well.Disassembled with
BPF.disassemble_func
gives the following:Disassembled ASM with variables swapped
Notice the `r4 = 0` at position 10.What's the catch here? Am I missing something? Was this known and fixed after CLang 14? Is this even a bug? I'm a bit lost and some help would be appreciated 😅 .
I've built BCC from source from the master branch, at rev
cb1ba20f4800f556dc940682ba7016c50bd0a3ac
. Kernel is6.11.0-061100-generic
.The text was updated successfully, but these errors were encountered: