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

Bug#1067453: marked as done (gnat: Ada.Calendar.Clock crashes on time_t64 architectures)



Your message dated Mon, 29 Apr 2024 10:04:10 +0000
with message-id <E1s1Nrm-003oms-Bo@fasolo.debian.org>
and subject line Bug#1067453: fixed in gcc-13 13.2.0-24
has caused the Debian Bug report #1067453,
regarding gnat: Ada.Calendar.Clock crashes on time_t64 architectures
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.)


-- 
1067453: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1067453
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gnat-13
Version: 13.2.0-19
Severity: normal
X-Debbugs-Cc: lbrenta@debian.org
Control: affects -1 pcscada libalog dbusada anet ahven libgmpada libgtkada libgnatcoll-db libncursesada libaunit adacgi liblog4ada libtexttools libtemplates-parser libxmlezout libgnatcoll-bindings libgnatcoll gprbuild

Hello.

Most Ada packages randomly FTBFS on 32 bit architectures with
gprbuild: raised CONSTRAINT_ERROR : a-calend.adb:371 overflow check failed

The problem originates in the gcc-13 switch to time_t64.
gcc/ada/libgnat/s-os_prim__posix.adb is affected by two apparently
distinct issues.

* s-os_prim.adb allocates 3Long_Integer=3void*=3*32 bits for the
  timeval C struct, while 2*64bits = 2Long_Long_Integer are now needed.

  This issue affects other files, but is easy to find and fix.

* The switch breaks the call from Ada to the C gettimeofday function.

  Can anyone explain this, and ideally provide a real fix instead of
  the ugly work-around below?

cat > mycal.c <<EOF
#include <sys/time.h>
int mygettimeofday(struct timeval *restrict tv,
                   struct timezone *restrict tz) {
  return gettimeofday(tv, tz);
}
EOF

