h8300-hitachi-coff-ar assert failure: *** buffer overflow detected ***: /usr/bin/h8300-hms-ar terminated

Bug #641789 reported by Daniel Stiner
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils-h8300-hms (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

Binary package hint: binutils-h8300-hms

Was building brickos from source, failed partway
Seems that the h8300 package was not built correctly?

Not a high priority, I just know that this build worked in 8.04 and I think 10.04

/usr/bin/h8300-hms-ar -sq libc.a memcpy.o memset.o strcmp.o strcpy.o strlen.o random.o printf.o
/usr/bin/h8300-hms-ar: creating libc.a
*** buffer overflow detected ***: /usr/bin/h8300-hms-ar terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x37)[0x2b7e59b21537]
/lib/libc.so.6(+0xfe3f0)[0x2b7e59b203f0]
/lib/libc.so.6(+0xfd859)[0x2b7e59b1f859]
/lib/libc.so.6(_IO_default_xsputn+0xcc)[0x2b7e59a97c2c]
/lib/libc.so.6(_IO_padn+0xe8)[0x2b7e59a8b6e8]
/lib/libc.so.6(_IO_vfprintf+0x2af3)[0x2b7e59a6a133]
/lib/libc.so.6(__vsprintf_chk+0x99)[0x2b7e59b1f8f9]
/lib/libc.so.6(__sprintf_chk+0x7f)[0x2b7e59b1f83f]
/usr/bin/h8300-hms-ar[0x409734]
/usr/bin/h8300-hms-ar[0x407931]
/usr/bin/h8300-hms-ar[0x40a0b2]
/usr/bin/h8300-hms-ar[0x41107f]
/usr/bin/h8300-hms-ar[0x4041bf]
/usr/bin/h8300-hms-ar[0x4046ad]
/usr/bin/h8300-hms-ar[0x40517f]
/lib/libc.so.6(__libc_start_main+0xfe)[0x2b7e59a40d8e]
/usr/bin/h8300-hms-ar[0x401de9]
======= Memory map: ========
00400000-00439000 r-xp 00000000 08:05 786909 /usr/bin/h8300-hitachi-coff-ar
00638000-00639000 r--p 00038000 08:05 786909 /usr/bin/h8300-hitachi-coff-ar
00639000-0063a000 rw-p 00039000 08:05 786909 /usr/bin/h8300-hitachi-coff-ar
0063a000-0063e000 rw-p 00000000 00:00 0
009fc000-00a1d000 rw-p 00000000 00:00 0 [heap]
2b7e597ff000-2b7e5981f000 r-xp 00000000 08:05 14027579 /lib/ld-2.12.1.so
2b7e5981f000-2b7e59821000 rw-p 00000000 00:00 0
2b7e59a1f000-2b7e59a20000 r--p 00020000 08:05 14027579 /lib/ld-2.12.1.so
2b7e59a20000-2b7e59a21000 rw-p 00021000 08:05 14027579 /lib/ld-2.12.1.so
2b7e59a21000-2b7e59a22000 rw-p 00000000 00:00 0
2b7e59a22000-2b7e59b9c000 r-xp 00000000 08:05 14027570 /lib/libc-2.12.1.so
2b7e59b9c000-2b7e59d9b000 ---p 0017a000 08:05 14027570 /lib/libc-2.12.1.so
2b7e59d9b000-2b7e59d9f000 r--p 00179000 08:05 14027570 /lib/libc-2.12.1.so
2b7e59d9f000-2b7e59da0000 rw-p 0017d000 08:05 14027570 /lib/libc-2.12.1.so
2b7e59da0000-2b7e59da7000 rw-p 00000000 00:00 0
2b7e59da7000-2b7e5a04b000 r--p 00000000 08:05 1967103 /usr/lib/locale/locale-archive
2b7e5a04b000-2b7e5a052000 r--s 00000000 08:05 1974543 /usr/lib/gconv/gconv-modules.cache
2b7e5a052000-2b7e5a05b000 rw-p 00000000 00:00 0
2b7e5a077000-2b7e5a08c000 r-xp 00000000 08:05 14024808 /lib/libgcc_s.so.1
2b7e5a08c000-2b7e5a28b000 ---p 00015000 08:05 14024808 /lib/libgcc_s.so.1
2b7e5a28b000-2b7e5a28c000 r--p 00014000 08:05 14024808 /lib/libgcc_s.so.1
2b7e5a28c000-2b7e5a28d000 rw-p 00015000 08:05 14024808 /lib/libgcc_s.so.1
7fffcd76c000-7fffcd78d000 rw-p 00000000 00:00 0 [stack]
7fffcd7ff000-7fffcd800000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
make[2]: *** [libc.a] Aborted (core dumped)
make[2]: *** Deleting file `libc.a'
make[2]: Leaving directory `/home/daniel/Dropbox/lego/brickos-0.9.0/lib/c'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/home/daniel/Dropbox/lego/brickos-0.9.0/lib'
make: *** [install] Error 2

ProblemType: Crash
DistroRelease: Ubuntu 10.10
Package: binutils-h8300-hms 2.16.1-8
ProcVersionSignature: Ubuntu 2.6.35-20.29-generic 2.6.35.4
Uname: Linux 2.6.35-20-generic x86_64
Architecture: amd64
AssertionMessage: *** buffer overflow detected ***: /usr/bin/h8300-hms-ar terminated
CrashCounter: 1
Date: Fri Sep 17 23:27:39 2010
ExecutablePath: /usr/bin/h8300-hitachi-coff-ar
InstallationMedia: Ubuntu 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.1)
ProcCmdline: /usr/bin/h8300-hms-ar -sq libc.a memcpy.o memset.o strcmp.o strcpy.o strlen.o random.o printf.o
ProcEnviron:
 SHELL=/bin/bash
 PATH=(custom, no user)
 LANG=en_US.utf8
Signal: 6
SourcePackage: binutils-h8300-hms
StacktraceTop:
 raise () from /lib/libc.so.6
 abort () from /lib/libc.so.6
 ?? () from /lib/libc.so.6
 __fortify_fail () from /lib/libc.so.6
 __chk_fail () from /lib/libc.so.6
Title: h8300-hitachi-coff-ar assert failure: *** buffer overflow detected ***: /usr/bin/h8300-hms-ar terminated
UserGroups:

Revision history for this message
Daniel Stiner (danstiner) wrote :
Revision history for this message
Apport retracing service (apport) wrote :

StacktraceTop:
 *__GI_raise (sig=<value optimized out>)
 *__GI_abort () at abort.c:92
 __libc_message (do_abort=<value optimized out>,
 *__GI___fortify_fail (
 *__GI___chk_fail () at chk_fail.c:29

Revision history for this message
Apport retracing service (apport) wrote : Stacktrace.txt
Revision history for this message
Apport retracing service (apport) wrote : ThreadStacktrace.txt
Changed in binutils-h8300-hms (Ubuntu):
importance: Undecided → Medium
tags: removed: need-amd64-retrace
visibility: private → public
Revision history for this message
Brian Stinson (bstinson) wrote :

There seem to be a few sprintfs in the archive code that were overflowing by 1 character. I have reduced the padding length in the format string to remedy this and it seems to build fine for me. I have not tested this all the way down at the robots yet. Another possible solution (though I'm not sure which one is better) would be to increase the size of the character arrays in the ar_hdr struct in 'include/aout/ar.h'. Hope this helps someone else.

Revision history for this message
Daniel Stiner (danstiner) wrote :

Thanks for the patch Brian,

I've never patched and built from source, I tried but the error still seemed to be there when actually compiling the example robot C code.

I'll try to build it again over thanksgiving break and see how it comes out. Any building tips/a binary pre-built would be appreciated.

Thanks again.

Revision history for this message
dino99 (9d9) wrote :

This version is outdated and no more supported

Changed in binutils-h8300-hms (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.