Bug 464000 - Test timerfd-syscall stops/fails when compiled with _TIME_BITS=64 on 32bit
Summary: Test timerfd-syscall stops/fails when compiled with _TIME_BITS=64 on 32bit
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.19.0
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-08 12:10 UTC by Taketo Kabe
Modified: 2023-10-12 15:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
patch for timerfd-syscall test failure with _TIME_BITS=64 (1.40 KB, patch)
2023-01-08 12:10 UTC, Taketo Kabe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Taketo Kabe 2023-01-08 12:10:57 UTC
Created attachment 155104 [details]
patch for timerfd-syscall test failure with _TIME_BITS=64

SUMMARY
Test timerfd-syscall stops/fails when compiled with _TIME_BITS=64 on 32bit

STEPS TO REPRODUCE
1.  On LInux, prepare a 32bit compile environment.  Installing 32bit development env and "setarch i686" is often enough.
2.  CPPFLAGS="-D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64" ./configure
3.  make
4.  make check

OBSERVED RESULT
Test halts at:
timerfd-syscall: valgrind   ./timerfd-syscall

EXPECTED RESULT
All tests pass.

SOFTWARE/OS VERSIONS

Linux:  5.14.0-162.6.1.el9_1.0.1.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 28 18:44:09 UTC 2022 i686 i686 i386 GNU/Linux
glibc: glibc-2.34-28.el9_0.v1.i586

ADDITIONAL INFORMATION
timerfd-syscall.c overrides system function timerfd_settime() and timerfd_gettime(), 
but when _TIME_BITS=64 is enabled on GLIBC system, these function calls become alias to  __timerfd_settime64(), __timerfd_gettime64().  timerfd-syscall.c should call the correct underlining system call under _TIME_BITS=64.

The attached patch seems to fix this.
Note that #include <sys/timerfd.h> is not surrounded by #if defined(HAVE_SYS_TIMERFD_H), since configure does not yet detect this.