From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id B4B4F3858289 for ; Thu, 1 Dec 2022 07:42:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B4B4F3858289 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-x32d.google.com with SMTP id l39-20020a05600c1d2700b003cf93c8156dso814614wms.4 for ; Wed, 30 Nov 2022 23:42:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=afVBtHOJMOuvxqdJT5Tn3A1W6bFpuN5MkXBAYoBaxS0=; b=U3O7OM1JkmKNRGCn2o6hMfbQOzc+rLOnZ2+hkvooUwgaETV54MeGjv6lpnIAMnY3QV 4VuptD4dhk9wHwh9/dCkp8PFpJcBPkWYxBXmEmf29hK22AqrVrCyOLE+drZ8cOYDbth2 RaYhxyHEWSNsLVfLEJ6uwIRp2QJtO82nvFF7sDHQI+szUFffnE5hW8XyaHTL020R5+hY ThFtUjerbduyyEk6xbhTUnHe8V4sRD2Y9WkitkNh7v5uEN167h5A9udvV1mTkMrJRJsA uhNBcEpNQnvIA0ujGhhVUCc8jdqIaSwYzUG2yTDbSkK9rSwoarMLFDsWXjt8WQOw9WWv kZNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=afVBtHOJMOuvxqdJT5Tn3A1W6bFpuN5MkXBAYoBaxS0=; b=y+mhmcvTPG9Zbv1gw6ly4g++V8tVPqipVyTWLD5q1BgzgAj7JHEaPAzKTPH7JHCOlv 6fl07rKE2dLOWfGAm5uxX1EpQHSCndRN3SELDao7p7qo5QcAfLASPBLKRxEV+wb88keZ b0QIsAYEqN/jzHZKHoGefC50LOhzhfYxZ9NGQtfAK27rIrOaKozQXJWNHPBiHMuY9bES I0dw/i5s96XAqGSsSoLnCbv++s+Ayq7ne4JvzGRKrYQUHiYr26IhmHhpEHZTpp92JZUT zqvoxSruaARfnxDwrBZt7iO5yjbcFoq2Xv3CUTebhxDEBxf2PNXfwquLyNEwDstzFzWb PNpw== X-Gm-Message-State: ANoB5pmQ0QvkLDtYKS9eesspKERjfV7B0vPtFPQdtDVyu/M+Sj6HJscr AVIKBHXDP4reM57MxFGd3V3LUFLXpLrjsdwTK2U= X-Google-Smtp-Source: AA0mqf7b4DfWnHjMTbYQaiDbEha3vMjy8S017FuE5ZMSC3nkZdikp/UYJmuLmBxKrgGt4UHoKQjd0LNRCz2nHt0prw8= X-Received: by 2002:a05:600c:6549:b0:3d0:5aa:b315 with SMTP id dn9-20020a05600c654900b003d005aab315mr44917779wmb.101.1669880546101; Wed, 30 Nov 2022 23:42:26 -0800 (PST) MIME-Version: 1.0 References: <87zgc899xo.fsf@oldenburg.str.redhat.com> In-Reply-To: <87zgc899xo.fsf@oldenburg.str.redhat.com> From: Mathieu Malaterre Date: Thu, 1 Dec 2022 08:42:14 +0100 Message-ID: Subject: Re: virtual memory exhausted: Cannot allocate memory To: Florian Weimer Cc: Mathieu Malaterre via Gcc-help Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Nov 30, 2022 at 8:30 AM Florian Weimer wrote: > > * Mathieu Malaterre via Gcc-help: > > > I am having a hard time understanding which flags to change in case of > > `virtual memory exhausted: Cannot allocate memory`. I can compile > > openvdb on all Debian supported arches but mipsel. I tried tweaking > > the debug level as well as the optimization level without luck so far. > > > > Latest attempt is: > > > > g++-12 [...] -g0 -O0 --param ggc-min-expand=0 --param > > ggc-min-heapsize=131072 [...] > > > > What should I try next ? > > It could be a compiler bug. GCC might try to allocate infinite amounts > or just way too much memory. > > Perhaps you can build with -save-temps, capture the preprocessed .i > file, and then try to reproduce the issue with a cross-compiler using > that .i file? If I understand correctly, the issue is really memory pressure on mipsel build machine. Steps: [...] malat@eller ~/openvdb/obj-mipsel-linux-gnu/openvdb_ax/openvdb_ax % time /usr/bin/c++ -save-temps -DBOOST_ALL_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK -DOPENVDB_AX_DLL -DOPENVDB_AX_PRIVATE -DOPENVDB_AX_REGENERATE_GRAMMAR -DOPENVDB_DLL -DOPENVDB_USE_DELAYED_LOADING -DOPENVDB_USE_LOG4CPLUS -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Dopenvdb_ax_shared_EXPORTS -I/home/malat/openvdb/openvdb_ax/openvdb_ax/.. -I/home/malat/openvdb/openvdb_ax/openvdb_ax/../../openvdb_cmd/vdb_ax -I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb_ax/openvdb_ax/openvdb_ax/grammar -I/home/malat/openvdb/openvdb/openvdb/.. -I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb/openvdb -I/home/malat/openvdb/obj-mipsel-linux-gnu/openvdb/openvdb/openvdb -isystem /usr/lib/llvm-14/include -isystem /usr/include/Imath -g0 -O0 -ffile-prefix-map=/home/malat/openvdb=. -fstack-protector-strong -Wformat -Werror=format-security --param ggc-min-expand=0 --param ggc-min-heapsize=131072 -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -std=c++17 -MD -MT openvdb_ax/openvdb_ax/CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o -MF CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o.d -o CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.o -c /home/malat/openvdb/openvdb_ax/openvdb_ax/compiler/VolumeExecutable.cc virtual memory exhausted: Cannot allocate memory /usr/bin/c++ -save-temps -DBOOST_ALL_NO_LIB -DBOOST_IOSTREAMS_DYN_LINK 40048.52s user 4.21s system 99% cpu 11:07:54.46 total % du -sh ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii 6.7M ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii % cp ./CMakeFiles/openvdb_ax_shared.dir/compiler/VolumeExecutable.cc.ii /tmp [...] Then: malat@amd64 % scp eller.debian.org:/tmp/VolumeExecutable.cc.ii . malat@amd64 % time /usr/bin/mipsel-linux-gnu-g++-12 -o VolumeExecutable.o -c VolumeExecutable.cc.ii /usr/bin/mipsel-linux-gnu-g++-12 -o VolumeExecutable.o -c 853.28s user 4.38s system 99% cpu 14:17.94 total