# 07:06:45 |
HcE |
quits : Remote host closed the connection |
# 12:35:42 |
DEATH |
I have a hello world repro of uclibc-ng bug |
# 12:37:05 |
DEATH |
https://paste.c-net.org/OpticalTracks + compile with -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 (taken from FFmpeg) |
# 12:37:09 |
DEATH |
If you compile with defaults, no bug |
# 12:37:49 |
DEATH |
This is due to time fields of struct stat |
# 12:38:30 |
DEATH |
The struct is expected to be 128 bytes in size, with 64bit timespec fields; instead with the above config you get 32bit ints |
# 12:39:00 |
DEATH |
Calling code allocates 104 bytes for struct stat, syscall writes 128 bytes, and you know the rest. |
# 12:39:33 |
DEATH |
This explains how come none of my other (pretty heavy) stuff using the same toolchain never broke. |
# 12:59:29 |
DEATH |
Hacking relevant header (bits/stat.h) of the toolchain makes the problem go away, replacing int with long int on offending fields. |
# 14:00:11 |
milkylainen |
DEATH: Good work isolating it. I'll hopefully get some more time later this evening. |
# 20:09:24 |
milkylainen |
DEATH: Umm. I've looked into it and yeah.. I wish I hadn't. |
# 20:10:18 |
milkylainen |
I knew stat was getting complicated over time. But holy christ what a mess. |
# 20:11:01 |
milkylainen |
I can't consolidate the glibc and the uclibc ones either. It's a miracle that anything works at all. |
# 20:13:26 |
milkylainen |
In the glibc headers: |
# 20:13:31 |
milkylainen |
# ifndef __x86_64__ __mode_t st_mode; /* File mode. */ __nlink_t st_nlink; /* Link count. */ # else __nlink_t st_nlink; /* Link count. */ __mode_t st_mode; /* File mode. */ # endif |
# 20:13:40 |
milkylainen |
like whaaa?!? |