Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

jokemanfire
Copy link
Contributor

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.
)

so we should check the value
@mxpv
Copy link
Member

mxpv commented Jan 7, 2024

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

Where do you see it inverted?

@jokemanfire
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor Author

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

@jokemanfire
Copy link
Contributor Author

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

@jokemanfire jokemanfire closed this Jan 9, 2024
@jokemanfire jokemanfire deleted the dev2 branch January 10, 2024 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants