-
Notifications
You must be signed in to change notification settings - Fork 60
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 ioctl_tree_execute() ret type and initialization #261
Conversation
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.
Thanks for spotting this! Do you want to fix it up yourself, or want me to take over?
Martin, I'm happy that you take over and fix it the way you want it. |
The umockdev-vala testcase randomly fails because the ioctl() testcase checks the return value pointed to by "ret" in ioctl_tree_execute() which might have stale data as it wasn't initialized. Fix it by always initializing the return code, forcing all code paths to provide a valid return code address, and fixing the VAPI declaration (it's purely an out argument). Co-Authored-By: Martin Pitt <[email protected]> https://bugs.debian.org/1091619
862d929
to
9211c6d
Compare
Thanks @hdeller ! I fixed the points above, and also cleaned up the commit message a bit. |
problem still happens on hppa build: |
With this patch testcase succeeds on hppa and s390x:
Update: UPDATE: |
The umockdev-vala testcase randomly fails on some platforms (hppa, sparc64, powerpc, see:[1][2][3]) because the ioctl() testcase checks the return value pointed to by "ret" in ioctl_tree_execute() which might have stale data as it wasn't initialized.
Fix it by properly initializing the return code.
Additionally force all code paths to provide a valid return code address.
Tested on hppa-linux and armhf-linux.
[1] https://buildd.debian.org/status/fetch.php?pkg=umockdev&arch=hppa&ver=0.19.0-1&stamp=1735373270&raw=0
[2] https://buildd.debian.org/status/fetch.php?pkg=umockdev&arch=powerpc&ver=0.19.0-1&stamp=1735375553&raw=0
[3] https://buildd.debian.org/status/fetch.php?pkg=umockdev&arch=sparc64&ver=0.19.0-1&stamp=1735380455&raw=0