Your message dated Fri, 25 Aug 2023 12:16:13 +0100
with message-id <[email protected]>
and subject line pagein: Segfaults roughly every 1 in ten executions
has caused the Debian Bug report #865341,
regarding pagein: Segfaults roughly every 1 in ten executions
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
865341: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=865341
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: pagein
Version: 0.00.03-1
Severity: important

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Ben Wiederhake <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: pagein: Segfaults roughly every 1 in ten executions
Message-ID: <149796559606.22041.12836038062408551702.reportbug@bewied-eeepc>
X-Mailer: reportbug 7.1.7
Date: Tue, 20 Jun 2017 15:33:16 +0200

Package: pagein
Version: 0.00.03-1
Severity: normal

Dear Maintainer,

How to reproduce:

    user@machine:/$ sudo -s
    root@machine:/# pagein -a -v
    root@machine:/# pagein -a -v
    root@machine:/# pagein -a -v
    root@machine:/# pagein -a -v
                    # You get the idea.

Expected results:
Runs without issues, as described in the man page

Actual results:
Sometimes, it crashed without apparent reason.

Potentially relevant:
- 'pagein -a' also crashes, and more reliably.
- Architecture is i686.
- 1 GiB of physical RAM, and "swap in use" is greater than "mem free" according 
to /usr/bin/free
  (I know, that just shuffles around the pages; but still, it shouldn't 
segfault.)
- Running this on a specific process, e.g. smartd (which runs as root,
  and happened to be PID 510 during my tests) also exhibits the bug.
- Running this on a specific "luser" process as non-root also exhibits the bug.
- Adding a bit of printf debugging reveals which process it's looking at when 
it crashes:
  Sample from three attempts: smartd (510), policykit (574), reportbug (22041), 
exim4 (907)
  I don't see any pattern.
- Recompiling from source (apt-get source and 'make' instead of using Debian 
tools)
  also segfaults.  I have the impression that it's more seldom, but that may be 
subjective.
- Running this in gdb apparently "fixes it".
  (Set a breakpoint on exit with 'run -p 510 -v', fetch a cup of hot chocolate,
  see that it doesn't crash even after a hundred runs.)
- Running this in valgrind apparently "fixes it".
- Apparently valgrind and gdb change the timing a bit, and the segfault is due 
to a race
  condition of some kind.  That could even explain the slight increase in 
reliability after adding
  printf's into the loop of 'pagein_all_procs'.
- If that's the case, then '--show-mismatched-frees=no --keep-stacktraces=none 
--leak-resolution=low'
  doesn't make valgrind fast enough to cause the segfault there.
- Doing some printf-debugging, it seems that it always crashes "towards the 
end", but still in 'pagein_proc'.
  Any further printf-debugging slows the program down sufficiently to prevent 
it from crashing.

What else could I test?

Cheers,
Ben Wiederhake

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 4.9.0-3-686-pae (SMP w/2 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8), 
LANGUAGE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pagein depends on:
ii  libc6  2.24-11

pagein recommends no packages.

pagein suggests no packages.

-- no debconf information

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages pagein depends on:
ii  libc6  2.24-11

pagein recommends no packages.

pagein suggests no packages.

--- End Message ---
--- Begin Message ---
This has been fixed in two ways:

commit 4f91b3f5803965337b6d2f2d2022fa299c37294c
Author: Colin Ian King <[email protected]>
Date:   Sat Jan 13 23:10:24 2018 +0000

    Rework, just use ptrace memory peeking to force pages in

This no longer touches pages directly to force them in.

commit baddb8346dec9dd8502375a766ee55777df2a210
Author: Colin Ian King <[email protected]>
Date:   Wed Jun 21 07:51:02 2017 +0100

    Add SEGV handler and fix length calculation

Catch SEGVs if they every happen.

Version V0.01.00 includes these two fixes. I've tried to duplicate the issue with the latest pagein with the same kind of configuration as reported in the initial bug report and cannot now reproduce the issue, so I believe it is now fixed.

Colin

--- End Message ---

Reply via email to