#1050415 PermissionError: [Errno 13] Permission denied

Package:
cvise
Source:
cvise
Description:
super-parallel Python port of the C-Reduce project
Submitter:
Mathieu Malaterre
Date:
2023-08-25 07:39:08 UTC
Severity:
normal
#1050415#5
Date:
2023-08-24 09:54:53 UTC
From:
To:
I cannot run cvise in Debian/sid:

% cvise check.sh testcase.i
00:00:07 INFO ===< 150150 >===
00:00:07 INFO running 4 interestingness tests in parallel
00:00:07 INFO INITIAL PASSES
00:00:07 INFO ===< IncludesPass >===
Traceback (most recent call last):
  File "/usr/bin/cvise", line 312, in <module>
    reducer.reduce(pass_group, skip_initial=args.skip_initial_passes)
  File "/usr/share/cvise/cvise.py", line 149, in reduce
    self._run_additional_passes(pass_group['first'])
  File "/usr/share/cvise/cvise.py", line 172, in _run_additional_passes
    self.test_manager.run_pass(p)
  File "/usr/share/cvise/utils/testing.py", line 530, in run_pass
    success_env = self.run_parallel_tests()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/cvise/utils/testing.py", line 438, in run_parallel_tests
    with pebble.ProcessPool(max_workers=self.parallel_tests) as pool:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/process.py", line
60, in __init__
    self._pool_manager = PoolManager(self._context, mp_context)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/process.py", line
202, in __init__
    self.worker_manager = WorkerManager(context.workers,
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/process.py", line
344, in __init__
    self.pool_channel, self.workers_channel = channels(mp_context)
                                              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/channel.py", line
35, in channels
    WorkerChannel(read0, write1, (read1, write0), mp_context))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/channel.py", line
83, in __init__
    self.mutex = ChannelMutex(mp_context)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/pebble/pool/channel.py", line
129, in __init__
    self.reader_mutex = mp_context.RLock()
                        ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/context.py", line 73, in RLock
    return RLock(ctx=self.get_context())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 187,
in __init__
    SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
  File "/usr/lib/python3.11/multiprocessing/synchronize.py", line 57,
in __init__
    sl = self._semlock = _multiprocessing.SemLock(
                         ^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied


with:

% ls -al check.sh
-rwxr-xr-x 1 mathieu mathieu 335 Aug 24 09:50 check.sh

% ls -al testcase.i
-rw-r--r-- 1 mathieu mathieu 4268253 Aug 24 09:41 testcase.i

#1050415#10
Date:
2023-08-24 09:58:38 UTC
From:
To:
For reference, creduce seems to be happy with the exact same settings:

 % creduce check.sh testcase.i
===< 150190 >===
running 3 interestingness tests in parallel
===< pass_unifdef :: 0 >===
===< pass_comments :: 0 >===
===< pass_ifs :: 0 >===
===< pass_includes :: 0 >===
===< pass_line_markers :: 0 >===
===< pass_blank :: 0 >===
===< pass_clang_binsrch :: replace-function-def-with-decl >===
(0.1 %, 4263044 bytes)
(0.2 %, 4260250 bytes)
(0.3 %, 4256026 bytes)
(0.4 %, 4252741 bytes)
(0.4 %, 4251437 bytes)
(0.4 %, 4249928 bytes)
(0.5 %, 4248101 bytes)
(0.5 %, 4246010 bytes)
(0.5 %, 4245334 bytes)
(0.6 %, 4244584 bytes)
(0.6 %, 4243457 bytes)
(0.6 %, 4242382 bytes)
(0.6 %, 4241737 bytes)
(0.6 %, 4240846 bytes)
(0.7 %, 4240150 bytes)
(0.7 %, 4239316 bytes)
(0.7 %, 4238448 bytes)
(0.7 %, 4237766 bytes)
(0.7 %, 4237353 bytes)
(0.7 %, 4236623 bytes)
[...]

#1050415#15
Date:
2023-08-24 12:17:16 UTC
From:
To:
Control: tags -1 + moreinfo

[...]

an ls is not so useful.

#1050415#22
Date:
2023-08-24 13:15:31 UTC
From:
To:
Ok, nevermind. I assumed this was something obvious in the python module.

Here you go:

$ curl -O https://raw.githubusercontent.com/malaterre/gcc-110622/main/new/testcase.i
$ curl -O https://raw.githubusercontent.com/malaterre/gcc-110622/main/new/check.sh
$ chmod +x check.sh
$ schroot -c sid32
$ cvise check.sh testcase.i

If you do not have a sid32 chroot, you may want to use
barriere.debian.org + sid_i386-dchroot

for reference:

% apt-cache policy cvise
cvise:
  Installed: 2.8.0-1
  Candidate: 2.8.0-1
  Version table:
 *** 2.8.0-1 500
        500 http://deb.debian.org/debian sid/main i386 Packages
        100 /var/lib/dpkg/status

and

% apt-cache policy creduce
creduce:
  Installed: 2.11.0~20230819-1
  Candidate: 2.11.0~20230819-1
  Version table:
 *** 2.11.0~20230819-1 500
        500 http://deb.debian.org/debian sid/main i386 Packages
        100 /var/lib/dpkg/status

#1050415#27
Date:
2023-08-24 17:02:51 UTC
From:
To:
Control: tags -1 - moreinfo

that works for me in a sid32 chroot, and also in a sid chroot.

#1050415#34
Date:
2023-08-25 06:32:03 UTC
From:
To:
I see this is exactly:

https://stackoverflow.com/questions/2009278/python-multiprocessing-permission-denied

In my case:

% ls -ld /dev/shm
drwxr-xr-x 2 root root 40 Aug 24 11:31 /dev/shm

on barriere.d.o:

% ls -ld /dev/shm
drwxrwxrwt 2 root root 40 Aug 25 06:28 /dev/shm


How did you setup your schroot ? Mine is:

% cat /etc/schroot/schroot.conf
[...]
[sid32]
description=Debian sid (unstable) 32-bit
directory=/home/mathieu/tmp/sid-chroot-i386
personality=linux32
root-groups=root
root-users=root
type=directory
users=mathieu

#1050415#39
Date:
2023-08-25 07:37:07 UTC
From:
To:
attached the reduced testcase.

just a chroot created with sbuild:

[sid-i386]
description=sid-i386
groups=sbuild,root
root-groups=sbuild,root
# Uncomment these lines to allow members of these groups to access
# the -source chroots directly (useful for automated updates, etc).
#source-root-users=sbuild,root
#source-root-groups=sbuild,root
type=directory
profile=sbuild
union-type=overlay
directory=/var/lib/schroot/chroots/sid-i386
personality=linux32
aliases=unstable-i386
source-root-users=root,sbuild,admin
source-root-groups=root,sbuild,admin
preserve-environment=true