WSL: grep 2.27 broken

I’ve been using an arch userspace for a while, and I had been able to build tmux and weechat from git in the past, but it seems like the new versions of grep (and maybe cmake) are causing failures while building tmux and weechat from git source.

Both tmux and weechat are failing to build from git, because cmake is spitting out garbage that looks like:

-- Found GCRYPT: grep: (standard input): Operation not permitted

Moreover, when I try to strace cmake, I get the following error

strace: PTRACE_SETOPTIONS: Invalid argument

which then locks up and can’t be killed with ctrl-c (not because of 15002, it also happened in 14986), so I’m having trouble pinning down exactly what operation is not permitted.

I made a big tarball of my arch rootfs, and I’m willing to host it on my own server for the devs, but I would like permission first, and instructions on who to e-mail a password and username to grab a copy. You should be able to just un-tar and chroot into it to test building weechat from git (git clone the repo, cd into the cloned repo, mkdir build, cd build, cmake …).

EDIT: Most recent post has narrowed this down to just two things. Looks like it’s not a glibc problem

`

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 22 (2 by maintainers)

Most upvoted comments

@therealkenc @fpqc Thank you for the investigations, they made our job much easier! For the grep issue, we have fixed the issue with splice() failing. The only test case that I saw failing was piping the output to /dev/null: ls | ./src/grep a > /dev/null, which now works after the fix. If you guys encounter any other failing test cases please let us know and we can try them out.

@fpqc thanks for the offer of the tarball, appreciate the help here. We should be able to repro this locally but will hit you up if we end up needing the tarball.

Not having control over Ubuntu releases is a tough situation; though, not really different than Ubuntu having no control over their upstream. Xenial won’t end-of-life until 2019, and you’d be hard pressed to find a specific credible “development use case” that requires Yakety or ZestyZapus right now or in the next few months. Plenty of “high priority” stuff (for some value of “high”) still broken in Trusty/Precise/Wily on WSL too (where grep works fine). OTOH, heading off the shower of duplicate issues and commensurate telemetry hits as people do-release-upgrade -d definitely has its own appeal.

Thanks for bringing this to our attention. I know @dethoma is aware of this and will assign somebody to investigate. I agree with @fpqc and @therealkenc that this is should be a high-priority issue since we do not have control over when Ubuntu may decide to update these packages.

Okay; best I can tell, strace broke with this change here on Nov 26, 2016, which first appeared in version 4.15 on Dec 14.

That PTRACE_O_TRACEEXIT ptrace(2) option was introduced in Linux 2.5.60 in 2003, but strace didn’t use it (AFAICT) until a couple of months ago. There could be secondary effects causing the eventual fail, but that’s the crux. Not related to Arch of course. 4.15 fails on WSL Xenial all the same.

4.14 (Oct 4, 2016) is good though. You can track down your cmake/grep (or possibly neither) related issue by running that version. On Arch do:

git clone https://github.com/strace/strace.git
cd strace
git checkout v4.14
./bootstrap
./configure
make
sudo make install

…then /usr/local/bin/strace -f <whatever>. Though, if Arch bleeds so bad as to be using a December strace, you could be hitting any number of things there (like glibc).

A whole Arch chroot is a pretty big repro nut. Can you get grep to fail in your Arch environment with Operation not permitted on its lonesome? Like say: echo hello | grep hello?

Also what version does strace -V give you? That might be notable, because if Arch strace is using a new PTRACE_SETOPTIONS it’ll eventually hit a Ubuntu release too.