Modify

Opened 8 years ago

Closed 7 years ago

Last modified 4 years ago

#7657 closed defect (fixed)

segfault while sysupgrade with 22322 and uClibc 0.9.31

Reported by: anonymous Owned by: developers
Priority: low Milestone: Barrier Breaker 14.07
Component: toolchain Version: Trunk
Keywords: Cc:

Description

I tried to build openwrt w/ the latest released uClibc 0.9.31. Everythings works fine until I tried to upgrade - which is impossible due to the segfault seen below. Had to use u-Boot and re-flash a release built w/ regular 0.9.30.1

root@PHOENIX:/home/transfer# sysupgrade -v openwrt-ar71xx-generic-wndr3700-squashfs-sysupgrade.bin
Saving config files...
etc/nixio/.nixio_stamp
etc/rc.local
etc/firewall.user
[...]
Switching to ramdisk...
Segmentation fault
Segmentation fault
/sbin/sysupgrade: line 115: busybox: not found
/sbin/sysupgrade: line 115: busybox: not found
/sbin/sysupgrade: line 115: busybox: not found
/sbin/sysupgrade: line 115: umount: not found
/sbin/sysupgrade: line 115: grep: not found
/sbin/sysupgrade: exec: line 115: /bin/busybox: not found
@PHOENIX:/mnt/home/transfer#

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by nico

  • Milestone changed from Backfire 10.03.1 to Kamikaze

comment:2 Changed 7 years ago by Mark Mentovai <mark@…>

I see this too now that uClibc 0.9.31 is the default, as of r23781.

root@OpenWrt:/# sysupgrade /tmp/openwrt-ar71xx-generic-wndr3700-squashfs-sysupgrade.bin 
Saving config files...
Switching to ramdisk...
Segmentation fault
Segmentation fault
/sbin/sysupgrade: line 134: busybox: not found
/sbin/sysupgrade: line 134: busybox: not found
/sbin/sysupgrade: line 134: busybox: not found
/sbin/sysupgrade: line 134: umount: not found
/sbin/sysupgrade: line 134: grep: not found
/sbin/sysupgrade: exec: line 134: /bin/busybox: not found
@OpenWrt:/# 

Stepping through /sbin/sysupgrade and /lib/upgrade/common.sh’s run_ramfs, the segmentation fault seems to happen on the call to libs:

root@OpenWrt:~# ash
root@OpenWrt:~# . /etc/functions.sh 
root@OpenWrt:~# libs /bin/busybox 
/lib/libcrypt.so.0
/lib/libm.so.0
/lib/libc.so.0
Segmentation fault

and that’s where things seem to fall apart. libs wraps ldd.

root@OpenWrt:~# ldd /bin/busybox 
        libcrypt.so.0 => /lib/libcrypt.so.0 (0x2aabe000)
        libm.so.0 => /lib/libm.so.0 (0x2aae2000)
        libc.so.0 => /lib/libc.so.0 (0x2ab07000)
Segmentation fault

That doesn’t look too good.

install_bin in /lib/upgrade/common.sh has this little bit of fallback:

        [ -e /lib/ld-linux.so.3 ] && {
                install_file /lib/ld-linux.so.3
        }

but with uClibc, ld.so is named /lib/ld-uClibc.so.0 instead. Adding a fallback for this file in addition to (or instead of) ld-linux.so.3 allows the upgrade to proceed in spite of the segmentation fault errors. A better solution would be to fix ldd.

comment:4 Changed 7 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Committed in r23892 - full toolchain rebuild required.

comment:5 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.