Bug 2228368

Summary: Change in time_t size on i686 between 0-43.20220212git.fc37 to 0-46.20230706git.fc38
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: gnulibAssignee: Mosaab Alzoubi <moceap>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: arjun.is, codonell, dj, fberat, fweimer, jlaw, mcermak, mcoufal, mfabian, michel, moceap, pfrankli, sipoyare, skolosov, zbyszek
Target Milestone: ---Keywords: Regression
Target Release: ---   
Hardware: i686   
OS: Unspecified   
URL: https://artifacts.dev.testing-farm.io/d0b37bc4-5366-4d8c-8f70-b4d82e9e12f2/
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-08-02 09:25:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2227872    

Description Petr Pisar 2023-08-02 07:52:45 UTC
An abidiff check between libloc-0.9.16-2.fc38 and libloc-0.9.16-3.fc38
<https://artifacts.dev.testing-farm.io/d0b37bc4-5366-4d8c-8f70-b4d82e9e12f2/> reports a change in size of time_t type on i686:

  [C] 'function time_t loc_database_created_at(loc_database*)' at database.c:705:1 has some indirect sub-type changes:
    return type changed:
      underlying type 'typedef __time64_t' at types.h:223:1 changed:
        typedef name changed from __time64_t to __time_t at types.h:160:1
        underlying type 'typedef __int64_t' at types.h:47:1 changed:
          entity changed from 'typedef __int64_t' to compatible type 'long int'
            type name changed from 'long long int' to 'long int'
            type size changed from 64 to 32 (in bits)

build.log does not show any difference in compiling src/database.c. All compiler options are the same:

libtool: compile:  gcc -DHAVE_CONFIG_H -I. -include ./config.h -DSYSCONFDIR=\"/etc\" -I./src -Wall -Wchar-subscripts -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wshadow -Wsign-compare -Wstrict-prototypes -Wtype-limits -fno-semantic-interposition -ffunction-sections -fdata-sections -DLIBLOC_PRIVATE -fvisibility=hidden -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse -mstackrealign -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -c src/database.c  -fPIC -DPIC -o src/.libs/libloc_la-database.

A difference in libloc sources is small and does not change time_t in any way. (There a lot of included header files from glibc and from openssl that I did not yet checked.)

A difference in root.log shows these upgrades:

glibc-headers from x86-2.36.9000-19.fc38 to 2.37-4.fc38
openssl-devel from 3.0.7-3.fc38 to 3.0.9-1.fc38

I verified with "print sizeof(time_t)" when loading the libraries in GDB that the size indeed changed from 8 to 4 bytes. I checked also the very fist libloc build, libloc-0.9.15-2.fc38.i686, that used to be 8 bytes.

I will try to reproduce the regression in mock environment and to minimize the reproducer, but my preliminary suspect is glibc.

Comment 1 Florian Weimer 2023-08-02 09:25:22 UTC
Diffing the build.log from the two versions shows this difference:

@@ -202,10 +196,13 @@
 checking for resolv.h... yes
 checking whether it is safe to define __EXTENSIONS__... yes
 checking whether _XOPEN_SOURCE should be defined... no
+checking for special C compiler options needed for large files... no
+checking for _FILE_OFFSET_BITS value needed for large files... 64
+checking for time_t past the year 2038... no
+checking for 64-bit time_t with _TIME_BITS=64... yes
+checking whether make supports nested variables... (cached) yes
 checking build system type... i686-redhat-linux-gnu
 checking host system type... i686-redhat-linux-gnu
-checking for gcc option to enable large file support... -D_FILE_OFFSET_BITS=64
-checking whether make supports nested variables... (cached) yes
 checking how to print strings... printf
 checking for a sed that does not truncate output... /usr/bin/sed
 checking for grep that handles long lines and -e... /usr/bin/grep

This likely comes from gnulib. I think it's since been reverted there because the ABI impact was deemed to high.

In any case, it's not a glibc bug because the package build process explicitly requested a change of the time_t size.

Comment 2 Petr Pisar 2023-08-02 10:20:07 UTC
Good catch. I confirm that the change is triggered by upgrading gnulib-devel from 0-43.20220212git.fc37 to 0-46.20230706git.fc38. The _TIME_BITS macro was defined in ./config.h generated with configure script. With the new gnulib-devel, the macro is not defined.

Comment 3 Petr Pisar 2023-08-02 10:41:36 UTC
The old gnulib defaults to:

# ./configure --help |grep year
  --disable-year2038      omit support for timestamps past the year 2038

The new gnulib changed the default:

  --enable-year2038       support timestamps after 2038