-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
Fix use of unsafe localtime()
and portable gmtime_r()
#1481
Conversation
47deee2
to
0731616
Compare
I noticed a strange bug recently, sometimes it happens on Alpine Linux like in this PR:
See https://github.com/rizinorg/rizin/pull/1481/checks?check_run_id=3369716223#step:8:3159 Sometimes it happens on Windows:
(See https://ci.appveyor.com/project/rizinorg/rizin/builds/40439023/job/guyflnbj6rm6chrm#L3464 - it's another, unrelated branch). Is someone has any clues - please let me know. Note, that this PR should be merged anyway, even if those bugs aren't fixed - it already improves the portability and thread-safety. |
timezone |
I just ignore these timezone related fails. |
Ideally, the time decoding commands/functions in Rizin should not depend on the timezone. |
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.
I usually ignore those errors as well. They happen all the time on my machine.
Your checklist for this pull request
Detailed description
Some code was using thread-unsafe
localtime()
, some code was using non-portablegmtime_r()
. I created own portablerz_gmtime_r()
in analogy to existingrz_localtime_r()
and used it instead. Also removed unnecessary inline function from the header.Test plan
CI is green.
Closing issues
Might be related to #982 (comment)