NetBSD Problem Report #46385

From martin@aprisoft.de  Fri Apr 27 10:21:02 2012
Return-Path: <martin@aprisoft.de>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	by www.NetBSD.org (Postfix) with ESMTP id DF08A63C4B1
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 27 Apr 2012 10:21:01 +0000 (UTC)
Message-Id: <20120427102110.9F8F0AF5824@emmas.aprisoft.de>
Date: Fri, 27 Apr 2012 12:21:10 +0200 (CEST)
From: martin@NetBSD.org
Reply-To: martin@NetBSD.org
To: gnats-bugs@gnats.NetBSD.org
Subject: gcc internal error compiling boost-libs on sparc64
X-Send-Pr-Version: 3.95

>Number:         46385
>Category:       toolchain
>Synopsis:       gcc internal error compiling boost-libs on sparc64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 27 10:25:00 +0000 2012
>Closed-Date:    Mon Nov 21 05:40:26 +0000 2016
>Last-Modified:  Mon Nov 21 05:40:26 +0000 2016
>Originator:     Martin Husemann
>Release:        NetBSD 6.99.5
>Organization:
The NetBSD Foundation, Inc.
>Environment:
System: NetBSD whoever-brings-the-night.aprisoft.de 6.99.5 NetBSD 6.99.5 (MODULAR) #166: Wed Apr 25 10:56:51 CEST 2012 martin@emmas.aprisoft.de:/nelly/usr/src/sys/arch/sparc64/compile/MODULAR sparc64
Architecture: sparc64
Machine: sparc64
>Description:

Trying to build devel/boost-libs on sparc64 -current breaks with an internal
gcc compiler error:

ore was generated by `cc1plus'.
Program terminated with signal 4, Illegal instruction.
#0  0x00000000001ba7a0 in gt_ggc_mx_lang_tree_node ()

Note that the compile uses g++ -O3.

However, it is not clear to me why it gets a signal:

(gdb) x/16i 0x00000000001ba780
   0x1ba780 <gt_ggc_mx_lang_tree_node+4480>:    nop 
   0x1ba784 <gt_ggc_mx_lang_tree_node+4484>:    ldx  [ %l0 + 0x50 ], %o0
   0x1ba788 <gt_ggc_mx_lang_tree_node+4488>:    
    brz,a,pn   %o0, 0x1ba79c <gt_ggc_mx_lang_tree_node+4508>
   0x1ba78c <gt_ggc_mx_lang_tree_node+4492>:    ld  [ %l0 + 0x58 ], %g1
   0x1ba790 <gt_ggc_mx_lang_tree_node+4496>:    
    call  0x1b9600 <gt_ggc_mx_lang_tree_node>
   0x1ba794 <gt_ggc_mx_lang_tree_node+4500>:    nop 
   0x1ba798 <gt_ggc_mx_lang_tree_node+4504>:    ld  [ %l0 + 0x58 ], %g1
   0x1ba79c <gt_ggc_mx_lang_tree_node+4508>:    
    brz,pn   %g1, 0x1b96fc <gt_ggc_mx_lang_tree_node+252>
=> 0x1ba7a0 <gt_ggc_mx_lang_tree_node+4512>:    stx  %g1, [ %fp + 0x7f7 ]
   0x1ba7a4 <gt_ggc_mx_lang_tree_node+4516>:    mov  %l0, %g1
   0x1ba7a8 <gt_ggc_mx_lang_tree_node+4520>:    clr  %i1
   0x1ba7ac <gt_ggc_mx_lang_tree_node+4524>:    ldx  [ %g1 + 0x60 ], %o0
   0x1ba7b0 <gt_ggc_mx_lang_tree_node+4528>:    
    brz,pn   %o0, 0x1ba7c8 <gt_ggc_mx_lang_tree_node+4552>
   0x1ba7b4 <gt_ggc_mx_lang_tree_node+4532>:    ldx  [ %fp + 0x7f7 ], %g2
   0x1ba7b8 <gt_ggc_mx_lang_tree_node+4536>:    
    call  0x1b9600 <gt_ggc_mx_lang_tree_node>
   0x1ba7bc <gt_ggc_mx_lang_tree_node+4540>:    stx  %g1, [ %fp + 0x7ef ]

Nothing illegal in this instructions, AFAICT, but %fp looks bogus:

g0             *value not available*
g1             0x0      0
g2             0x3bfffffffc000000       4323455642208567296
g3             0x30     48
g4             0x3bfffffffc000000       4323455642208567296
g5             0x1      1
g6             0x0      0
g7             0x40a18040       1084325952
o0             0x0      0
o1             0x1      1
o2             0x7b5000 8081408
o3             0x7f0cc8 8326344
o4             0x7b5c00 8084480
o5             0x200    512
sp             0xffffffffffdfd621       0xffffffffffdfd621
o7             0x1ba704 1812228
l0             0x1      1
l1             0x1      1
l2             0x1      1
l3             0x1      1
l4             0x1      1
l5             0x1      1
l6             0x1      1
l7             0x1      1
i0             0x1      1
i1             0x1      1
i2             0x1      1
i3             0x1      1
i4             0x1      1
i5             0x1      1
fp             0x1      0x1
i7             0x1      1
pc             0x1ba7a0 0x1ba7a0 <gt_ggc_mx_lang_tree_node+4512>
npc            0x1b96fc 0x1b96fc <gt_ggc_mx_lang_tree_node+252>
state          0x4482008204     294238847492
fsr            0x820    [ NXC #11 ]
fprs           *value not available*
y              0x0      0
cwp            0x4      4
pstate         0x82     [ IE #7 ]
asi            0x82     130
ccr            0x44     68


>How-To-Repeat:

Seems to be repeatable for me, I'll try on another machine to make sure.

>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/46385: gcc internal error compiling boost-libs on sparc64
Date: Fri, 27 Apr 2012 16:04:55 +0200

 I patched the boost-libs build and see different (but alike) failures
 with -O2.

 It works with -O1.

 Martin

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/46385: gcc internal error compiling boost-libs on sparc64
Date: Sun, 02 Oct 2016 07:46:32 +1100

 it seems the compiler error is gone on modern boost-libs but now
 there is missing "context" (ucontext(2)?) support for sparc*.
 it ends up chosing an "unsupported.cpp" from 
 libs/context/build/Jamfile.v2.


 .mrg.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: toolchain/46385: gcc internal error compiling boost-libs on sparc64
Date: Tue, 11 Oct 2016 17:43:39 +0200

 On Sat, Oct 01, 2016 at 08:50:01PM +0000, matthew green wrote:
 >  it seems the compiler error is gone on modern boost-libs but now
 >  there is missing "context" (ucontext(2)?) support for sparc*.
 >  it ends up chosing an "unsupported.cpp" from 
 >  libs/context/build/Jamfile.v2.

 Oliver asked me to take a look at it again after optimzations, but at that
 time pkgsrc jam was too old - I'll check again now.

 Guess this PR should be closed.

 Martin

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Mon, 21 Nov 2016 05:40:26 +0000
State-Changed-Why:
fixed by (presumably) one of the intervening gcc updates.

please file another PR on the context issue...


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.