[Bug ada/96590] New: testsuite spins forever on test_prio when run as root

lhyatt at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Aug 12 13:41:01 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96590

            Bug ID: 96590
           Summary: testsuite spins forever on test_prio when run as root
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lhyatt at gcc dot gnu.org
  Target Milestone: ---

Hello-

I ran into this trying to "make check" all languages, when run as root, the
test_prio.adb test never terminates. After 5 minutes it seems that dejagnu
tries to kill it, but the signal is ignored. This is on x86-64 linux, Ubuntu
18.04, current gcc 11 trunk. 

$ gcc -v:
Using built-in specs.
COLLECT_GCC=../release/bin/gcc
COLLECT_LTO_WRAPPER=/home/lewis/gccdev/release/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../git/configure --disable-multilib --enable-languages=all
--prefix=/home/lewis/gccdev/release --with-tune=native : (reconfigured)
../git/configure --disable-multilib --prefix=/home/lewis/gccdev/release
--with-tune=native
--enable-languages=c,ada,brig,c++,d,fortran,go,lto,objc,obj-c++ --no-create
--no-recursion : (reconfigured) ../git/configure --disable-multilib
--enable-languages=all --prefix=/home/lewis/gccdev/release --with-tune=native :
(reconfigured) ../git/configure --disable-multilib
--prefix=/home/lewis/gccdev/release --with-tune=native
--enable-languages=c,ada,brig,c++,d,fortran,go,lto,objc,obj-c++ --no-create
--no-recursion
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200810 (experimental) (GCC)

$ uname -a
Linux host 4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019 x86_64
x86_64 x86_64 GNU/Linux

$ /lib/x86_64-linux-gnu/libc.so.6
GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 7.3.0.
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<https://bugs.launchpad.net/ubuntu/+source/glibc/+bugs>.

$ cat /etc/issue
Ubuntu 18.04.2 LTS \n \l

To test it, I do: cd $objdir/gcc;  make -k check-gnat
RUNTESTFLAGS=dg.exp=test_prio\*

And observe the test_prio.exe runs forever. If I strace it, it's like this:
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
sched_setscheduler(32599, SCHED_OTHER, [0]) = 0
sched_setscheduler(32599, SCHED_OTHER, [99]) = -1 EINVAL (Invalid argument)
...


And if I get a backtrace, it's like this:
#0  0x00007feab01f8df7 in sched_setscheduler () at
../sysdeps/unix/syscall-template.S:78
#1  0x00007feab06fd2dc in __pthread_tpp_change_priority
(previous_prio=previous_prio@entry=-1, new_prio=new_prio@entry=99) at tpp.c:149
#2  0x00007feab06f59d0 in __pthread_mutex_cond_lock_full (mutex=0x18a43f8) at
../nptl/pthread_mutex_lock.c:541
#3  0x00007feab06f5f35 in __pthread_mutex_cond_lock
(mutex=mutex@entry=0x18a43f8) at ../nptl/pthread_mutex_lock.c:71
#4  0x00007feab06f7d9d in __pthread_cond_wait_common (abstime=0x7ffee1b75aa0,
mutex=0x18a43f8, cond=0x18a43c8) at pthread_cond_wait.c:645
#5  __pthread_cond_timedwait (cond=cond@entry=0x18a43c8,
mutex=mutex@entry=0x18a43f8, abstime=abstime@entry=0x7ffee1b75aa0) at
pthread_cond_wait.c:667
#6  0x0000000000422a45 in
system.task_primitives.operations.monotonic.timed_sleep (reason=<optimized
out>, mode=0, time=0.01, self_id=0x18a4280)
    at s-tpopmo.adb:194
#7  system.task_primitives.operations.timed_sleep
(self_id=self_id@entry=0x18a4280, time=time@entry=0.01, mode=mode@entry=0,
reason=<optimized out>)
    at s-taprop.adb:600
#8  0x000000000042de16 in system.tasking.stages.finalize_global_tasks () at
s-tassta.adb:867
#9  0x0000000000404667 in adafinal () at s-tassta.adb:1217
#10 0x0000000000404bbc in main () at s-tassta.adb:1217
#11 0x00007feab0116b97 in __libc_start_main (main=0x404b5c <main>, argc=1,
argv=0x7ffee1b75c08, init=<optimized out>, fini=<optimized out>,
    rtld_fini=<optimized out>, stack_end=0x7ffee1b75bf8) at
../csu/libc-start.c:310
#12 0x000000000040444a in _start () at s-tassta.adb:1217

Not sure if it is an issue in ada usage of pthreads or in pthread
implementation or my configuration, seems it gets into an infinite loop there?
When run as non-root, it terminates right away and prints "error", and test
passes, because the very first sched_setscheduler call returns -1 rather than
the 2nd. Does anyone else see the same? Thanks...

-Lewis


More information about the Gcc-bugs mailing list