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
msg/async: fix bug of data type conversion when uint64_t -> int -> uint64_t #18210
Conversation
who is "int" |
class C_tick_wakeup : public EventCallback { public: fd_or_id is int |
It got assert(last_tick_id == id) in our code when EventCenter::process_time_events cb->do_request(int fd_or_id) calls AsyncConnection::tick(uint64_t id), the ceph/master removes the assert,but this issue exits. |
the core infor is this: |
oh, right. but we should modify the EventCallback interface instead of this fix |
i think it will modify many files. |
not so many. it's desired |
ok, i will fix this bug as your method |
cd4a943
to
8e7dfd3
Compare
please review @yuyuyu101 |
could you prefix the title of your commit message with the subcomponent your are changing ? see https://github.com/ceph/ceph/blob/master/SubmittingPatches.rst#3-describe-your-changes |
Signed-off-by: shangfufei <shangfufei@inspur.com>
8e7dfd3
to
38990a6
Compare
ok , changed @tchaikov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There is "uint64_t a -> int b ->uint64_t c" data type conversion in the code, when the length of "a" is greater than 32 bits, the conversion of "uint64_t a" to "int b" results in data overflow, when the length of "a" is less than 32 bits and a >= 0x80000000, change "uint64_t a" to "int b" will lead "b" to be a negative number of 32 bits, then change " int b" to " uint64_t c" , the variable "c" is not equal to the variable “a” at this situation.
Signed-off-by: shangfufei shangfufei@inspur.com