From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 5705A38376C0 for ; Fri, 10 Jun 2022 12:42:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5705A38376C0 Received: by mail-wm1-x332.google.com with SMTP id p6-20020a05600c1d8600b0039c630b8d96so1837862wms.1 for ; Fri, 10 Jun 2022 05:42:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=RJ+2u6IM2JFFH+XSgiS28HCJzJZcUqOYVqsBuSH5IBQ=; b=DTp38ZFjvHqOf5vif8+fuFWVNoSCIkytZYtXK//xLlCgwt2wBDUSn0whRzrLnaWGVH 9c9FMgiPxzjFlQ7ktjXszmOrAgzpY+StV0cbtwFWsAB7y5ct9QmcrcXHBTwNo5vdzm0O iHYkf2ObcLsN/oMK8vtF9NwUPd4brJxYWMOvXFWt8250Ic92Pn3lpObe58KEd90CuTio dvvsvdtmHYgV6dLPifQJzwad/vpnsbcFU7CO0Jk8RMXDEuNxq1lKgxxPxTd97NKTStV0 BDffyFFf6b0cqlYHoxwxQa7nWstfO6FHcD2nVZmF/R20vs6eF7z19m8k5CCgTxKclywj 8v/g== X-Gm-Message-State: AOAM533zasRAPMKHhJGt6Ckv7/DMsTUu60lOMs6oZDyQbvlIwrOzybbJ K0zWT8wniL7q+ygjNTZw6ky6qwmU69eDmnqVrds= X-Google-Smtp-Source: ABdhPJyYQDPPQL+/RAy7bhxlPWwA2Qk4GfkY2mciigOJcNe0HXuh66SxTCXQh8Ow6muDYRFJhX3qr+xj7SKkJRsbUBM= X-Received: by 2002:a05:600c:601f:b0:39c:416c:4069 with SMTP id az31-20020a05600c601f00b0039c416c4069mr8624154wmb.85.1654864978031; Fri, 10 Jun 2022 05:42:58 -0700 (PDT) MIME-Version: 1.0 References: <6af5f478-817e-ecdc-174f-cfd8dd6c0376@mail.ru> <996468e7556a34c30413aaa977e9f26688be8c93.camel@xry111.site> In-Reply-To: From: Jonathan Wakely Date: Fri, 10 Jun 2022 13:42:47 +0100 Message-ID: Subject: Re: Out of memory while building GCC 12.1.0 To: Fiodar Stryzhniou Cc: Xi Ruoyao , gcc-help Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2022 12:43:02 -0000 On Fri, 10 Jun 2022 at 13:29, Fiodar Stryzhniou wrote: > > 6/10/22 =D1=83 3:18 PM Jonathan Wakely =D0=BD=D0=B0=D0=BF=D1=96=D1=81=D0= =B0=D1=9E: > > On Fri, 10 Jun 2022 at 13:15, Xi Ruoyao via Gcc-help > > wrote: > >> > >> On Fri, 2022-06-10 at 14:55 +0300, Fiodar Stryzhniou wrote: > >> > >> /* snip */ > >> > >>> g++: fatal error: Killed signal terminated program cc1plus > >>> compilation terminated. > >>> g++: fatal error: Killed signal terminated program cc1plus > >>> compilation terminated. > >>> /bin/bash: line 2: 17472 Killed build/genautomata > >>> ../../gcc-12.1.0/./gcc/common.md > >>> ../../gcc-12.1.0/./gcc/config/arm/arm.md insn-conditions.md > > >>> tmp-automata.cc > >>> g++: fatal error: Killed signal terminated program cc1plus > >>> compilation terminated. > >>> make[2]: *** Deleting file 'doc/gccint.info' > >>> make[2]: *** [Makefile:2492: s-attrtab] Interrupt > >>> make[2]: *** [Makefile:1143: c/c-lang.o] Interrupt > >>> make[2]: *** [Makefile:1143: c-family/stub-objc.o] Interrupt > >>> make[2]: *** [Makefile:1143: attribs.o] Interrupt > >> > >> /* snip */ > >> > >>> make[2]: *** [Makefile:1143: gimple-ssa-warn-access.o] Interrupt > >>> make[2]: *** [Makefile:1143: gimple-ssa-warn-restrict.o] Interrupt > >>> make[2]: *** [Makefile:1143: gimple-ssa-warn-alloca.o] Interrupt > >>> make[2]: *** [Makefile:2475: s-automata] Interrupt > >>> make[2]: *** [Makefile:3406: doc/gccint.info] Interrupt > >>> make[2]: *** Deleting intermediate file 'gcc.pod' > >>> make[1]: *** [Makefile:4620: all-gcc] Interrupt > >>> make: *** [Makefile:1035: all] Interrupt > >>> > >>> Looks like fork-bomb. > >>> > >>> I have 8Gb ram. Adding 10Gb swap doesn't help. > >>> > >>> Here mine shell script used for easy gcc build - > >>> https://github.com/fedor4ever/GCC4Symbian. > >> > >> It looks like you are using "make -j" without a number somehow. Then > >> make will attempt to fork as many parallel jobs as possible. Recheck > >> your script. > > > > Yes, I think the problem is here: > > https://github.com/fedor4ever/GCC4Symbian/blob/master/build-toolchain.s= h#L35 > Defaul value here: > https://github.com/fedor4ever/GCC4Symbian/blob/master/build-toolchain.sh#= L25 > > > > If you don't set that variable it will try to compile every file at > > once. Either set the variable, or fix your script to use a sensible > > default like -j"${NUMBER_OF_PROCESSORS:-1}" > > > > > >> > >> -- > >> Xi Ruoyao > >> School of Aerospace Science and Technology, Xidian University > > Looks like you right. Harcoded to -j6 helps. Thousands and thousands of people have built GCC 12.1.0 successfully. If you think you've found a fork bomb in the build process that nobody else has seen, it's probably a problem with your commands, not GCC.