From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20724 invoked by alias); 10 Feb 2014 12:39:20 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20686 invoked by uid 48); 10 Feb 2014 12:39:15 -0000 From: "vogt at linux dot vnet.ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug go/60134] New: runtime_unmarkspan panics with "unaligned pointer" Date: Mon, 10 Feb 2014 12:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: go X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vogt at linux dot vnet.ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ian at airs dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-02/txt/msg00957.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60134 Bug ID: 60134 Summary: runtime_unmarkspan panics with "unaligned pointer" Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: vogt at linux dot vnet.ibm.com (using git commit id e63988cca99cbbf6e5c459379309fe3359fe7c09) The test case convert.go fails with a panic in a panic on System/z: -- snip -- fatal error: markspan: unaligned pointer goroutine 1 [running]: runtime_dopanic ../../../libgo/runtime/panic.c:77 runtime_throw ../../../libgo/runtime/panic.c:115 runtime_unmarkspan ../../../libgo/runtime/mgc0.c:2452 __go_free ../../../libgo/runtime/malloc.goc:240 __go_panic ../../../libgo/runtime/go-panic.c:106 runtime_panicstring ../../../libgo/runtime/panic.c:134 __go_map_index ../../../libgo/runtime/go-map-index.c:92 reflect.canonicalize ../../../libgo/go/reflect/type.go:1782 reflect.toType ../../../libgo/go/reflect/type.go:1791 reflect.TypeOf ../../../libgo/go/reflect/type.go:1026 fmt..import ../../../libgo/go/fmt/print.go:643 __go_init_main /home/vogt/src/git/gcc/gcc/testsuite/go.test/test/convert.go:9 runtime_main ../../../libgo/runtime/proc.c:555 kickoff ../../../libgo/runtime/proc.c:232 -- snip -- It turns out that mgc0.c:runtime_unmarkspan() is called with a pointer that should be 16 byte aligned (wordsPerBitmapWord) but is actually only 8 byte aligned. The original pointer points to the stack variable "Defer d" in proc.c:runtime_main(). I guess the code should somehow enforce that "Defer d" is aligned to mgc0.c:wordsPerBitmapWord bytes, although I'm not sure about the right way to fix this. Note: Even though adding "__attribute__ ((align(16)))" for d fixes the problem for me, the test case still fails, but that is another issue that may or may not be platform specific. In any case I'll look into that and open another bug report if necessary.