Bug 508779

Summary: PRE(sys_prlimit64): reorder check for memory validity
Product: [Developer tools] valgrind Reporter: Matthias Schwarzott <zzam>
Component: memcheckAssignee: Paul Floyd <pjfloyd>
Status: RESOLVED FIXED    
Severity: normal CC: mark, pjfloyd
Priority: NOR    
Version First Reported In: 3.25 GIT   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: reorder the checks in prlimit64 syscall-wrapper
reorder the checks in prlimit64 syscall-wrapper (V2)

Description Matthias Schwarzott 2025-08-26 19:30:29 UTC
Created attachment 184481 [details]
reorder the checks in prlimit64 syscall-wrapper

Reorder checks in PRE(sys_prlimit64) so that all memory issues are shown and not only the first.

The patch is applied on top of the patches from #508777 and #508776
Comment 1 Mark Wielaard 2025-08-28 10:36:01 UTC
Not against this patch, but are you sure people really want to see all the bad arguments to a syscall at once?

Not a fan of the testcase. But you already noticed that in other patches.
If possible please remove some whitespace to get the linenumbers to line up again?
Or maybe introduce a filter as you did for the linux-amd64 case?
Comment 2 Matthias Schwarzott 2025-08-28 18:21:37 UTC
At least I am happy if valgrind shows all errors it can detect.

I actually like the idea of the scalar tests as they at least call each syscall-wrapper with a bit of variation. I hope the remaining part of the syscall-wrappers is covered well by other tests.
I will add a filter to remove the line-numbers as in the amd64 case in a separate ticket.
Comment 3 Paul Floyd 2025-08-28 19:15:51 UTC
I prefer all errors.

That way users that want to can see and fix everything in one go.

If we hide errors due to syscall failure that means that the user needs  to get the syscall working first and only then be informed of an initialisation or addressability error.
Comment 4 Matthias Schwarzott 2025-08-28 20:34:46 UTC
Created attachment 184538 [details]
reorder the checks in prlimit64 syscall-wrapper (V2)

Updated the patch to be applied after https://bugs.kde.org/show_bug.cgi?id=508777 and https://bugs.kde.org/show_bug.cgi?id=508869 and https://bugs.kde.org/show_bug.cgi?id=508778
Comment 5 Paul Floyd 2025-08-29 19:44:38 UTC
Thanks again.

commit 700e78f257ad161b4bd040de2d6bd9f1de4ff0b2 (HEAD -> master, origin/master, origin/HEAD)
Author: Matthias Schwarzott <zzam@gentoo.org>
Date:   Sat Aug 23 13:37:46 2025 +0200

    Bug 508779 - PRE(sys_prlimit64): reorder check for memory validity
    
    so all errors are displayed and not just the first