NetBSD Problem Report #50287

From tsutsui@ceres.dti.ne.jp  Mon Sep 28 16:09:05 2015
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 35AB5A6531
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 28 Sep 2015 16:09:05 +0000 (UTC)
Message-Id: <201509281609.t8SG90vQ023645@mirage.localdomain>
Date: Tue, 29 Sep 2015 01:09:00 +0900 (JST)
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: x11/wxGTK30 build on NetBSD/i386 7.0 spins CPU 100%
X-Send-Pr-Version: 3.95

>Number:         50287
>Category:       pkg
>Synopsis:       x11/wxGTK30 build on NetBSD/i386 7.0 spins CPU 100%
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 28 16:10:00 +0000 2015
>Closed-Date:    Sat Feb 20 16:30:23 +0000 2016
>Last-Modified:  Thu Jun 02 11:45:01 +0000 2016
>Originator:     Izumi Tsutsui
>Release:        NetBSD 7.0 + pkgsrc-2015Q3
>Organization:
>Environment:
System: NetBSD optiplex 7.0 NetBSD 7.0 (GENERIC.201509250726Z) i386
Architecture: i386
Machine: i386
>Description:
pkgsrc/x11/wxGTK30 build on NetBSD/i386 7.0 spins CPU 100% in cc1plus:
---
 :

libtool: link: (cd "/usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/.libs" && rm -f "libwx_baseu_net-3.0.so.0" && ln -s "libwx_baseu_net-3.0.so.0.1.0" "libwx_baseu_net-3.0.so.0")
libtool: link: (cd "/usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/.libs" && rm -f "libwx_baseu_net-3.0.so" && ln -s "libwx_baseu_net-3.0.so.0.1.0" "libwx_baseu_net-3.0.so")
libtool: link: ar cru /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/.libs/libwx_baseu_net-3.0.a  netdll_fs_inet.o netdll_ftp.o netdll_http.o netdll_protocol.o netdll_sckaddr.o netdll_sckfile.o netdll_sckipc.o netdll_sckstrm.o netdll_socket.o netdll_url.o netdll_socketiohandler.o netdll_sockunix.o
libtool: link: ranlib /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/.libs/libwx_baseu_net-3.0.a
libtool: link: ( cd "/usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/.libs" && rm -f "libwx_baseu_net-3.0.la" && ln -s "../libwx_baseu_net-3.0.la" "libwx_baseu_net-3.0.la" )
/usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/bk-make-pch ./.pch/wxprec_coredll/wx/wxprec.h.gch wx/wxprec.h c++ -I./.pch/wxprec_coredll -D__WXGTK__        -DWXBUILDING        -I./src/regex  -DWXUSINGDLL -DWXMAKINGDLL_CORE  -DwxUSE_BASE=0 -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/wx/include/gtk2-unicode-3.0 -I./include -D_REENTRANT -pthread -I/usr/pkg/include/gtk-2.0 -I/usr/pkg/lib/gtk-2.0/include -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib/gio-unix-2.0/ -I/usr/X11R7/include -I/usr/pkg/include/cairo -I/usr/pkg/include/atk-1.0 -I/usr/pkg/include/cairo -I/usr/X11R7/include/pixman-1 -I/usr/pkg/include/libpng16 -I/usr/X11R7/include -I/usr/pkg/include/gdk-pixbuf-2.0 -I/usr/pkg/include/libpng16 -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/harfbuzz -I/usr/pkg/include/pango-1.0 -I/usr/X11R7/include/freetype2 -I/usr/X11R7/inclu!
 de -I/usr/X11R7/include/freetype2 -I/usr/X11R7/include -I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include -pthread -I/usr/pkg/include/gstreamer-0.10 -I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include -I/usr/pkg/include/libxml2 -D_NETBSD_SOURCE -D_LIBC -I/usr/pkg/include -I/usr/X11R7/include -I/usr/include -I/usr/X11R7/include/libdrm -I/usr/X11R7/include/freetype2 -DWX_PRECOMP -pthread -D_REENTRANT -pthread -I/usr/pkg/include/gtk-unix-print-2.0 -I/usr/pkg/include/gtk-2.0 -I/usr/pkg/lib/gtk-2.0/include -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib/gio-unix-2.0/ -I/usr/X11R7/include -I/usr/pkg/include/cairo -I/usr/pkg/include/atk-1.0 -I/usr/pkg/include/cairo -I/usr/X11R7/include/pixman-1 -I/usr/pkg/include/libpng16 -I/usr/X11R7/include -I/usr/pkg/include/gdk-pixbuf-2.0 -I/usr/pkg/include/libpng16 -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/harfbuzz -I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/glib/!
 glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include -I!
 /usr/X11R7/include/freetype2 -I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/X11R7/include -O2 -I/usr/pkg/include -I/usr/X11R7/include -I/usr/include -I/usr/X11R7/include/libdrm -I/usr/X11R7/include/freetype2

