[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#681760: busybox: broken on s390x due to alignment issues



forwarded 681760 http://lists.busybox.net/pipermail/busybox/2012-July/078155.html
tags 681760 + pending
thanks

On 16.07.2012 12:57, Aurelien Jarno wrote:

> busybox is currently broken on s390x to the point of not being usable.
> Depending on the configuration, some strings are replaced by empty 
> strings. For the current version 1:1.20.0-5, this is the case of at 
> least for the banner and the binary path, the later causing all exec
> applets to fail to execute. In turns this renders the system 
> unbootable:
[]
> This is due to aggressive size optimization by chaning the default 
> strings alignement in the definitions of the strings in 
> libbb/messages.c. Given it is not done in the corresponding declarations
> in include/libbb.h, the compiler is free to optimize the access to these
> constants with aligned access, which is what GCC does on s390x. This is
> why the bug appears and disappears from version to version, as the issue
> depends on the size of neighbouring constants and variables.
> 
> The patch below, also submitted upstream and adapted to the debian 
> package (due to changes in shell-ash-export-HOME.patch) fixes the 
> problem.

Thank you for the excellent bugreport.  If you ask me, I'd say the whole
thing - killing alignment - is not worth the effort here, it saves a
few bytes but may cost much more, like is demonstrated by this very
issue, so I'd just remove the ALIGN1 marker.  Also, I'd say it is a
bug in GCC, since it produces no warning when declaration and definition
of the same variable are different and may produce different results.

As for the patch, I'd use the same patch as sent to upstream, and adapt
the ash-export-HOME instead, since it is already debian-specific.  But
I'm not sure what's better for the release team.  I'll ask around.

Thanks you!

/mjt


Reply to: