Bug 296116 - /usr/src/tests/sys/kern/aslr.c:112: failed to find /sbin/ping text segment
Summary: /usr/src/tests/sys/kern/aslr.c:112: failed to find /sbin/ping text segment
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Dag-Erling Smørgrav
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-17 17:17 UTC by Enji Cooper
Modified: 2026-07-07 21:01 UTC (History)
3 users (show)

See Also:
des: mfc-stable15+
des: mfc-stable14+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Enji Cooper freebsd_committer freebsd_triage 2026-06-17 17:17:26 UTC
This seems to be a regression of https://cgit.freebsd.org/src/commit/?id=ebb0ea9f4f599be267641e630ea48279e4f531d1 (this is happening on other branches as well, like stable/15).

From https://ci.freebsd.org/job/FreeBSD-main-amd64-test/28808/testReport/ :

/usr/src/tests/sys/kern/aslr.c:112: failed to find /sbin/ping text segment
Standard Output
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.102 ms
Standard Error
Test case metadata
------------------

allowed_architectures is empty
allowed_platforms is empty
description is empty
execenv is empty
execenv_jail_params is empty
has_cleanup = false
is_exclusive = false
required_configs = unprivileged_user
required_disk_space = 0
required_files is empty
required_kmods is empty
required_memory = 0
required_programs is empty
required_user = root
timeout = 300

Timing information
------------------

Start time: 2026-06-17T12:17:29.307384Z
End time:   2026-06-17T12:17:29.815743Z
Duration:   0.508s

Original stderr
---------------

