Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"busybox-static" can't exit cleanly #179

Open
megastallman opened this issue Dec 15, 2024 · 0 comments
Open

"busybox-static" can't exit cleanly #179

megastallman opened this issue Dec 15, 2024 · 0 comments

Comments

@megastallman
Copy link

Hello people!
I've got a static build of Busybox, the one from Kubuntu 24.04 package, that almost works. But it causes a segfault on blink/blink.c, line 176, unassert(!kill(getpid(), syssig));
Here is the output:

BusyBox v1.36.1 (Ubuntu 1:1.36.1-6ubuntu3.1) multi-call binary.
BusyBox is copyrighted by many authors between 1998-2015.
Licensed under GPLv2. See source distribution for detailed
copyright notices.

Usage: busybox [function [arguments]...]
   or: busybox --list[-full]
   or: busybox --install [-s] [DIR]
   or: function [arguments]...

        BusyBox is a multi-call binary that combines many common Unix
        utilities into a single executable.  The shell in this build
        is configured to run built-in utilities without $PATH search.
        You don't need to install a link to busybox for each utility.
        To run external program, use full path (/sbin/ip instead of ip).

Currently defined functions:
        [, [[, acpid, adjtimex, ar, arch, arp, arping, ascii, ash, awk, base64, basename, bc, blkdiscard, blockdev, brctl, bunzip2, busybox, bzcat,
        bzip2, cal, cat, chgrp, chmod, chown, chpasswd, chroot, chvt, clear, cmp, cp, cpio, crc32, crond, crontab, cttyhack, cut, date, dc, dd,
        deallocvt, depmod, devmem, df, diff, dirname, dmesg, dnsdomainname, dos2unix, dpkg, dpkg-deb, du, dumpkmap, dumpleases, echo, ed, egrep,
        env, expand, expr, factor, fallocate, false, fatattr, fdisk, fgrep, find, findfs, fold, free, freeramdisk, fsfreeze, fstrim, ftpget,
        ftpput, getopt, getty, grep, groups, gunzip, gzip, halt, head, hexdump, hostid, hostname, httpd, hwclock, i2cdetect, i2cdump, i2cget,
        i2cset, i2ctransfer, id, ifconfig, ifdown, ifup, init, insmod, ionice, ip, ipcalc, kill, killall, klogd, last, less, link, linux32,
        linux64, linuxrc, ln, loadfont, loadkmap, logger, login, logname, logread, losetup, ls, lsmod, lsscsi, lzcat, lzma, lzop, md5sum, mdev,
        microcom, mim, mkdir, mkdosfs, mke2fs, mkfifo, mknod, mkpasswd, mkswap, mktemp, modinfo, modprobe, more, mount, mt, mv, nameif, nbd-client,
        nc, netstat, nl, nologin, nproc, nsenter, nslookup, nuke, od, openvt, partprobe, passwd, paste, patch, pidof, ping, ping6, pivot_root,
        poweroff, printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, resume, rev, rm, rmdir, rmmod, route, rpm, rpm2cpio, run-init,
        run-parts, sed, seq, setkeycodes, setpriv, setsid, sh, sha1sum, sha256sum, sha3sum, sha512sum, shred, shuf, sleep, sort, ssl_client,
        start-stop-daemon, stat, static-sh, strings, stty, su, sulogin, svc, svok, swapoff, swapon, switch_root, sync, sysctl, syslogd, tac, tail,
        tar, taskset, tc, tee, telnet, telnetd, test, tftp, time, timeout, top, touch, tr, traceroute, traceroute6, true, truncate, ts, tty,
        tunctl, ubirename, udhcpc, udhcpc6, udhcpd, uevent, umount, uname, uncompress, unexpand, uniq, unix2dos, unlink, unlzma, unshare, unxz,
        unzip, uptime, usleep, uudecode, uuencode, vconfig, vi, w, watch, watchdog, wc, wget, which, who, whoami, xargs, xxd, xz, xzcat, yes, zcat
E2024-12-15T12:46:04.377679:blink/blink.c:158:98564 terminating due to SIGSEGV (rip=0x7ffff71fffed code=2 faultaddr=0x7ffff71fffef)
E2024-12-15T12:46:04.379257:blink/blink.c:142:98564 additional information
         PC 7ffff71fffed popf  9d 1d 2f 6f 70 74 2f 74
         AX 00007ffff71fffef  CX 0000000000000001  DX 0000000000000005  BX 0000000000000002
         SP 00007ffff71fe6c8  BP 00007ffff71fe720  SI 0000000000000000  DI 0000000000000000
         R8 0000000000000000  R9 0000000000000007 R10 000013a70e0014d0 R11 66ec737e4b4ddfd6
        R12 0000000000000000 R13 0000000000000001 R14 0000000000000000 R15 0000000000606720
         FS 000013a70e0003c0  GS 0000000000000000 OPS 5542             FLG ......
        /opt/tmp/busybox
        7ffff71fe720 7ffff71fffed UNKNOWN 88 bytes
        7ffff71fe730 00000041525e UNKNOWN 16 bytes
        7ffff71fe750 000000511147 UNKNOWN 32 bytes
        7ffff71fe7a0 000000511b71 UNKNOWN 80 bytes
        7ffff71fe840 000000411518 UNKNOWN 160 bytes
        7ffff71fe890 0000004136e0 UNKNOWN 80 bytes
        000000000000 000000410895 UNKNOWN
000000400000-000000400fff  4096 r   /opt/tmp/busybox
000000401000-0000005a8fff 1696k rx  /opt/tmp/busybox
0000005a9000-000000603fff  364k r   /opt/tmp/busybox
000000604000-00000060dfff   40k rw  /opt/tmp/busybox
13a70e000000-13a70e021fff  136k rw  [heap]
7ffff6a00000-7ffff71fffff*8192k rw  [stack]
blink backtrace
        55555555d042 TerminateSignal+337
        555555596132 DeliverSignalToUser+193
        5555555962c7 HaltMachine+255
        5555555a8308 LoadInstruction+82
        55555556e763 ExecuteInstruction+395
        55555556ea10 Actor+49
        55555556eac4 Blink+67
        55555555cdd5 Exec+541
        55555555c7d1 main+849
        7ffff7c2a1ca __libc_init_first+138
        7ffff7c2a28b __libc_start_main+139
        55555555c995 _start+37
[1] + Done

and the debugger output:

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
The program '/opt/tmp/blink/o/blink/blink' has exited with code 0 (0x00000000).

The exit code of zero doesn't look like a bad thing though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant