Bug#883179: dash: compiles in signals from build architecture when cross-compiled
Package: dash Followup-For: Bug #883179 Control: User debian-cr...@lists.debian.org Control: Usertags -1 + ftcbfs Add to the cross compile list of bug not really a ftcbfs but it is will lead to ftcbfs -- System Information: Debian Release: bookworm/sid APT prefers testing APT policy: (900, 'testing') Architecture: amd64 (x86_64) Foreign Architectures: i386, armel Kernel: Linux 6.1.0-3-rt-amd64 (SMP w/4 CPU threads; PREEMPT) Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages dash depends on: ii debianutils 5.7-0.4 ii dpkg 1.21.20 ii libc62.36-8 dash recommends no packages. dash suggests no packages. -- debconf information excluded
Bug#883179: dash: compiles in signals from build architecture when cross-compiled
Control: tags 883179 + upstream Hi, James Cowgill wrote: > When cross-compiled, dash compiles in a list of signal names used for > various purposes (eg kill -NAME). Unfortunately the signal names are > generated by using the *build* compiler instead of the *host* compiler > so the signals are incorrect when dash is actually run on the host machine. Interesting! I assume you're referring to src/mksignames.c. I think this should be doable using preprocessor alone instead of generated code. Failing that, I think we can do something in configure e.g. using the #warning trick. Will look into it. > I notice the signal generation code has been copied from bash. Newer > versions of bash have a fix for this which initialized the list of > signals at runtime when cross-compiled. Maybe you could copy the fix > from bash? I think that would go against dash's goal of being small and simple. It might be possible to simplify the way the signal name table is used to avoid the need for code generation altogether, though, which would be even nicer. Thanks, Jonathan
Bug#883179: dash: compiles in signals from build architecture when cross-compiled
Source: dash Version: 0.5.8-2.5 Severity: normal Hi, When cross-compiled, dash compiles in a list of signal names used for various purposes (eg kill -NAME). Unfortunately the signal names are generated by using the *build* compiler instead of the *host* compiler so the signals are incorrect when dash is actually run on the host machine. This was originally noticed by YunQiang Su while working on MIPS r6. Since NSIG is larger on MIPS than on x86, running a command which attempts to parse an invalid signal (like "kill -s TERM 1" which tries to parse a signal named "s" first) will search off the end of the list of signals and crash with a NULL pointer dereference (src/trap.c decode_signal). I notice the signal generation code has been copied from bash. Newer versions of bash have a fix for this which initialized the list of signals at runtime when cross-compiled. Maybe you could copy the fix from bash? Thanks, James signature.asc Description: OpenPGP digital signature