lkml.org 
[lkml]   [2022]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectPROBLEM: with daemon.c after y2038 on 32-bits Kernel
Date
Hello,

I'm working for a client to generate embedded 32-bits Linux Kernel working after y2038 issue.

I generated a 5.15 Kernel thought Buildroot with Coreutils 9.0, GCC 11.2.0, Binutils 2.37, Glibc 2.34-9 and CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64.

I encounter an issue while working with OpenSSH (I initially contacted them before).

After 2038, /usr/sbin/sshd does not create an error but it child does generate this one:
daemon() failed: Value too large for defined data type

This happend here in sshd.c:

2019 /*
2020 * If not in debugging mode, not started from inetd and not already
2021 * daemonized (eg re-exec via SIGHUP), disconnect from the controlling
2022 * terminal, and fork. The original process exits.
2023 */
2024 already_daemon = daemonized();
2025 if (!(debug_flag || inetd_flag || no_daemon_flag || already_daemon)) {
2026
2027 if (daemon(0, 0) == -1)
2028 fatal("daemon() failed: %.200s", strerror(errno));

To reproduce:

# date -s "2040-05-12"
# hwclock --systohc
# reboot
# /usr/sbin/sshd

Note this error occurs only after the reboot, and setting a date before 2038 also require a reboot to remove the error.

strace and gdb trace linked.

Let me know if you need additional information.

Best regards,

PS: I had a similar issue with binutils cp
Discussion : debbugs.gnu.org/cgi/bugreport.cgi?bug=55023
Fix : sourceware.org/bugzilla/show_bug.cgi?id=29097
 
--
Arnaud PANAÏOTIS | Lead Developer Freelance
+33 6 34 82 12 62 | arnaud.panaiotis@gmx.fr

18 place Jean Moulin - 38000 Grenoble
APsudo - www.panaiotis.frBreakpoint 1 at 0x6170
Starting program: /usr/sbin/sshd

Breakpoint 1, __libc_fork () at fork.c:48
__run_fork_handlers (who=atfork_run_prepare, do_locking=false)
at register-atfork.c:112
fork_handler_list_size (list=0xb7cbdee0 <fork_handlers>)
at ../malloc/dynarray-skeleton.c:243
__run_fork_handlers (who=<optimized out>, do_locking=false)
at register-atfork.c:117
__libc_fork () at fork.c:59
__GI__Fork () at ../sysdeps/unix/sysv/linux/arch-fork.h:43
0xb7b7c431 in arch_fork (ctid=<optimized out>)
at ../sysdeps/unix/sysv/linux/arch-fork.h:43
0xb7b7c43f in arch_fork (ctid=<optimized out>)
at ../sysdeps/unix/sysv/linux/arch-fork.h:43
0xb7b7c442 in arch_fork (ctid=<optimized out>)
at ../sysdeps/unix/sysv/linux/arch-fork.h:43
0xb7b7c44b in arch_fork (ctid=<optimized out>)
at ../sysdeps/unix/sysv/linux/arch-fork.h:43
0xb7b7c453 in arch_fork (ctid=<optimized out>)
at ../sysdeps/unix/sysv/linux/arch-fork.h:43
[Attaching after process 7146 fork to child process 7166]
[New inferior 2 (process 7166)]
[Detaching after fork from parent process 7146]
[Inferior 1 (process 7146) detached]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
[Switching to Thread 0xb7a9cd40 (LWP 7166)]
__GI__Fork () at ../sysdeps/nptl/_Fork.c:29
__GI__Fork () at ../sysdeps/nptl/_Fork.c:31
__GI__Fork () at ../sysdeps/nptl/_Fork.c:50
__libc_fork () at fork.c:75
fork_system_setup () at ../sysdeps/nptl/fork.h:34
__libc_fork () at fork.c:80
reclaim_stacks () at ../sysdeps/nptl/fork.h:58
list_del (elem=0xb7a9cda0) at ../include/list.h:56
0xb7b7c175 in list_del (elem=0xb7a9cda0) at ../include/list.h:56
reclaim_stacks () at ../sysdeps/nptl/fork.h:143
__libc_fork () at fork.c:102
reclaim_stacks () at ../sysdeps/nptl/fork.h:147
list_add (head=<optimized out>, newp=0xb7a9cda0) at ../include/list.h:44
__libc_fork () at fork.c:105
__run_fork_handlers (who=atfork_run_child, do_locking=false)
at register-atfork.c:112
fork_handler_list_size (list=0xb7cbdee0 <fork_handlers>)
at ../malloc/dynarray-skeleton.c:243
__run_fork_handlers (who=atfork_run_child, do_locking=false)
at register-atfork.c:127
daemon (nochdir=0, noclose=0) at daemon.c:57
setsid () at ../sysdeps/unix/syscall-template.S:120
daemon (nochdir=0, noclose=0) at daemon.c:60
chdir () at ../sysdeps/unix/syscall-template.S:120
daemon (nochdir=0, noclose=0) at daemon.c:63
__GI___open_nocancel (file=0xb7c4ba54 "/dev/null", oflag=2)
at ../sysdeps/unix/sysv/linux/open_nocancel.c:34
__GI___fstat64 (fd=3, buf=0xbffff4a0)
at ../sysdeps/unix/sysv/linux/fstat64.c:43
__x86.get_pc_thunk.dx () at ../sysdeps/i386/fpu/s_frexpl.S:61
__GI___fstat64 (fd=3, buf=0xbffff4a0)
at ../sysdeps/unix/sysv/linux/fstat64.c:50
__GI___fstat64_time64 (buf=0xbffff414, fd=3)
at ../sysdeps/unix/sysv/linux/fstat64.c:35
__GI___fstatat64_time64 (fd=3, file=0xb7c4bf09 "", buf=0xbffff414, flag=4096)
at ../sysdeps/unix/sysv/linux/fstatat64.c:153
0xb7ba4cd1 in fstatat64_time64_statx (flag=<optimized out>,
buf=<optimized out>, file=<optimized out>, fd=<optimized out>)
at ../sysdeps/unix/sysv/linux/fstatat64.c:50
0xb7ba4ce3 in fstatat64_time64_statx (flag=<optimized out>,
buf=<optimized out>, file=<optimized out>, fd=<optimized out>)
at ../sysdeps/unix/sysv/linux/fstatat64.c:50
0xb7ba4cef in fstatat64_time64_statx (flag=<optimized out>,
buf=<optimized out>, file=0xb7c4bf09 "", fd=3)
at ../sysdeps/unix/sysv/linux/fstatat64.c:50
fstatat64_time64_statx (flag=4096, buf=0xbffff414, file=0xb7c4bf09 "", fd=3)
at ../sysdeps/unix/sysv/linux/fstatat64.c:50
__gnu_dev_makedev (__minor=5, __major=0) at ../include/sys/sysmacros.h:49
0xb7ba4d48 in __gnu_dev_makedev (__minor=5, __major=0)
at ../include/sys/sysmacros.h:49
0xb7ba4d5a in __gnu_dev_makedev (__minor=5, __major=0)
at ../include/sys/sysmacros.h:49
0xb7ba4d7e in __gnu_dev_makedev (__minor=5, __major=0)
at ../include/sys/sysmacros.h:49
0xb7ba4da5 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4dd5 in __gnu_dev_makedev (__minor=3, __major=1)
at ../include/sys/sysmacros.h:49
0xb7ba4ded in __gnu_dev_makedev (__minor=3, __major=1)
at ../include/sys/sysmacros.h:49
0xb7ba4dfb in __gnu_dev_makedev (__minor=3, __major=1)
at ../include/sys/sysmacros.h:49
0xb7ba4e14 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e22 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e41 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e4d in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e5b in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e63 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e7b in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4e95 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4eaa in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
0xb7ba4ec3 in __gnu_dev_makedev (__minor=<optimized out>,
__major=<optimized out>) at ../include/sys/sysmacros.h:49
__cp_stat64_t64_stat64 (st64_t64=0xbffff414, st64=0xbffff4a0)
at ../sysdeps/unix/sysv/linux/stat_t64_cp.c:29
__x86.get_pc_thunk.cx () at ../sysdeps/i386/i686/multiarch/strcpy-sse2.S:314
__cp_stat64_t64_stat64 (st64_t64=0xbffff414, st64=0xbffff4a0)
at ../include/time.h:350
0xb7bb0a8d in in_time_t_range (t=<optimized out>) at ../include/time.h:350
0xb7bb0a91 in in_time_t_range (t=<optimized out>) at ../include/time.h:350
daemon (nochdir=0, noclose=0) at daemon.c:88
__close_nocancel_nostatus (fd=3) at ../sysdeps/unix/sysv/linux/not-cancel.h:60
__GI___close_nocancel (fd=3) at ../sysdeps/unix/sysv/linux/close_nocancel.c:26
__x86.get_pc_thunk.dx () at ../sysdeps/i386/fpu/s_frexpl.S:61
daemon (nochdir=0, noclose=0) at daemon.c:89
main (ac=<optimized out>, av=<optimized out>) at sshd.c:2028
__GI___errno_location () at errno-loc.c:26
strerror (errnum=75) at strerror.c:24
__GI___strerror_l (errnum=75, loc=0xb7cbabe0 <_nl_global_locale>)
at strerror_l.c:39
__x86.get_pc_thunk.bx () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:108
__GI___strerror_l (errnum=75, loc=0xb7cbabe0 <_nl_global_locale>)
at strerror_l.c:40
__get_errlist (errnum=75) at errlist.c:37
__x86.get_pc_thunk.cx () at ../sysdeps/i386/i686/multiarch/strcpy-sse2.S:314
__get_errlist (errnum=75) at errlist.c:38
__GI___strerror_l (errnum=75, loc=0xb7cbabe0 <_nl_global_locale>)
at strerror_l.c:52
translate (loc=0xb7cbabe0 <_nl_global_locale>,
str=0xb7c509bc "Value too large for defined data type") at strerror_l.c:28
__GI___uselocale (newloc=0xb7cbabe0 <_nl_global_locale>) at uselocale.c:31
__x86.get_pc_thunk.dx () at ../sysdeps/i386/fpu/s_frexpl.S:61
__GI___uselocale (newloc=0xb7cbabe0 <_nl_global_locale>) at uselocale.c:33
translate (loc=0xb7cbabe0 <_nl_global_locale>,
str=0xb7c509bc "Value too large for defined data type") at strerror_l.c:29
__GI___dcgettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid=0xb7c509bc "Value too large for defined data type", category=5)
at dcgettext.c:47
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:494
___pthread_rwlock_rdlock (rwlock=0xb7cbafa0 <__libc_setlocale_lock>)
at pthread_rwlock_rdlock.c:27
__pthread_rwlock_rdlock_full64 (abstime=0x0, clockid=0,
rwlock=0xb7cbafa0 <__libc_setlocale_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:298
0xb7b2e0a6 in futex_wake (private=<optimized out>,
processes_to_wake=<optimized out>, futex_word=<optimized out>)
at ../sysdeps/nptl/futex-internal.h:213
___pthread_rwlock_rdlock (rwlock=<optimized out>) at pthread_rwlock_rdlock.c:29
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:528
___pthread_rwlock_rdlock (rwlock=0xb7cbb0e0 <_nl_state_lock>)
at pthread_rwlock_rdlock.c:27
__pthread_rwlock_rdlock_full64 (abstime=0x0, clockid=0,
rwlock=0xb7cbb0e0 <_nl_state_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:298
0xb7b2e0a6 in futex_wake (private=<optimized out>,
processes_to_wake=<optimized out>, futex_word=<optimized out>)
at ../sysdeps/nptl/futex-internal.h:213
___pthread_rwlock_rdlock (rwlock=<optimized out>) at pthread_rwlock_rdlock.c:29
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:533
__current_locale_name (category=5) at localename.c:25
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:560
___pthread_rwlock_rdlock (rwlock=0xb7cbb120 <tree_lock>)
at pthread_rwlock_rdlock.c:27
__pthread_rwlock_rdlock_full64 (abstime=0x0, clockid=0,
rwlock=0xb7cbb120 <tree_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:298
0xb7b2e0a6 in futex_wake (private=<optimized out>,
processes_to_wake=<optimized out>, futex_word=<optimized out>)
at ../sysdeps/nptl/futex-internal.h:213
___pthread_rwlock_rdlock (rwlock=<optimized out>) at pthread_rwlock_rdlock.c:29
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:569
__GI___tfind (key=0xbffff440, vrootp=0xb7cbb11c <root>,
compar=0xb7ad69c0 <transcmp>) at tsearch.c:373
__GI___tfind (compar=<optimized out>, vrootp=<optimized out>,
key=<optimized out>) at tsearch.c:383
___pthread_rwlock_unlock (rwlock=0xb7cbb120 <tree_lock>)
at pthread_rwlock_unlock.c:39
__pthread_rwlock_rdunlock (rwlock=0xb7cbb120 <tree_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:227
__pthread_rwlock_get_private (rwlock=0xb7cbb120 <tree_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:221
__pthread_rwlock_rdunlock (rwlock=0xb7cbb120 <tree_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:232
___pthread_rwlock_unlock (rwlock=0xb7cbb120 <tree_lock>)
at pthread_rwlock_unlock.c:43
__pthread_rwlock_rdunlock (rwlock=0xb7cbb120 <tree_lock>)
at /home/arnaud/VLB-SNTTRT/devenv/branches/kernel510/output/build/glibc-2.34-9-g9acab0bba6a5a57323b1f94bf95b21618a9e5aa4/nptl/pthread_rwlock_common.c:242
___pthread_rwlock_unlock (rwlock=<optimized out>) at pthread_rwlock_unlock.c:44
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:573
_nl_category_names_get (index=5) at ../include/../locale/localeinfo.h:206
0xb7ad74bf in _nl_category_names_get (index=5)
at ../include/../locale/localeinfo.h:206
__dcigettext (domainname=0xb7c502ac <_libc_intl_domainname> "libc",
msgid1=0xb7c509bc "Value too large for defined data type", msgid2=0x0,
plural=0, n=0, category=5) at dcigettext.c:647
guess_category_value (
categoryname=0xb7c31493 <_nl_category_names+51> "LC_MESSAGES", category=5)
at dcigettext.c:1539
__current_locale_name (category=5) at localename.c:25
guess_category_value (
categoryname=0xb7c31493 <_nl_category_names+51> "LC_MESSAGES", category=5)
at dcigettext.c:1568
0xb7ad7724 in guess_category_value (
categoryname=0xb7c31493 <_nl_category_names+51> "LC_MESSAGES", category=5)
at dcigettext.c:1568
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2022-05-17 09:51    [W:0.090 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site