[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#935750: marked as done (libgcc-9-dev: The futex facility returned an unexpected error code)



Your message dated Thu, 05 Sep 2019 05:19:11 +0000
with message-id <E1i5kAp-0009pd-Jy@fasolo.debian.org>
and subject line Bug#935750: fixed in gcc-9 9.2.1-7
has caused the Debian Bug report #935750,
regarding libgcc-9-dev: The futex facility returned an unexpected error code
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
935750: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935750
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libgcc-9-dev
Version: 9.2.1-4
Severity: normal

Dear Maintainer,

The following error occurs running "test-z3 -a" while building the z3 package:
PASS
(test hashtable :time 0.00 :before-memory 2630.62 :after-memory 2630.62)
The futex facility returned an unexpected error code.
make[1]: *** [debian/rules:130: override_dh_auto_test] Aborted
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:24: build-arch] Error 2

We have the following backtrace:
Breakpoint 3, futex_fatal_error () at ../sysdeps/nptl/futex-internal.h:200
200     ../sysdeps/nptl/futex-internal.h: No such file or directory.
(gdb) bt
#0  futex_fatal_error () at ../sysdeps/nptl/futex-internal.h:200
#1  futex_abstimed_wait_cancelable (private=1, abstime=0x0, expected=1,
    futex_word=<optimized out>)
    at ../sysdeps/unix/sysv/linux/futex-internal.h:223
#2  do_futex_wait (sem=<optimized out>, abstime=0x0) at sem_waitcommon.c:115
#3  0xf88048f4 in __new_sem_wait_slow (sem=0x1, abstime=0x0)
    at sem_waitcommon.c:282
#4  0xf78c4fe4 in omp_set_nest_lock ()
   from /usr/lib/hppa-linux-gnu/libgomp.so.1
#5  0x0152b658 in mpn_manager::div (this=0x1b7f6ac, numer=0x1b7f96c, lnum=4,
    denom=0x1b7f8cc, lden=1, quot=0x1b7f94c, rem=0x1b7f8ac)
    at ../src/util/mpn.cpp:156
#6  0x01553da4 in mpz_manager<true>::quot_rem_core<1> (this=0x1b7f49c, a=...,
    b=..., q=..., r=...) at ../src/util/mpz.cpp:498
#7  0x01541c8c in mpz_manager<true>::big_rem (this=0x1b7f49c, a=..., b=...,
    c=...) at ../src/util/mpz.cpp:546
#8  0x0002e654 in mpz_manager<true>::rem (this=0x1b7f49c, a=..., b=..., c=...)
    at ../src/util/mpz.h:459
#9  0x01542cac in mpz_manager<true>::gcd (this=0x1b7f49c, a=..., b=..., c=...)
    at ../src/util/mpz.cpp:749
#10 0x0002d708 in mpq_manager<true>::gcd (this=0x1b7f49c, a=..., b=..., c=...)
    at ../src/util/mpq.h:594
#11 0x0002c814 in mpq_manager<true>::normalize (this=0x1b7f49c, a=...)
--Type <RET> for more, q to quit, c to continue without paging--
    at ../src/util/mpq.h:58
#12 0x0155d5a8 in mpq_manager<true>::set (this=0x1b7f49c, a=...,
    val=0x157cce0 "1", '0' <repeats 33 times>, "1") at ../src/util/mpq.cpp:278
#13 0x00029cc4 in rational::rational (this=0xf8f02e88,
    v=0x157cce0 "1", '0' <repeats 33 times>, "1") at ../src/util/rational.h:55
#14 0x0002962c in tst_rational () at ../src/test/rational.cpp:460
#15 0x00145398 in main (argc=2, argv=0xf8f02028) at ../src/test/main.cpp:138
(gdb) disass
Dump of assembler code for function do_futex_wait:
   0xf88046f0 <+0>:     stw rp,-14(sp)
   0xf88046f4 <+4>:     ldo 80(sp),sp
   0xf88046f8 <+8>:     stw r5,-74(sp)
   0xf88046fc <+12>:    stw r4,-70(sp)
   0xf8804700 <+16>:    copy r19,r4
   0xf8804704 <+20>:    stw r19,-20(sp)
   0xf8804708 <+24>:    stw r3,-6c(sp)
   0xf880470c <+28>:    ldw 4(r26),r3
   0xf8804710 <+32>:    b,l 0xf88055a4 <__pthread_enable_asynccancel>,rp
   0xf8804714 <+36>:    stw r26,-78(sp)
   0xf8804718 <+40>:    ldw -78(sp),r26
   0xf880471c <+44>:    copy r4,r19
   0xf8804720 <+48>:    copy ret0,r5
   0xf8804724 <+52>:    ldi -1,r21
   0xf8804728 <+56>:    ldi 0,r22
   0xf880472c <+60>:    ldi 0,r23
   0xf8804730 <+64>:    ldi 1,r24
   0xf8804734 <+68>:    ldi 189,r25
   0xf8804738 <+72>:    xor r3,r25,r25
   0xf880473c <+76>:    copy r19,r4
   0xf8804740 <+80>:    be,l 100(sr2,r0),sr0,r31
   0xf8804744 <+84>:    ldi d2,r20
--Type <RET> for more, q to quit, c to continue without paging--
   0xf8804748 <+88>:    copy r4,r19
   0xf880474c <+92>:    ldi ffd,r20
   0xf8804750 <+96>:    ldo ffe(ret0),r21
   0xf8804754 <+100>:   cmpb,>>= r20,r21,0xf8804780 <do_futex_wait+144>
   0xf8804758 <+104>:   copy r5,r26
   0xf880475c <+108>:   b,l 0xf8805670 <__pthread_disable_asynccancel>,rp
   0xf8804760 <+112>:   nop
   0xf8804764 <+116>:   ldi 0,ret0
   0xf8804768 <+120>:   ldw -94(sp),rp
   0xf880476c <+124>:   ldw -74(sp),r5
   0xf8804770 <+128>:   ldw -70(sp),r4
   0xf8804774 <+132>:   ldw -6c(sp),r3
   0xf8804778 <+136>:   bv r0(rp)
   0xf880477c <+140>:   ldo -80(sp),sp
   0xf8804780 <+144>:   stw ret0,-78(sp)
   0xf8804784 <+148>:   b,l 0xf8805670 <__pthread_disable_asynccancel>,rp
   0xf8804788 <+152>:   copy r19,r4
   0xf880478c <+156>:   ldw -78(sp),ret0
   0xf8804790 <+160>:   cmpib,= -b,ret0,0xf88047b4 <do_futex_wait+196>
   0xf8804794 <+164>:   copy r4,r19
   0xf8804798 <+168>:   cmpib,= -4,ret0,0xf88047b4 <do_futex_wait+196>
   0xf880479c <+172>:   ldi -ee,r20
   0xf88047a0 <+176>:   cmpb,= r20,ret0,0xf88047b4 <do_futex_wait+196>
--Type <RET> for more, q to quit, c to continue without paging--
   0xf88047a4 <+180>:   addil L%0,r19,r1
=> 0xf88047a8 <+184>:   ldw 1f0(r1),r26
   0xf88047ac <+188>:   b,l 0xf87f6960,rp
   0xf88047b0 <+192>:   nop
   0xf88047b4 <+196>:   b,l 0xf8804768 <do_futex_wait+120>,r0
   0xf88047b8 <+200>:   sub r0,ret0,ret0
End of assembler dump.
Breakpoint 4, 0xf8804740 in ?? ()
(gdb) p/x $r26
$1 = 0x1b7f6ac
(gdb) p/x $r25
$2 = 0x188
(gdb) p/x $r24
$3 = 0x1
(gdb) p/x $r23
$4 = 0x0
(gdb) p/x $r22
$5 = 0x0
(gdb) p/x $r21
$6 = 0xffffffff

The xor changes the futex op from FUTEX_WAIT_BITSET to FUTEX_TRYLOCK_PI.
This causes the unexpected futex operation.  What has happened is
sem->private has been set to 1 and this modifies the futex operation. 

It seems the omp_nest_lock_t type used in omp_set_nest_lock is smaller
than sem_t:

Breakpoint 6, __new_sem_init (sem=0x1b7f6a0, pshared=0, value=1)
    at sem_init.c:33
33      in sem_init.c
(gdb) p 0x1b7f6ac-0x1b7f6a0
$6 = 12
(gdb) ptype m_lock
type = struct omp_nest_lock_t {
    unsigned char _x[12];
}
(gdb) frame 0
#0  __new_sem_init (sem=0x1b7f6a0, pshared=0, value=1) at sem_init.c:33
33      sem_init.c: No such file or directory.
(gdb) ptype sem
type = union {
    char __size[16];
    long __align;
} *

I see this in omp.h:
typedef struct
{
#if defined(__linux__)
  unsigned char _x[8 + sizeof (void *)]
    __attribute__((__aligned__(sizeof (void *))));
#else
  unsigned char _x[24]
    __attribute__((__aligned__(4)));
#endif
} omp_nest_lock_t;

The default for this type is modified in the libgomp-omp_h-multilib.diff patch:

# DP: Fix up omp.h for multilibs.

2008-06-09  Jakub Jelinek  <jakub@redhat.com>

        * omp.h.in (omp_nest_lock_t): Fix up for Linux multilibs.

2015-03-25  Matthias Klose  <doko@ubuntu.com>

        * omp.h.in (omp_nest_lock_t): Limit the fix Linux.

--- a/src/libgomp/omp.h.in
+++ b/src/libgomp/omp.h.in
@@ -40,8 +40,13 @@ typedef struct

 typedef struct
 {
+#if defined(__linux__)
+  unsigned char _x[8 + sizeof (void *)]
+    __attribute__((__aligned__(sizeof (void *))));
+#else
   unsigned char _x[@OMP_NEST_LOCK_SIZE@]
     __attribute__((__aligned__(@OMP_NEST_LOCK_ALIGN@)));
+#endif
 } omp_nest_lock_t;
 #endif

I think the "8" needs to increase to "12" to reflect the sem->private
field in the new semaphore type.

Regards,
Dave Anglin

-- System Information:
Debian Release: bullseye/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.139+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libgcc-9-dev depends on:
ii  gcc-9-base  9.2.1-4
ii  libatomic1  9.2.1-4
ii  libgcc4     1:9.2.1-4
ii  libgomp1    9.2.1-4

Versions of packages libgcc-9-dev recommends:
ii  libc6-dev  2.28-10

libgcc-9-dev suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Source: gcc-9
Source-Version: 9.2.1-7

We believe that the bug you reported is fixed in the latest version of
gcc-9, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 935750@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Matthias Klose <doko@debian.org> (supplier of updated gcc-9 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Thu, 05 Sep 2019 06:45:00 +0200
Source: gcc-9
Architecture: source
Version: 9.2.1-7
Distribution: unstable
Urgency: medium
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Closes: 935750 936586
Changes:
 gcc-9 (9.2.1-7) unstable; urgency=medium
 .
   * Update to SVN 20190905 (r275396) from the gcc-9-branch.
     - Fix PR libstdc++/91067, PR target/91481 (PPC),
       PR tree-optimization/90278, PR tree-optimization/91568,
       PR tree-optimization/90637, PR fortran/91565, PR fortran/91564,
       PR fortran/91551, PR fortran/91587, PR pch/61250, PR c++/91155,
       PR tree-optimization/91597, PR gcov-profile/91601,
       PR target/91472 (SPARC), PR c++/91129, PR fortran/91552,
       PR target/81800 (AArch64).
   * Drop the gcc-alpha-bs-ignore patch, apparently not necessary anymore.
   * For the omp.h header, use the configured OMP_NEST_LOCK_SIZE and
     OMP_NEST_LOCK_ALIGN values for some non-multilib architectures.
     Closes: #935750.
   * Use Python3 to build the gm2 frontend. Closes: #936586.
   * libgphobos76: Add breaks: dub (<< 1.16.0-1~). Addresses: #935275.
Checksums-Sha1:
 451507a12455af9aa5881c938d293008002bbbcf 33838 gcc-9_9.2.1-7.dsc
 b0981037ef0fc72e582538245fabe135b51008fc 508564 gcc-9_9.2.1-7.debian.tar.xz
 b9f1c00c8ce4932f5819d44676f63e5aadb30959 11122 gcc-9_9.2.1-7_source.buildinfo
Checksums-Sha256:
 0a64a490b9ab4a1243a89f6df429879093e82e99e0645360555bb5ddd391a029 33838 gcc-9_9.2.1-7.dsc
 8afe9cad8f65ae72ef052606fdd5416b66532b2ffc89948a746d5bd2e4156aae 508564 gcc-9_9.2.1-7.debian.tar.xz
 6be5d86575b795f903c55c84d8eddf81c57d97c857404e0b1a6df0eec42d1a88 11122 gcc-9_9.2.1-7_source.buildinfo
Files:
 d8b86117cfc36ab893791261d34fa6c2 33838 devel optional gcc-9_9.2.1-7.dsc
 c884154d9b496cf8864578aa7cc8f7d9 508564 devel optional gcc-9_9.2.1-7.debian.tar.xz
 8b8c964550a8c05143080df86152e714 11122 devel optional gcc-9_9.2.1-7_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAl1wlFsQHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9RoBEACX7rui9VqlBLVFTd10uq7WuMPQo0nAb/7K
q35k5WM1bKIKhjSwwQQ9UV4fLJtXN8unEwZPW7ijhPZTQ3degfyzXTwR0Vc/Pj4m
gXuHQDAkncItR9T5vuiv0Ozi20V9yu5IRCSD/ggqXn0l7stu8pDkgmkK5dF1l8DZ
CmhBkvRwk+oUHv8NevxJvS9zBh/TX1a0k9l9rlYk8umAh6SJ7uV4jWNMiJuAfCIG
2pqh+rU9PqrA4XS21qvMsNdaIv6e2N7bZd3M8cIDX+9XRx0c3/rW9xHDCSFSca5r
GLS6HhV7lS53AsJWZ029g/hqIieM83Vv30qLLwQkG7IWGjbFrpmxoe7qfpYP8k0+
aSIqgEgTYGYszHwhiC0rbyI3ObV5Q+UknO6g38SrSmgE/yC3vMp5u0kmzi0+7ErI
vEBQ6JNCdjSGLtnMtD9JIPJXWm/ixfqvniBOGntFsHN+bQjjgPXZ1tC6oF0GpYRn
TyAmODHfVr6D25ysPYYVvDModOTCjM84N4FcURpjOVG5P6ZkIsD3T2h9pbpta/Ro
lLnA5vaFO7mqmPNsDwn2PWHKa3SKztNYauWYTxZbbR4yPwBR+fVO0+zRnZOPogku
jX8IIVe4s8G+ToUPOnrYbsr6L99YvpmqiSPy3lHCcSw3P9yAKuoiOymnHOK92+8h
cucVBmcPEg==
=nLxG
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: