Bedrock LinuxThis forum is for the discussion of Bedrock Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
bedrock. running bash from the devuan strata while booted in the devuan strata's init. man is installed.
Observe the following session
Code:
bob@moonshadow:~ $ man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`. To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ which strace
/usr/bin/strace
bob@moonshadow:~ $ brl which strace
devuan
bob@moonshadow:~ $ which gdb
/bedrock/cross/pin/bin/gdb
bob@moonshadow:~ $ brl which gdb
devuan
bob@moonshadow:~ $ brl list
arch
bedrock
devuan
bob@moonshadow:~ $ # booted off devuan, using devuan bash
bob@moonshadow:~ $ strat devuan man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`. To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $
Root has the same problem.
I have no idea what is going on. Can someone explain?
When you run `man man`, `strat` is being called under-the-hood. This is probably because your shell is from a different stratum than either `man` or something else called indirectly such as (per the error message) `sed` or `less`. This is normal.
When `strat` is called it performs a sanity check it, and in this instance it sees something is wrong. The specific issue it is running into usually happens when users try to ptrace across a strat call, which Linux disallows with normal user permissions. This is why you get that error message. However, you're clearly not calling a ptrace related command like strace or gdb. Off the top of my head I have no idea why that's happening.
However, the specific error message you're getting is very strange and we should debug that irrelevant of what how `strat -r` changes things. Try running:
Code:
strat devuan strace -tvf -s999 -o/tmp/log man man
Then provide the contents of /tmp/log.
Last edited by ParadigmComplex; 10-21-2019 at 07:39 AM.
Well, I feel like a dope for not trying the "-r" option with strat, because that clearly indicated what was going on:
Code:
bob@moonshadow:~ $ strat -r devuan man man
man: can't execute less: No such file or directory
man: command exited with status 255: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ which less
/bedrock/cross/bin/less
bob@moonshadow:~ $ brl which less
arch
bob@moonshadow:~ $
The fetch of the Devuan had never put the less package in. Oh.
Installed less. Ran "man man". No error, and the page displayed as was proper. This would indicate that maybe the devuan fetch should add the less package?
Maybe.
Then a dim memory came to the surface of my mind. I'd copied my .bashrc from my regular system. I took a look through it and found these two lines of interest:
Code:
export MANPAGER='less -X'
export PAGER='less -X'
So, I then removed the less package, took those lines out of my .bashrc, logged out & in, then typed "man man" again. Bam, Worked fine.
edit: I did also run your second command. the output was 3k, which is probably too large to fit in a post? In view of what I've shown, you probably don't need it now?
edit 2: my understanding is that this is a situation of one binary calling another, not a library call, and that bedrock usually handles this. So even though i had man calling a program (less) that does not exist, should it have just quietly ran the less that is in the other strata?
Last edited by jr_bob_dobbs; 10-21-2019 at 05:30 PM.
If you had another less executable, it should have just transparently used that. If you didn't, it should have given a proper error about not being able to find `less`. Neither of these explain you getting this error:
Quote:
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`. To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
And so I'm still interested in the strace output I previously requested. Make sure to produce it where `less` isn't installed and those variables exist and you see the above error message.
bob@moonshadow:~ $ man man
strat: wrong cap_sys_chroot capability.
This may occur when using ptrace across stratum boundaries such as with
`strace` or `gdb`. To remedy this install strace/gdb/etc from same stratum
as the traced program and use `strat` to specify appropriate strace/gdb/etc.
man: command exited with status 1: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | LESS=-ix8RmPm Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page man(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$ MAN_PN=man(1) less -X
bob@moonshadow:~ $ /bedrock/bin/strat --arg0 less arch /usr/bin/less -X
Missing filename ("less --help" for help)
bob@moonshadow:~ $ /bedrock/bin/strat --arg0 less arch /usr/bin/less -X test.txt
Designed to be a small text file, so that one can see errors before.
bob@moonshadow:~ $ strat -r arch less
Missing filename ("less --help" for help)
bob@moonshadow:~ $ less
Missing filename ("less --help" for help)
bob@moonshadow:~ $ strat -r arch man man
strat: could not run
man
from stratum
arch
due to: unable to find file (ENOENT)
bob@moonshadow:~ $
bob@moonshadow:~ $ brl which /bedrock/cross/bin/less
arch
bob@moonshadow:~ $ echo "test" | strat devuan /bedrock/cross/bin/less -X
test
bob@moonshadow:~ $
Code:
root@moonshadow:~ # apt-get install libcap2-bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
libcap2-bin is already the newest version (1:2.25-2).
libcap2-bin set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@moonshadow:~ #
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.