---

"ps axwwO wchan" shows:
---
13920 -       ttyp0 O+   4:53.09 /usr/libexec/cc1plus -quiet -I ./.pch/wxprec_coredll -I ./src/regex -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/wxWidgets-3.0.2/lib/wx/include/gtk2-unicode-3.0 -I ./include -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/gtk-2.0 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/lib/gtk-2.0/include -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/pango-1.0 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/glib/gio-unix-2.0/ -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.x11-buildlink/include -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/cairo -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/atk-1.0 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.x11-buildlink/include/pixman-1 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/libpng16 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/gdk-pixbuf-2.0 -I /usr/obj.i386/pkgsrc/x11!
 /wxGTK30/work.i386/.buildlink/include/harfbuzz -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.x11-buildlink/include/freetype2 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/glib/glib-2.0 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/lib/glib-2.0/include -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/gstreamer-0.10 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/libxml2 -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.x11-buildlink/include/libdrm -I /usr/obj.i386/pkgsrc/x11/wxGTK30/work.i386/.buildlink/include/gtk-unix-print-2.0 -MMD ./.pch/wxprec_coredll/wx/wxprec.h.d -MF ./.deps/___pch_wxprec_coredll_wx_wxprec_h_gch.d -MQ ./.pch/wxprec_coredll/wx/wxprec.h.gch -D_REENTRANT -D_PTHREADS -D __WXGTK__ -D WXBUILDING -D WXUSINGDLL -D WXMAKINGDLL_CORE -D wxUSE_BASE=0 -D PIC -D _FILE_OFFSET_BITS=64 -D _REENTRANT -D _NETBSD_SOURCE -D _LIBC -D WX_PRECOMP ./in!
 clude/wx/wxprec.h -quiet -dumpbase wxprec.h -mtune=nocona -mar!
 ch=i486 -auxbase wxprec -O0 -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -fPIC -o /var/tmp//cc0xnrJV.s --output-pch= ./.pch/wxprec_coredll/wx/wxprec.h.gch 
---

Build with -O0 or MAKE_JOBS_SAFE=no doesn't help.

"gdb /usr/libexec/cc1plus" shows:
---
# gdb /usr/libexec/cc1plus
GNU gdb (GDB) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486--netbsdelf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/libexec/cc1plus...(no debugging symbols found)...done.
(gdb) attach 13920
Attaching to program: /usr/libexec/cc1plus, process 13920
Reading symbols from /usr/lib/libintl.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libintl.so.1
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libstdc++.so.7...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libstdc++.so.7
Reading symbols from /usr/lib/libm.so.0...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libm.so.0
Reading symbols from /usr/lib/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgcc_s.so.1
Reading symbols from /usr/lib/libc.so.12...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libc.so.12
Reading symbols from /usr/libexec/ld.elf_so...(no debugging symbols found)...done.
Loaded symbols for /usr/libexec/ld.elf_so
0xbb9e94f8 in ?? () from /usr/lib/libc.so.12
(gdb) bt
#0  0xbb9e94f8 in ?? () from /usr/lib/libc.so.12
#1  0xbb9e9a8a in ?? () from /usr/lib/libc.so.12
#2  0xbb9e9c46 in malloc () from /usr/lib/libc.so.12
#3  0xbba182f8 in vasprintf_l () from /usr/lib/libc.so.12
#4  0xbba18448 in vasprintf () from /usr/lib/libc.so.12
#5  0x087cdbf0 in ?? ()
#6  0x087ce724 in diagnostic_build_prefix(diagnostic_context*, diagnostic_info const*) ()
#7  0x080abaec in cp_diagnostic_starter(diagnostic_context*, diagnostic_info*)
    ()
#8  0x087ceac9 in diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*) ()
#9  0x087cf2f1 in internal_error(char const*, ...) ()
#10 0x082aea9a in ?? ()
#11 <signal handler called>
#12 0x087d1ae3 in htab_traverse_noresize ()
#13 0x0841abc8 in gt_pch_save(__sFILE*) ()
#14 0x08169033 in c_common_write_pch() ()
#15 0x080a64e0 in cp_write_global_declarations() ()
#16 0x082aeb00 in ?? ()
#17 0x082b056f in toplev_main(int, char**) ()
#18 0x0804a564 in ___start ()
#19 0x0804a448 in _start ()
(gdb) 

---
So it spins in htab_traverse_noresize() ?

Note Build on NetBSD/amd64 7.0 has no problem.

>How-To-Repeat:
(cd pkgsrc/x11/wxGTK30 && make)
on NetBSD/i386 7.0.

>Fix:
No idea.

>Release-Note:

>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Re: pkg/50287: x11/wxGTK30 build on NetBSD/i386 7.0 spins CPU 100%
Date: Mon, 5 Oct 2015 23:00:42 +0900

 Per comment from isaki@, the following patch (--disable-precomp-headers)
 works around.
 (not sure if other architectures also require it to avoid the >50MB source)

 ---
 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/x11/wxGTK30/Makefile,v
 retrieving revision 1.9
 diff -u -p -d -r1.9 Makefile
 --- Makefile	25 Apr 2015 14:25:20 -0000	1.9
 +++ Makefile	5 Oct 2015 13:41:07 -0000
 @@ -37,6 +37,12 @@ CONFIGURE_ARGS+=	--enable-mediactrl
  # http://trac.wxwidgets.org/ticket/16571
  CONFIGURE_ARGS+=	--disable-visibility

 +# gcc 4.8 on NetBSD/i386 7.0 spins on trying to process 50MB wxprec.h.gch
 +.include "../../mk/compiler.mk"
 +.if !empty(MACHINE_PLATFORM:MNetBSD-*-i386) && !empty(CC_VERSION:Mgcc-4.8.*)
 +CONFIGURE_ARGS+=	--disable-precomp-headers
 +.endif
 +
  DOCDIR=			share/doc/wxGTK
  PKGLOCALEDIR=		share


 ---

 BTW, what's the following files?

 ---
 % ls -l /usr/pkgsrc/x11/wxGTK30/patches/
 total 56
 drwxr-xr-x  2 tsutsui  wheel    512 Sep 27 02:17 CVS
 -rw-r--r--  1 tsutsui  wheel  10442 Jul 21  2014 manual-bakefile.diff
 -rw-r--r--  1 tsutsui  wheel   4860 Jul 21  2014 manual-regen.diff
  :

 ---

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50287 CVS commit: pkgsrc/x11/wxGTK30
Date: Mon, 14 Dec 2015 16:49:22 +0000

 Module Name:	pkgsrc
 Committed By:	bouyer
 Date:		Mon Dec 14 16:49:22 UTC 2015

 Added Files:
 	pkgsrc/x11/wxGTK30: hacks.mk

 Log Message:
 Disable precomp-headers on NetBSD with gcc 4.8 (i.e. NetBSD 7.0)
 to avoid cc1plus 100% CPU spin. Should fix PR pkg/50287 and
 workaround PR port-i386/50553


 To generate a diff of this commit:
 cvs rdiff -u -r0 -r1.1 pkgsrc/x11/wxGTK30/hacks.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: bouyer@NetBSD.org
State-Changed-When: Mon, 14 Dec 2015 19:52:53 +0000
State-Changed-Why:
I commited a workaround; could you update and try again ?


State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sat, 20 Feb 2016 16:30:23 +0000
State-Changed-Why:
No problem on pkgsrc-2015Q4 builds.


From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50287: x11/wxGTK30 build on NetBSD/i386 7.0 spins CPU 100%
Date: Thu, 2 Jun 2016 05:20:36 -0500 (CDT)

 The problem reported in this PR affects i386-current with GCC 5.3.
 Please extend the "hacks.mk" to cover "gcc-5.*".  Patch below:

 +Index: x11/wxGTK30/hacks.mk
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/x11/wxGTK30/hacks.mk,v
 +retrieving revision 1.3
 +diff -u -p -r1.3 hacks.mk
 +--- x11/wxGTK30/hacks.mk	14 Dec 2015 19:50:55 -0000	1.3
 ++++ x11/wxGTK30/hacks.mk	2 Jun 2016 10:17:48 -0000
 +@@ -6,7 +6,8 @@
 + ### 
 + .if ${OPSYS} == "NetBSD" 
 + .  include "../../mk/compiler.mk"
 +-.  if ${PKGSRC_COMPILER} == "gcc" && !empty(CC_VERSION:Mgcc-4.8.*)
 ++.  if ${PKGSRC_COMPILER} == "gcc" && \
 ++      (!empty(CC_VERSION:Mgcc-4.8.*) || !empty(CC_VERSION:Mgcc-5.*))
 + CONFIGURE_ARGS+=	--disable-precomp-headers
 + .  endif
 + .endif

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "Manuel Bouyer" <bouyer@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/50287 CVS commit: pkgsrc/x11/wxGTK30
Date: Thu, 2 Jun 2016 11:41:26 +0000

 Module Name:	pkgsrc
 Committed By:	bouyer
 Date:		Thu Jun  2 11:41:26 UTC 2016

 Modified Files:
 	pkgsrc/x11/wxGTK30: hacks.mk

 Log Message:
 Apply the --disable-precomp-headers hack to gcc 5.x too.
 From John D. Baker, PR pkg/50287


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/x11/wxGTK30/hacks.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>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.