FYI: Some problems with powerpc (non-64) 11.0-CURRENT -r280867: sendmail stack corruption; PRNG not seeded
Mark Millard
markmi at dsl-only.net
Mon Apr 6 13:39:57 UTC 2015
In my exploring of FreeBSD 11.0-CURRENT on PowerMac's I've noted before that modern vintages of the powerpc (non-64) do not boot the G5's or the iMac 3 that I have access to but do boot the G4s that historically worked.
But I've noticed a couple of things that are note working right for the G4's. I do not know what to attribute them to, unfortunately. Still for (A) below I've got the evidence about where the segmentation fault is happening in sendmail.
I report on -r280867 specifically just because I've used it a lot more than somewhat older variants that I'd built before. I doubt that the issues are unique to -r280867.
A) /usr/libexec/sendmail/sendmail is leaving .core files in /var/crash/ periodically. (Details later below.)
B) The attempt to start sshd before login reports that "PRNG is not seeded". (Details later below.)
Basic context:
> # freebsd-version -ku; uname -apKU
> 11.0-CURRENT
> 11.0-CURRENT
> FreeBSD FBSDG3C0 11.0-CURRENT FreeBSD 11.0-CURRENT #8 r280867M: Mon Apr 6 02:12:28 PDT 2015 root at FBSDG5S1:/usr/obj/powerpc.powerpc/usr/srcC/sys/GENERICvtsc-NODEBUG powerpc powerpc 1100067 1100067
(A few files have to have more recent versions in order to build what is generally -r280867.)
This is a gcc 4.2.1 based build.
A) /usr/libexec/sendmail/sendmail is leaving .core files in /var/crash/ periodically (segmentation fault).
(I only have the automatic/default sendmail activity: I never turned it off but do not use it on the PowerMac's.)
As I understand the following: It gets the segmentation fault from r29=0 during the code sequence for checking the stack (so the bl to __stack_chk_fail at plt is not reached).
> # gdb /usr/libexec/sendmail/sendmail /var/crash/sendmail.728.core
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "powerpc-marcel-freebsd"...
> Core was generated by `sendmail'.
> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /lib/libutil.so.9...Reading symbols from /usr/lib/debug//lib/libutil.so.9.debug...done.
> done.
> Loaded symbols for /lib/libutil.so.9
> Reading symbols from /usr/lib/libwrap.so.6...Reading symbols from /usr/lib/debug//usr/lib/libwrap.so.6.debug...done.
> done.
> Loaded symbols for /usr/lib/libwrap.so.6
> Reading symbols from /usr/lib/libssl.so.7...Reading symbols from /usr/lib/debug//usr/lib/libssl.so.7.debug...done.
> done.
> Loaded symbols for /usr/lib/libssl.so.7
> Reading symbols from /lib/libcrypto.so.7...Reading symbols from /usr/lib/debug//lib/libcrypto.so.7.debug...done.
> done.
> Loaded symbols for /lib/libcrypto.so.7
> Reading symbols from /lib/libgcc_s.so.1...Reading symbols from /usr/lib/debug//lib/libgcc_s.so.1.debug...done.
> done.
> Loaded symbols for /lib/libgcc_s.so.1
> Reading symbols from /lib/libc.so.7...Reading symbols from /usr/lib/debug//lib/libc.so.7.debug...done.
> done.
> Loaded symbols for /lib/libc.so.7
> Reading symbols from /libexec/ld-elf.so.1...Reading symbols from /usr/lib/debug//libexec/ld-elf.so.1.debug...done.
> done.
> Loaded symbols for /libexec/ld-elf.so.1
> (gdb) bt
> #0 0x4191cac0 in hosts_ctl (daemon=<value optimized out>, name=<value optimized out>, addr=<value optimized out>, user=<value optimized out>)
> at /usr/srcC/lib/libwrap/../../contrib/tcp_wrappers/hosts_ctl.c:38
> #1 0x4191cabc in hosts_ctl (daemon=<value optimized out>, name=<value optimized out>, addr=<value optimized out>, user=<value optimized out>)
> at /usr/srcC/lib/libwrap/../../contrib/tcp_wrappers/hosts_ctl.c:32
> #2 0x018322f8 in main (argc=6, argv=0x6f776e00, envp=<value optimized out>) at /usr/srcC/usr.sbin/sendmail/../../contrib/sendmail/src/main.c:2649
> #3 0x01804a24 in _start ()
> #4 0x418c0fa0 in .text () at /usr/srcC/libexec/rtld-elf/powerpc/rtld_start.S:112
> (gdb) x/64i 0x4191ca40
> 0x4191ca40 <percent_m+284>: lwz r0,0(r3)
> 0x4191ca44 <percent_m+288>: mr r3,r29
> 0x4191ca48 <percent_m+292>: rlwinm r0,r0,2,0,29
> 0x4191ca4c <percent_m+296>: lwzx r4,r25,r0
> 0x4191ca50 <percent_m+300>: bl 0x41931890 <strcpy at plt>
> 0x4191ca54 <percent_m+304>: b 0x4191ca10 <percent_m+236>
> 0x4191ca58 <hosts_ctl>: stwu r1,-864(r1)
> 0x4191ca5c <hosts_ctl+4>: mflr r0
> 0x4191ca60 <hosts_ctl+8>: bl 0x41931594 <.got+548>
> 0x4191ca64 <hosts_ctl+12>: mr r9,r5
> 0x4191ca68 <hosts_ctl+16>: stw r30,856(r1)
> 0x4191ca6c <hosts_ctl+20>: mflr r30
> 0x4191ca70 <hosts_ctl+24>: stw r6,8(r1)
> 0x4191ca74 <hosts_ctl+28>: mr r7,r4
> 0x4191ca78 <hosts_ctl+32>: stw r29,852(r1)
> 0x4191ca7c <hosts_ctl+36>: mr r5,r3
> 0x4191ca80 <hosts_ctl+40>: stw r0,868(r1)
> 0x4191ca84 <hosts_ctl+44>: li r4,2
> 0x4191ca88 <hosts_ctl+48>: lwz r29,-36(r30)
> 0x4191ca8c <hosts_ctl+52>: li r6,4
> 0x4191ca90 <hosts_ctl+56>: li r8,5
> 0x4191ca94 <hosts_ctl+60>: li r10,3
> 0x4191ca98 <hosts_ctl+64>: lwz r0,0(r29)
> 0x4191ca9c <hosts_ctl+68>: stw r0,844(r1)
> 0x4191caa0 <hosts_ctl+72>: li r0,0
> 0x4191caa4 <hosts_ctl+76>: addi r3,r1,16
> 0x4191caa8 <hosts_ctl+80>: stw r0,12(r1)
> 0x4191caac <hosts_ctl+84>: crclr 4*cr1+eq
> 0x4191cab0 <hosts_ctl+88>: bl 0x41931870 <request_init at plt>
> 0x4191cab4 <hosts_ctl+92>: crclr 4*cr1+eq
> 0x4191cab8 <hosts_ctl+96>: bl 0x419317b0 <hosts_access at plt>
> 0x4191cabc <hosts_ctl+100>: lwz r0,844(r1)
> 0x4191cac0 <hosts_ctl+104>: lwz r9,0(r29)
> 0x4191cac4 <hosts_ctl+108>: xor. r0,r0,r9
> 0x4191cac8 <hosts_ctl+112>: li r9,0
> 0x4191cacc <hosts_ctl+116>: bne- 0x4191cae8 <hosts_ctl+144>
> 0x4191cad0 <hosts_ctl+120>: lwz r0,868(r1)
> 0x4191cad4 <hosts_ctl+124>: lwz r29,852(r1)
> 0x4191cad8 <hosts_ctl+128>: lwz r30,856(r1)
> 0x4191cadc <hosts_ctl+132>: mtlr r0
> 0x4191cae0 <hosts_ctl+136>: addi r1,r1,864
> 0x4191cae4 <hosts_ctl+140>: blr
> 0x4191cae8 <hosts_ctl+144>: bl 0x41931810 <__stack_chk_fail at plt>
> 0x4191caec <fix_options>: stwu r1,-896(r1)
> 0x4191caf0 <fix_options+4>: mflr r0
> 0x4191caf4 <fix_options+8>: bl 0x41931594 <.got+548>
> 0x4191caf8 <fix_options+12>: li r9,128
> 0x4191cafc <fix_options+16>: stw r30,888(r1)
> 0x4191cb00 <fix_options+20>: mflr r30
> 0x4191cb04 <fix_options+24>: stw r0,900(r1)
> 0x4191cb08 <fix_options+28>: addi r4,r1,712
> 0x4191cb0c <fix_options+32>: stw r25,868(r1)
> 0x4191cb10 <fix_options+36>: addi r5,r1,20
> 0x4191cb14 <fix_options+40>: stw r27,876(r1)
> 0x4191cb18 <fix_options+44>: lwz r25,-36(r30)
> 0x4191cb1c <fix_options+48>: lwz r27,0(r3)
> 0x4191cb20 <fix_options+52>: stw r28,880(r1)
> 0x4191cb24 <fix_options+56>: lwz r0,0(r25)
> 0x4191cb28 <fix_options+60>: stw r0,844(r1)
> 0x4191cb2c <fix_options+64>: li r0,0
> 0x4191cb30 <fix_options+68>: mr r28,r3
> 0x4191cb34 <fix_options+72>: stw r23,860(r1)
> (gdb) info registers
> r0 0xb3a7e38 188382776
> r1 0xffffbb40 -17600
> r2 0x418e4708 1099843336
> r3 0x1 1
> r4 0x41932264 1100161636
> r5 0x0 0
> r6 0x1 1
> r7 0x61 97
> r8 0x0 0
> r9 0x418e4708 1099843336
> r10 0xffffbb20 -17632
> r11 0x4191ed60 1100082528
> r12 0x44000048 1140850760
> r13 0x0 0
> r14 0x6 6
> r15 0x0 0
> r16 0x0 0
> r17 0x1 1
> r18 0x0 0
> r19 0x0 0
> r20 0x18c703c 25980988
> r21 0xffffffff -1
> r22 0x18f2984 26159492
> r23 0x0 0
> r24 0x0 0
> r25 0x1 1
> r26 0x1896608 25781768
> r27 0x0 0
> r28 0x0 0
> r29 0x0 0
> r30 0x41931598 1100158360
> r31 0x0 0
> pc 0x4191cac0 1100073664
> ps 0x0 0
> cr 0x44000048 1140850760
> lr 0x4191cabc 1100073660
> ctr 0x41bd1ad0 1102912208
> xer 0x20000000 536870912
> fpscr 0x0 0
> vscr 0x0 0
> vrsave 0x0 0
My powerpc64 -r280867 build does not have this problem. (But it is a powerpc64-xtoolchain-gcc based build. I should probably also build and keep a normal gcc 4.2.1 one at some point.)
I listed the above issue first because I had far more detailed/specific evidence than the below.
B) The attempt to start sshd before login reports:
> Performing sanity check on sshd configuration.
> PRNG is not seeded
> /etc/rc: WARNING: failed precmd routine for sshd
A "sshd -T" or other such command also reports "PRNG is not seeded".
Looking at sysctl output...
> kern.random.harvest.mask_symbolic: UMA_ALLOC,SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED
> kern.random.harvest.mask_bin: 1111111111
> kern.random.harvest.mask: 1023
> kern.random.yarrow.slowoverthresh: 2
> kern.random.yarrow.slowthresh: 128
> kern.random.yarrow.fastthresh: 96
> kern.random.yarrow.bins: 10
> kern.random.yarrow.gengateinterval: 10
> kern.random.live_entropy_sources:
> kern.random.active_adaptor: yarrow
> kern.random.adaptors: yarrow(90),dummy(1)
does not seem odd to me for 11.0-CURRENT or in comparison to my powerpc64 build's output.
As for what all is non-default for my configuration files (not much)...
My use of networking is minimal and the configuration changes for that are limited to rc.conf:
> # more /etc/rc.conf
> hostname="FBSDG5C0"
> ifconfig_bge0="DHCP"
> ifconfig_bge0_ipv6="inet6 accept_rtadv"
> ifconfig_gem0="DHCP"
> ifconfig_gem0_ipv6="inet6 accept_rtadv"
> sshd_enable="YES"
> #ntpd_enable="YES"
> #ntpd_sync_on_start="YES"
> # Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
> dumpdev="AUTO"
> hald_enable="YES"
> dbus_enable="YES"
I also fiddle with /boot/loader.conf, /etc/fstab, /etc/make.conf, and /etc/src.conf primarily. /etc/sysctl.conf for dump issues. /usr/local/etc/sudoers .
The rest of the configuration files are at the default/installation status.
My powerpc64 -r280867 build does not have this issue. (But it is a powerpc64-xtoolchain-gcc based build.)
Context details:
# svnlite st /usr/srcC/ --no-ignore
? /usr/srcC/.snap
? /usr/srcC/restoresymtable
M /usr/srcC/sys/ddb/db_main.c
M /usr/srcC/sys/ddb/db_script.c
? /usr/srcC/sys/powerpc/conf/GENERIC64vtsc
? /usr/srcC/sys/powerpc/conf/GENERIC64vtsc-NODEBUG
? /usr/srcC/sys/powerpc/conf/GENERICvtsc
? /usr/srcC/sys/powerpc/conf/GENERICvtsc-NODEBUG
M /usr/srcC/sys/powerpc/ofw/ofw_machdep.c
M /usr/srcC/sys/powerpc/ofw/ofwcall64.S
These are long standing changes associated with my finding a way for PowerMac G5's to boot reliably (ofw_machdep.c) and getting some evidence from early boot crashes in case they happen. Also the GENERIC*'s disable ps3 in order to enable both vt and sc. They do include the standard GENERIC*'s.
Used for building the plain powerpc 11.0-CURRENT -r280867 variant that produced the backtrace above:
# more /etc/src.conf
#CFLAGS+=-DELF_VERBOSE
WITH_DEBUG=
WITH_DEBUG_FILES=
# more /etc/make.conf
WRKDIRPREFIX=/usr/obj/portswork
#WITH_DEBUG=
#MALLOC_PRODUCTION=
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-ppc
mailing list