https://bugs.kde.org/show_bug.cgi?id=419562

            Bug ID: 419562
           Summary: PR_SET_PTRACER error with Ubuntu on WSL
           Product: valgrind
           Version: unspecified
          Platform: MS Windows
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: e...@ozhiker.com
  Target Milestone: ---

Created attachment 127224
  --> https://bugs.kde.org/attachment.cgi?id=127224&action=edit
Possible fix by falling back to alternate PR_SET_PTRACER call

SUMMARY
When running Ubuntu 18.04 on Windows-Subsystem-for-Linux (WSL), 
I have noticed the following error during every run of Valgrind:

error calling PR_SET_PTRACER, vgdb might block

STEPS TO REPRODUCE
1. Use Ubuntu 18.04 on WSL 
2. Build Valgrind from git 
   ./autogen.sh && ./configure && make -j8 --quiet check
3. Run valgrind against any program:
   VALGRIND_LIB=./.in_place VALGRIND_LIB_INNER=./.in_place/
./coregrind/valgrind pwd

OBSERVED RESULT
  error calling PR_SET_PTRACER, vgdb might block

EXPECTED RESULT
  no error

SOFTWARE/OS VERSIONS
Windows: 10 (1909) 10.0.18363.720
Linux: Ubuntu 18.04 on WSL 
Valgrind: 3.16.0.GIT

ADDITIONAL INFORMATION

This is caused by a bug in noted in the following stack overflow: 
 
https://stackoverflow.com/questions/57206233/valgrind-showing-error-calling-pr-set-ptracer-vgdb-might-block

It was logged with Microsoft as:
  https://github.com/microsoft/WSL/issues/3053

It has apparently been fixed in WSL build 17723: 
  https://docs.microsoft.com/en-us/windows/wsl/release-notes#build-17723-fast  

However it seems that it has not yet reached Windows Update (despite my PC
being at build 18363)

The error comes from VG_(set_ptracer)() in coregrind/m_gdbserver/remote-utils.c
It appears that the following call fails:
    ret = VG_(prctl) (PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
But if the following alternate line is enabled, the call succeeds:
    ret = VG_(prctl) (PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);

I believe we could work around this by just failing-over from the first prctl
to the second. 
I will submit a patch which does that.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to