<EMPTY>
Comment 1 Enji Cooper freebsd_committer freebsd_triage 2026-06-17 17:18:51 UTC
Ah, I missed that the test was added in that commit. Ok, that all makes sense...
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2026-06-17 17:20:53 UTC
This is a race in the test, the child hasn't execve()ed the new image at the time that the parent looks for the base address.
Comment 3 Enji Cooper freebsd_committer freebsd_triage 2026-06-18 21:39:19 UTC
(In reply to Mark Johnston from comment #2)

Thank you Mark for picking this up -- let me know if I can help in the review.
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-06-22 13:27:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=080a4087014e1d19136cc77028019d98b5c69e1e

commit 080a4087014e1d19136cc77028019d98b5c69e1e
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 13:23:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-22 13:23:48 +0000

    tests: Fix race condition in aslr_setuid

    Use a cloexec pipe to block the parent until the child is ready.

    While here, redirect the output from ping to /dev/null, and mark the
    test as requiring the inet feature since we ping the IPv4 loopback.

    PR:             296116
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57734

 tests/sys/kern/Makefile |  1 +
 tests/sys/kern/aslr.c   | 16 +++++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2026-06-23 15:21:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=86950cf9ffe89b7978fca019019692b3ea492044

commit 86950cf9ffe89b7978fca019019692b3ea492044
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-23 15:20:26 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-23 15:20:38 +0000

    tests: Fix race condition in aslr_setuid, take 2

    Instead of a cloexec pipe, ingest ping's stdout and block until it has
    printed its initial summary, then close the pipe and return to the main
    test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

    PR:             296116
    MFC after:      1 week
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57763

 tests/sys/kern/aslr.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2026-07-03 19:29:48 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=81cf9a0ca765b48a430da61c221be17c4d0f753a

commit 81cf9a0ca765b48a430da61c221be17c4d0f753a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-03 19:28:22 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-07-03 19:28:30 +0000

    tests/aslr: Fix spurious test failures

    /sbin/ping and /sbin/ping6 are hard-linked, and the vmmap sysctl handler
    doesn't know which name was used to launch the process.

    PR:             296116
    MFC after:      3 days
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")

 tests/sys/kern/aslr.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:57:57 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4336554f94cf11c106a3fb5d2b77fdcfb9ab571e

commit 4336554f94cf11c106a3fb5d2b77fdcfb9ab571e
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-03 19:28:22 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:07:16 +0000

    tests/aslr: Fix spurious test failures

    /sbin/ping and /sbin/ping6 are hard-linked, and the vmmap sysctl handler
    doesn't know which name was used to launch the process.

    PR:             296116
    MFC after:      3 days
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")

    (cherry picked from commit 81cf9a0ca765b48a430da61c221be17c4d0f753a)

 tests/sys/kern/aslr.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:57:58 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8adf49dac1a937c9a8dc6937d6d23af14df7597a

commit 8adf49dac1a937c9a8dc6937d6d23af14df7597a
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 13:23:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:06:55 +0000

    tests: Fix race condition in aslr_setuid

    Use a cloexec pipe to block the parent until the child is ready.

    While here, redirect the output from ping to /dev/null, and mark the
    test as requiring the inet feature since we ping the IPv4 loopback.

    PR:             296116
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57734

    (cherry picked from commit 080a4087014e1d19136cc77028019d98b5c69e1e)

    tests: Fix race condition in aslr_setuid, take 2

    Instead of a cloexec pipe, ingest ping's stdout and block until it has
    printed its initial summary, then close the pipe and return to the main
    test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

    PR:             296116
    MFC after:      1 week
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57763

    (cherry picked from commit 86950cf9ffe89b7978fca019019692b3ea492044)

 tests/sys/kern/Makefile |  1 +
 tests/sys/kern/aslr.c   | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:57:59 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8adf49dac1a937c9a8dc6937d6d23af14df7597a

commit 8adf49dac1a937c9a8dc6937d6d23af14df7597a
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 13:23:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:06:55 +0000

    tests: Fix race condition in aslr_setuid

    Use a cloexec pipe to block the parent until the child is ready.

    While here, redirect the output from ping to /dev/null, and mark the
    test as requiring the inet feature since we ping the IPv4 loopback.

    PR:             296116
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57734

    (cherry picked from commit 080a4087014e1d19136cc77028019d98b5c69e1e)

    tests: Fix race condition in aslr_setuid, take 2

    Instead of a cloexec pipe, ingest ping's stdout and block until it has
    printed its initial summary, then close the pipe and return to the main
    test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

    PR:             296116
    MFC after:      1 week
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57763

    (cherry picked from commit 86950cf9ffe89b7978fca019019692b3ea492044)

 tests/sys/kern/Makefile |  1 +
 tests/sys/kern/aslr.c   | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
Comment 10 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:59:00 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=19a4967946855bb3941382a1a1ccf3c7c1d5a1f3

commit 19a4967946855bb3941382a1a1ccf3c7c1d5a1f3
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 13:23:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:07:55 +0000

    tests: Fix race condition in aslr_setuid

    Use a cloexec pipe to block the parent until the child is ready.

    While here, redirect the output from ping to /dev/null, and mark the
    test as requiring the inet feature since we ping the IPv4 loopback.

    PR:             296116
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57734

    (cherry picked from commit 080a4087014e1d19136cc77028019d98b5c69e1e)

    tests: Fix race condition in aslr_setuid, take 2

    Instead of a cloexec pipe, ingest ping's stdout and block until it has
    printed its initial summary, then close the pipe and return to the main
    test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

    PR:             296116
    MFC after:      1 week
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57763

    (cherry picked from commit 86950cf9ffe89b7978fca019019692b3ea492044)

 tests/sys/kern/Makefile |  1 +
 tests/sys/kern/aslr.c   | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
Comment 11 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:59:01 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=478d81e72eaae3276c4670e0054385b5e4e1f031

commit 478d81e72eaae3276c4670e0054385b5e4e1f031
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2026-07-03 19:28:22 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:08:03 +0000

    tests/aslr: Fix spurious test failures

    /sbin/ping and /sbin/ping6 are hard-linked, and the vmmap sysctl handler
    doesn't know which name was used to launch the process.

    PR:             296116
    MFC after:      3 days
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")

    (cherry picked from commit 81cf9a0ca765b48a430da61c221be17c4d0f753a)

 tests/sys/kern/aslr.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
Comment 12 commit-hook freebsd_committer freebsd_triage 2026-07-07 20:59:02 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=19a4967946855bb3941382a1a1ccf3c7c1d5a1f3

commit 19a4967946855bb3941382a1a1ccf3c7c1d5a1f3
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-22 13:23:31 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-07-07 07:07:55 +0000

    tests: Fix race condition in aslr_setuid

    Use a cloexec pipe to block the parent until the child is ready.

    While here, redirect the output from ping to /dev/null, and mark the
    test as requiring the inet feature since we ping the IPv4 loopback.

    PR:             296116
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57734

    (cherry picked from commit 080a4087014e1d19136cc77028019d98b5c69e1e)

    tests: Fix race condition in aslr_setuid, take 2

    Instead of a cloexec pipe, ingest ping's stdout and block until it has
    printed its initial summary, then close the pipe and return to the main
    test loop.  Run ping in quiet mode so it won't mind that stdout is gone.

    PR:             296116
    MFC after:      1 week
    Fixes:          080a4087014e ("tests: Fix race condition in aslr_setuid")
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D57763

    (cherry picked from commit 86950cf9ffe89b7978fca019019692b3ea492044)

 tests/sys/kern/Makefile |  1 +
 tests/sys/kern/aslr.c   | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)