Thanks for the help @jethrogb, @matklad.
Using the transmute hint I was able to verify that my struct is being changed by the C code. But I don't quite yet understand how.
Over the weekend I tried to gather more information using rust-gdb but unfortunately, rust-gdb can't find my variable name and when I try 'info locals' rust-gdb crashes. I'm troubleshooting that now.
Until I get the rust-gdb problem sorted I was hoping someone could shed some light on the transmute results. Specifically, I can't find the documentation that specifies the byte pattern for the hidden drop flag. So I can't be certain it's getting overwritten.
When I use transmute to get the array representation of the struct before the C function call I get
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 0, 0, 0, 0, 0, 0, 0]
and after the C function call
[224, 64, 239, 250, 191, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 128, 128, 87, 238, 250, 191, 127, 0, 0, 119, 43, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 144, 250, 71, 248, 191, 127, 0, 0, 99, 111, 118, 114, 0, 0, 0, 0, 168, 115, 1, 0, 0, 0, 0, 0]
But I don't know how to interpret those results. Can anyone verify that the drop flag has been overwritten from that output?
I hope to have some code that I can share today also.