Skip to content
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

Build failure: reptyr #292299

Closed
eclairevoyant opened this issue Feb 29, 2024 · 2 comments · Fixed by #292342
Closed

Build failure: reptyr #292299

eclairevoyant opened this issue Feb 29, 2024 · 2 comments · Fixed by #292342

Comments

@eclairevoyant
Copy link
Member

eclairevoyant commented Feb 29, 2024

Steps To Reproduce

Steps to reproduce the behavior:

  1. build reptyr on master (fdfe8b3)

Build log

`nix-build -A reptyr`
these 2 derivations will be built:
  /nix/store/hw61xfbrq39nc3rhg9940fwkws3jq91p-python3-3.11.8-env.drv
  /nix/store/vsa31jwx702s1vwhhbh3nnq6qca5dk9z-reptyr-0.10.0.drv
this path will be fetched (0.03 MiB download, 0.14 MiB unpacked):
  /nix/store/r2yc33xb93yh48x4jjw78yidm8sg28b1-source
copying path '/nix/store/r2yc33xb93yh48x4jjw78yidm8sg28b1-source' from 'https://cache.nixos.org'...
building '/nix/store/hw61xfbrq39nc3rhg9940fwkws3jq91p-python3-3.11.8-env.drv'...
created 221 symlinks in user environment
building '/nix/store/vsa31jwx702s1vwhhbh3nnq6qca5dk9z-reptyr-0.10.0.drv'...
Running phase: unpackPhase
unpacking source archive /nix/store/r2yc33xb93yh48x4jjw78yidm8sg28b1-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
build flags: SHELL=/nix/store/087167dfxal194pm54cmcbbxsfy3cjgn-bash-5.2p26/bin/bash PREFIX= DESTDIR=\$\(out\)
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o reptyr.o reptyr.c
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o reallocarray.o reallocarray.c
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o attach.o attach.c
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o platform/linux/linux_ptrace.o platform/linux/linux_ptrace.c
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o platform/linux/linux.o platform/linux/linux.c
gcc   reptyr.o reallocarray.o attach.o platform/linux/linux_ptrace.o platform/linux/linux.o   -o reptyr
Running phase: checkPhase
check flags: SHELL=/nix/store/087167dfxal194pm54cmcbbxsfy3cjgn-bash-5.2p26/bin/bash PREFIX= DESTDIR=\$\(out\) PYTHON_CMD=/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/bin/python3.11 test
gcc -MD -Wall -Werror -D_GNU_SOURCE -g    -c -o test/victim.o test/victim.c
gcc   test/victim.o   -o test/victim
/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/bin/python3.11 test/basic.py
hello
ECHO: hello
world
[+] Checking for problematic process group members...
[+] Making sure we have permission to attach...
[+] Using tty: /dev/pts/2
world
[-] Timed out waiting for child stop.
[+] Allocated scratch page: 7ffff7dd5000
[+] Looking up fds for tty in child.
[+] Resolved child tty: 8800
[-] Unable to stat /dev/console
[+] Found an alias for the tty: 0
[+] Found an alias for the tty: 1
[+] Found an alias for the tty: 2
[+] Opened the new tty in the child: 3
[+] Set the controlling tty
ECHO: world
final
/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/bin/python3.11 test/tty-steal.py
Unable to find `prctl.set_ptracer`, skipping `PR_SET_PTRACER`.
spawned children: me=88 victim=89 reptyr=90
world
[+] Making sure we have permission to attach...
[+] session leader of pid 89 = 89
[+] found terminal emulator process: 88
[+] Listening on socket: /tmp/reptyr.BmRgfy/reptyr.sock
[+] Attaching terminal emulator pid=88
Unable to attach to pid 89: Operation not permitted
The kernel denied permission while attaching. If your uid matches
the target's, check the value of /proc/sys/kernel/yama/ptrace_scope.
For more information, see /etc/sysctl.d/10-ptrace.conf
world
Traceback (most recent call last):
  File "/build/source/test/tty-steal.py", line 38, in <module>
    reptyr.expect("ECHO: world")
  File "/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/lib/python3.11/site-packages/pexpect/spawnbase.py", line 354, in expect
    return self.expect_list(compiled_pattern_list,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/lib/python3.11/site-packages/pexpect/spawnbase.py", line 383, in expect_list
    return exp.expect_loop(timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/lib/python3.11/site-packages/pexpect/expect.py", line 179, in expect_loop
    return self.eof(e)
           ^^^^^^^^^^^
  File "/nix/store/dq5vmdvn8v480m8wins4w350nf1qghcd-python3-3.11.8-env/lib/python3.11/site-packages/pexpect/expect.py", line 122, in eof
    raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7ffff745f4d0>
command: ./reptyr
args: ['./reptyr', '-V', '-T', '89']
buffer (last 100 chars): b''
before (last 100 chars): b'/proc/sys/kernel/yama/ptrace_scope.\r\nFor more information, see /etc/sysctl.d/10-ptrace.conf\r\nworld\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: 1
flag_eof: True
pid: 90
child_fd: 6
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: <_io.BufferedWriter name='<stdout>'>
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile(b'ECHO: world')
make: *** [Makefile:30: test] Error 1

Additional context

Notify maintainers

@7c6f434c

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here

Add a 👍 reaction to issues you find important.

@7c6f434c
Copy link
Member

Hm works for me… ah I have /proc/sys/kernel/yama/ptrace_scope as 0.

Well dunno, what we want, just kill the tests I guess?

@eclairevoyant
Copy link
Member Author

eclairevoyant commented Feb 29, 2024

Since it's a kernel param, if we care about tests, they could be handled as a nixos test instead. But I guess they should be disabled when building, yeah

@7c6f434c 7c6f434c mentioned this issue Feb 29, 2024
10 tasks
7c6f434c added a commit that referenced this issue Feb 29, 2024
Both use and testing require ptrace of non-child processes

Fixes: #292299
ReedClanton pushed a commit to ReedClanton/nixpkgs that referenced this issue Mar 4, 2024
Both use and testing require ptrace of non-child processes

Fixes: NixOS#292299
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants