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

--- Comment #48 from John David Anglin <danglin at gcc dot gnu.org> ---
There is an endian issue in the call to ___pthread_cond_timedwait64
which breaks v18 on hppa:

(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program:
/home/dave/debian/gcc-15/gcc-15-15.1.0/build/gcc/testsuite/gnat/array39.exe
warning: Unable to find libthread_db matching inferior's thread library, thread
debugging will not be available.
[New LWP 7081]

Thread 1 "array39.exe" hit Breakpoint 3,
system.task_primitives.operations.monotonic.timed_sleep (self_id=0x191a0,
time=<optimized out>, mode=<optimized out>, reason=<optimized out>)
    at s-tpopmo.adb:192
192                    exit Outer
(gdb) p Request
$14 = (tv_sec => 746877, tv_nsec => 10000000)
(gdb) c
Continuing.
[LWP 7081 exited]

Thread 1 "array39.exe" hit Breakpoint 1, ___pthread_cond_timedwait64
(cond=0x192d8,
    mutex=0x19308, abstime=0xf9b02588) at pthread_cond_wait.c:475
warning: 475    pthread_cond_wait.c: No such file or directory
(gdb) p *abstime
$15 = {tv_sec = 746877, tv_nsec = -112571844}
(gdb) info addr abstime
Symbol "abstime" is multi-location:
  Range 0xf84515f4-0xf8451673: a variable in $r24
  Range 0xf8451673-0xf8451794: a variable in $r13
  Range 0xf8451794-0xf84517c4: a complex DWARF expression:
     0: DW_OP_entry_value
       2: DW_OP_regval_type<unsigned long long [0x26]> [$r24]
     5: DW_OP_convert<unsigned int [0x2d]>
     7: DW_OP_convert<0>
     9: DW_OP_stack_value

  Range 0xf84517c4-0xf84518d4: a variable in $r13
.
(gdb) x/4d $r24
0xf9b02588:     0       746877  10000000        -112571844
(gdb) bt
#0  ___pthread_cond_timedwait64 (cond=0x192d8, mutex=0x19308,
abstime=0xf9b02588)
    at pthread_cond_wait.c:475
#1  0xf9480af4 in system.task_primitives.operations.monotonic.timed_sleep (
    self_id=0x191a0, time=<optimized out>, mode=<optimized out>,
reason=<optimized out>)
    at s-tpopmo.adb:196
#2  0xf94817ec in system.task_primitives.operations.timed_sleep
(self_id=<optimized out>,
    time=<optimized out>, mode=<optimized out>, reason=<optimized out>) at
s-taprop.adb:620
#3  0xf948c19c in system.tasking.stages.finalize_global_tasks () at
s-tassta.adb:865
#4  0xf91113a0 in system.standard_library.adafinal () at s-stalib.adb:79
#5  0x00012990 in ada_main.adafinal ()
    at
/home/dave/debian/gcc-15/gcc-15-15.1.0/build/gcc/testsuite/gnat/b~array39.adb:81
Backtrace stopped: Cannot access memory at address 0xda
(gdb) info break
Num     Type           Disp Enb Address    What
1       breakpoint     keep y   0xf84515f4 in ___pthread_cond_timedwait64
                                           at pthread_cond_wait.c:475
        breakpoint already hit 1 time
2       breakpoint     keep n   0xf9480af4 in
system.task_primitives.operations.monotonic.timed_sleep at s-tpopmo.adb:196
3       breakpoint     keep y   0xf9480acc in
system.task_primitives.operations.monotonic.timed_sleep at s-tpopmo.adb:192
        breakpoint already hit 1 time
4       breakpoint     keep n   0xf8451654 in ___pthread_cond_timedwait64
                                           at pthread_cond_wait.c:475

The ada and C layouts for the __timespec64 struct are inconsistent on hppa.

Reply via email to