containerd / rust-extensions

Rust crates to extend containerd
https://containerd.io
Apache License 2.0
184 stars 73 forks source link

The golang "true" is 0 ,but Rust "true" is 1 #234

Closed jokemanfire closed 10 months ago

jokemanfire commented 10 months ago

The int variable value of the bool variable in Golang language is different from that of rust。 In golang // bool is the set of boolean values, true and false. type bool bool

// true and false are the two untyped boolean values. const ( true = 0 == 0 // Untyped bool. false = 0 != 0 // Untyped bool. )

mxpv commented 10 months ago

I'm not sure I understand this. KillRequest is protobuf generated structure with boolean all field defined.

Where do you see it inverted?

jokemanfire commented 10 months ago

In 'task.rs' kill function , there is " info!("Kill request for {:?}", req);" this way can print result . but when you send the KillRequest in containerd , when ctr set all "true" but shim get false , I find it in test function "TestContainerDrainExecIOAfterExit " , Maybe I was wrong, But I feel confused , ctr send true ,but shim get false . so I think golang deal with bool "0" represent true .

Burning1020 commented 10 months ago

Can you provide more defails, such as the log msg of info!("Kill request for {:?}", req);? It has a long way between ctr and task.kill(), I think it is not a bug of rust shim.

jokemanfire commented 10 months ago

I will delve deeper into this issue but after solve the IO problem

jokemanfire commented 10 months ago

this is containerd's problem I will bring issus to containerd