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

reached unreachable code (in VM) #31

Open
peterwaller-arm opened this issue Jun 21, 2023 · 5 comments
Open

reached unreachable code (in VM) #31

peterwaller-arm opened this issue Jun 21, 2023 · 5 comments

Comments

@peterwaller-arm
Copy link

peterwaller-arm commented Jun 21, 2023

I just tried running this in a VM where the counters are unavailable and got the following output:

$ ./poop echo
poop [1/1] 'echo'... thread 305373 panic: reached unreachable code
Unable to dump stack trace: debug info stripped
Aborted (core dumped)

I was hoping I might use some functionality of the program even if counters are unavailable. I am making an assumption that the problem is caused by the lack of counters; in an attempt to learn more detail, I was unable to build this using zig 0.10 on nix, I got an error about std.Build not being defined.

@Avokadoen
Copy link

You probably want to use the master branch when building
Also, does ./poop --help work? Seems like you are missing command arguments

@peterwaller-arm
Copy link
Author

You probably want to use the master branch when building Also, does ./poop --help work? Seems like you are missing command arguments

Sorry -- I have edited it in situ (previously read ./poop without echo, I must have dropped it accidentally). I wasn't able to quickly get my hands on the master branch (of either zig nor poop), but hoped this information may nonetheless be useful even if it's just for a binary taken from the github releases.

@kassane
Copy link

kassane commented Aug 7, 2023

In docker (non-privileged) CI/CD, try running:

root@083728cd359b:/data# ./zig-out/bin/poop 'ls' 'ls -lh'
thread 8 panic: unable to open perf event: PermissionDenied

/home/kassane/zig/0.12.0-dev.17+49244dc0c/files/lib/std/io/fixed_buffer_stream.zig:0:13: 0x27f152 in panicExtra__anon_6850 (poop)
/home/kassane/zig/0.12.0-dev.17+49244dc0c/files/lib/std/debug.zig:347:15: 0x27df75 in panic__anon_4569 (poop)
/home/kassane/Documentos/poop/src/main.zig:203:36: 0x2226c3 in main (poop)
/home/kassane/zig/0.12.0-dev.17+49244dc0c/files/lib/std/start.zig:574:37: 0x218777 in posixCallMainAndExit (poop)
/home/kassane/zig/0.12.0-dev.17+49244dc0c/files/lib/std/start.zig:243:5: 0x2181b1 in _start (poop)
???:?:?: 0x2 in ??? (???)
Unwind information for `???:0x2` was not available, trace may be incomplete

Aborted (core dumped)

maybe, needs capabilities?

@kassane
Copy link

kassane commented Aug 11, 2023

maybe, needs capabilities?

For me works (locally) using --cap-add CAP_PERFMON in docker run.

updated

@peterwaller-arm
Copy link
Author

I think I'm hitting #17 (comment) which is that there is nothing I can do from within a VM (or at least one which doesn't support the counters) to make that syscall work.

I might have hoped either:

  • A useful error message telling me what went wrong.
  • Some level of useful functionality in the absence of counters. If this is a sensible thing to want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants