Project

General

Profile

Bug #11900

Core dump from libz (zlib)

Added by Gary Mills 4 months ago.

Status:
New
Priority:
Normal
Assignee:
Category:
OI-Userland
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

The OI source is from 2018. Consequently, there may be a new version of the source, or some of the bugs may have already been fixed. Though the changes have been developed on SPARC hardware, they might correct bugs in some x86 packages. In any case, they should not damage other x86 packages.

Any command linked with zlib built on SPARC will dump core with a bus error. Here's the analysis of one such core file:

> ::status
debugging core file of fiocompress (32-bit) from t2000
file: /sbin/fiocompress
initial argv: /usr/sbin/fiocompress -mc libldap.so.5 /tmp/libldap.so.5
threading model: native threads
status: process terminated by SIGBUS (Bus Error), addr=25d53
> ::stack
libz.so.1.2.11`longest_match+0x64(24678, 9, 25d48, 2, 1000, 25d54)
libz.so.1.2.11`deflate_slow+0x40c(45d58, 4, 1, a, 7efa, 24678)
libz.so.1.2.11`deflate+0x148(0, 4, 12, 6c, ffbffaf0, 24678)
libz.so.1.2.11`compress2+0xa0(22658, ffbffb94, ff180000, 0, 0, 0)
do_comp+0x130(2000, 178, 224d8, 22370, ffbffb94, 29)
main+0xe0(2, ffbffcbc, ffbffcd0, 0, 0, 0)
_start_crt+0x70(4, ffbffcbc, ff3b8ffc, 0, 0, 0)
_start+0x14(0, 0, 0, 0, 0, 0)
> ^D

The cause of this error was unaligned access. The solution is to correct Makefile to use unaligned access only on x86. The patch Makefile.diff accomplishes this change. A test after this change to the Makefile was successful: there was no core dump, and the compression worked.


Files

Makefile.diff (733 Bytes) Makefile.diff Gary Mills, 2019-10-31 01:08 AM

Also available in: Atom PDF