cat > foo.adb <<EOF
with Ada.Text_IO, System.OS_Primitives;
procedure Foo is
   -- On armhf, array(1..3) of Long_Integer gives random usec values.
   type timeval is array (1 .. 2) of Long_Long_Integer;
   procedure timeval_to_duration
     (T    : not null access timeval;
      sec  : not null access Long_Long_Integer;
      usec : not null access Long_Integer);
   pragma Import (C, timeval_to_duration, "__gnat_timeval_to_duration");
   sec    : aliased Long_Long_Integer;
   usec   : aliased Long_Integer;
   TV     : aliased timeval;
   function gettimeofday (Tv : access timeval;
      Tz : System.Address := System.Null_Address) return Integer;
   -- On armhf, a direct import of gettimeofday leads to random Tv values.
   pragma Import (C, gettimeofday, "mygettimeofday");
   Result : constant Integer := gettimeofday (TV'Access, System.Null_Address);
   SOP : constant Duration := System.OS_Primitives.Clock;
begin
   timeval_to_duration (TV'Access, sec'Access, usec'Access);
   Ada.Text_IO.Put_Line ("local               :" & Sec'Img & "." & Usec'Img);
   Ada.Text_IO.Put_Line ("System.OS_Primitives:" & SOP'Img);
end Foo;
EOF

gcc -c mycal.c -o mycal.o
gnatmake -gnat2022 foo -largs mycal.o
echo -n 'Machine             : '; uname -m
date   '+Expected            : %s'
./foo

Machine             : x86_64  (amd64 x86_64-linux-gnu)
Expected            : 1711035183
local               : 1711035183. 324545
System.OS_Primitives: 1711035183.324549000

Machine             : armv7l  (armhf arm-gnu-eabi)
Expected            : 1711035189
local               : 1711035189. 551691
System.OS_Primitives: 1113580361.675821568

--- End Message ---
--- Begin Message ---
Source: gcc-13
Source-Version: 13.2.0-24
Done: Matthias Klose <doko@debian.org>

We believe that the bug you reported is fixed in the latest version of
gcc-13, 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 1067453@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-13 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: SHA512

Format: 1.8
Date: Mon, 29 Apr 2024 11:49:21 +0200
Source: gcc-13
Architecture: source
Version: 13.2.0-24
Distribution: unstable
Urgency: medium
Maintainer: Debian GCC Maintainers <debian-gcc@lists.debian.org>
Changed-By: Matthias Klose <doko@debian.org>
Closes: 1067453
Changes:
 gcc-13 (13.2.0-24) unstable; urgency=medium
 .
   * Update to git 20240429 from the gcc-13 branch.
     - Fix PR target/114175 (RISCV), PR middle-end/111632,
       PR tree-optimization/111407, PR target/113233 (loong64),
       PR target/105522 (Darwin), PR target/114175, PR tree-optimization/112303,
       PR middle-end/111151, PR sanitizer/111736, PR middle-end/111683,
       PR bootstrap/114369, PR c++/103825, PR fortran/103707,
       PR fortran/106987, PR fortran/113799, PR fortran/95374, PR fortran/104352,
       PR fortran/107426, PR fortran/113866, PR fortran/50410, PR fortran/103716,
       PR middle-end/111632, PR libgcc/111731, PR libstdc++/114401,
       PR libstdc++/113841, PR libstdc++/114367, PR target/114130 (RISCV),
       PR ipa/108007, PR ipa/112616, PR fortran/114474, PR bootstrap/106472,
       PR target/114272 (AArch64), PR target/114837 (ARM), PR target/88309 (PPC),
       PR target/114172 (RISCV), PR rtl-optimization/114768,
       PR middle-end/114753, PR sanitizer/114743, PR c++/114634,
       PR sanitizer/114687, PR middle-end/110027, PR tree-optimization/114566,
       PR c++/114537, PR middle-end/114552, PR ipa/113964, PR ipa/111571,
       PR target/114752 (AVR), PR middle-end/114599, PR gcov-profile/114115,
       PR tree-optimization/114115, PR tree-optimization/113552,
       PR c/114780, PR c++/114691, PR c++/114580, PR c++/114572,
       PR c++/113966, PR c++/110006, PR c++/112769, PR fortran/102003,
       PR target/114794 (AVR), PR libfortran/114304, PR libfortran/105473,
       PR libquadmath/114533.
   * Use gcc:SoftVersion for -for-host dependencies (Helmut Grohne).
     Addresses: #1067904.
   * Apply proposed patch for PR libquadmath/114533 (Simon Chopin).
     Addresses: #1064426. LP: #2052929.
   * Don't build the libstdc++-doc package when the nodoc profile is enabled.
   * Integrate gnat patches from Nicolas:
     - Update the ada-lib-info-source-date-epoch patch.
     - Remove the pr114065-proposed patch.
     - Add patches (v6) from PR ada/114065.  Closes: #1067453.
     - Only apply ada-armel-libatomic.diff on armel.
   * Don't set the _FILE_OFFSET_BITS and _TIME_BITS macros, if the
     _DISTRO_EVADE_TIME_BITS macro is defined.
     See https://sourceware.org/bugzilla/show_bug.cgi?id=31624.
   * Build using GCC 13.
Checksums-Sha1:
 b8bd384431dde5b350234133b57f5b58c307a3d6 39096 gcc-13_13.2.0-24.dsc
 9a6ce32871d067afd9c7ccb756005844bca6173e 1989532 gcc-13_13.2.0-24.debian.tar.xz
 eebdc73d64c6a437bf7e09999bb72f124809481b 9620 gcc-13_13.2.0-24_source.buildinfo
Checksums-Sha256:
 2ea02a1c71ed12771bb37466b76ec449c917fa84fb8193c0bbe3611c415092c8 39096 gcc-13_13.2.0-24.dsc
 f12c45fba415e00a5d888af724179560ed393f28d24fb7bdc2560be3d9664f7f 1989532 gcc-13_13.2.0-24.debian.tar.xz
 bff04ac87e80d363d41233faf2188a7ff475583dda772e85b8efcb57635dc54a 9620 gcc-13_13.2.0-24_source.buildinfo
Files:
 ac1f81803806b63a912ba175040c00d9 39096 devel optional gcc-13_13.2.0-24.dsc
 3f1c3541fac344c997a0237b6542a883 1989532 devel optional gcc-13_13.2.0-24.debian.tar.xz
 86ba38db98166daa6f5c37afb242454f 9620 devel optional gcc-13_13.2.0-24_source.buildinfo

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

iQJEBAEBCgAuFiEE1WVxuIqLuvFAv2PWvX6qYHePpvUFAmYvbXAQHGRva29AZGVi
aWFuLm9yZwAKCRC9fqpgd4+m9fOoEACdZqj6KeQyp1zEG8w5omEoO6XdkC3mSDe/
xI5GwlB2eOaYmUnkKhsXYPZy7wznKrq62W66K9oN0qelna/kT3erOj80KdscT6KB
Si1tvIXOwUZIBC1pM+MGQneOMqEcLPrECDiMU3Sy1smkX8cyjXI20KwjAmIyB0x7
mdJDnkYLl3akj6QCBSOA2+H/o90T3qn3DQ8VZpwRI3ez1ZBU34Teu+vkMO6ZC8JZ
SrDkbGfNm+b/fkViQZOfsD69D5WdyEt8J+Gz36L3Vo1qrOJTa3s6QfmTdC2Sr2SH
U7m1mWYcx/XiVvQLbMbdoXHzYdMF/7DQxjpgOkyLsf5C2otf4KepOQmttgqrmae7
oCmGRHabClO0ragZLrm5ykhU8N9A98lrVb+CPDsHoLhCtiJtA2E1UVmo4Knta14X
QXycBwLPnZRZ8ZO6aHLcBGj3/fMgxX0fPXpA95+wUDMpeoABMNGGXbcsyVJZIvgC
1bOgHyCzEwVYp9PHxFVE2tU51GiU+f3o7ZSzBEnDF/tOFwoL4pvf1JFpJ7tY1pLC
mjDJfvXn+EMZZfyVH5MH9usU23AdaQ/jeFkhl66JsDlUUiGIvajPyMjOdUBE5Yln
oxZ7YOgFzClwri8yuDaqsXNjF4c7aqEA9e6df6vb6Fz6kje6qmqUAk1augZFkVaL
wj70YiBNoA==
=gIF0
-----END PGP SIGNATURE-----

Attachment: pgpC553VAlgbM.pgp
Description: PGP signature


--- End Message ---

Reply to: