Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 565630

Summary: sys-apps/sandbox-2.8+ broken on Sparc64 ("Bus error" in canonicalize_filename_mode())
Product: Gentoo Linux Reporter: Denis Kaganovich <mahatma>
Component: Current packagesAssignee: Sandbox Maintainers <sandbox>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: Sparc64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 371525    
Attachments: sanbox sparc fastfix

Description Denis Kaganovich 2015-11-12 19:14:36 UTC
After commit 93d401570d4e54f732c0f821cdbb5ba2e1dee0f3 (bug #540828) sandbox starts to generate sparc-specific "Bus error". After rollback this commit and simple add canonicalize_filename_mode() without "ret=" I see there are only from canonicalize_filename_mode(). I have slow TI UltraSparc IIe (Hummingbird) on work only for fun, so my patch keep only old code here (while? I will try more - may be).

Also better to remove "~sparc" from 2.8 & 2.9.

Reproducible: Always
Comment 1 Denis Kaganovich 2015-11-12 19:19:12 UTC
Created attachment 416808 [details, diff]
sanbox sparc fastfix

Workaround
Comment 2 SpanKY gentoo-dev 2015-11-13 00:50:21 UTC
sorry, but we're not adding arch specific code like this
Comment 3 Denis Kaganovich 2015-11-13 10:23:38 UTC
OK, normal way to fix "portable" gnulib code (this is pointer manipulation/byteorder bug), I just post my fast solution. But anymore "~sparc" in KEYWORDS in this versions must be removed - else after installing 2.8 or 2.9 single way to emerge anything is FEATURES="-sandbox -usersandbox"
Comment 4 SpanKY gentoo-dev 2015-12-19 07:33:28 UTC
sandbox was returning misaligning memory to 4 bytes (size_t).  when the gnulib code went to add the file to the hashed state (record_file), it'd do a 64bit (st_dev) write to 4 byte aligned memory which would trigger the SIGBUS.  fix is to make sure the internal malloc doesn't return unaligned memory.

http://gitweb.gentoo.org/proj/sandbox.git/commit/?id=767becaac8ccf0a271fc7633fafe635bf8126f3e