Bug 489676

Summary: vgdb handle EINTR and EAGAIN more consistently
Product: [Developer tools] valgrind Reporter: Mark Wielaard <mark>
Component: generalAssignee: Mark Wielaard <mark>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: vgdb: Handle EINTR and EAGAIN more consistently

Description Mark Wielaard 2024-07-03 13:50:38 UTC
vgdb doesn't handle EINTR and EAGAIN very consistently. Sometimes when a signal arrives at the wrong time vgdb just errors out instead of retrying to read or write a package.
Comment 1 Mark Wielaard 2024-07-03 13:55:39 UTC
Created attachment 171330 [details]
vgdb: Handle EINTR and EAGAIN more consistently

vgdb: Handle EINTR and EAGAIN more consistently

Always handle EINTR or EAGAIN when calling read or write. Also be
consistent in the use of size_t and ssize_t for arguments and return
values.

This should make vgdb more robust against receiving signals or a
blocked pipe at the wrong time.
Comment 2 Mark Wielaard 2024-07-05 09:48:35 UTC
commit 646978d9adc5e334c10ad691f89421eb5c90541a
Author: Mark Wielaard <mark@klomp.org>
Date:   Wed Jul 3 15:51:06 2024 +0200

    vgdb: Handle EINTR and EAGAIN more consistently
    
    Always handle EINTR or EAGAIN when calling read or write. Also be
    consistent in the use of size_t and ssize_t for arguments and return
    values.
    
    This should make vgdb more robust against receiving signals or a
    blocked pipe at the wrong time.
    
    https://bugs.kde.org/show_bug.cgi?id=489676