eglibc newer than 2.12.1 in natty results in alignment errors, SIGLILL and segfaults on tegra2 systems
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
eglibc (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
doing an upgrade from a maverick to a natty rootfs on tegra2 hardware results in a mostly nonworking system, apps segfailt or die with SIGILL, dmesg is full of alignment error messages.
apparently tegra 2 processors have a bug in the register read path of bit 20 of the CP15 c13, 3 register (used for software thread local storage)
there is a tegra errata (657451) for kernel as well as for the android bionic lib that seems to work around the issue
http://
in maverick libc did not have this issue, it only regressed in natty due to either a change in libc or in the toolchain.
pinning libc to 2.12.1 and doing a dist-upgrade makes everything work fine.
Note that the approach taken by that patch is that when writing the TLS register we move bit 20 down into bit 0, and then on reading we move bit 0 back up into bit 20. So this requires changes to everything that reads or writes the TLS register. There are Android patches that do this for libc and the kernel; however gcc will happily emit inline TLS register accesses for __thread variables if it is compiling for armv7, because it knows the CP15 register must exist. Presumably for Android the idea is that code going onto the device can be controlled sufficiently to mandate compiling with non-inline TLS accesses. Unfortunately I don't think that's going to fly for a generic Linux...