From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.systemli.org (mail1.systemli.org [93.190.126.36]) by sourceware.org (Postfix) with ESMTPS id E222A385841A for ; Thu, 25 Aug 2022 08:51:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E222A385841A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=systemli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=systemli.org Message-ID: <7dccc249-624f-379d-ff70-802c7f56124e@systemli.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemli.org; s=default; t=1661417472; bh=AzrHhxV7JblZ4i98Tq6WjorfTgAR+4eOr/+8eNHGoiw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=816iIlYPmzlTXIcGK7EK2ApurPRfH8SFzt8gVKZIOXgj/7+nIkVWnyTe7CKLHVX4K YtM4caA6EAqJS+PGvnwNy/c/GWNdZXc3Oep95WNcsrUhTOwcqWvE8Os/EjY2Y8LxIT gxpuuKfXOjRklyV2YgJiD5vkJ7aGKa30bc97y58VfKKsxaEgkVQKp5Jgqnzzs4Pv69 J6D943bF5BUu9uvbk2PLs08P3PejOHctyAeKbQ6JCB4R8u5koDiVxfUfNH+Yc/J3VG IvQ6pa7Ra/4E42L9EGQz1JZg9XBSoOnZYO+2mLcio0DMGiI06sIm+ZV7DASLmqDitg wixqLOsBeYaxQ== Date: Thu, 25 Aug 2022 10:51:10 +0200 MIME-Version: 1.0 Subject: Re: elfutils does not compile with gcc 12.2.0 Content-Language: en-US To: "Dmitry V. Levin" , elfutils-devel@sourceware.org References: <340e1f2d-ffd6-6b28-aa5e-3d3f3a535f07@systemli.org> <20220824210134.GA1005@altlinux.org> From: Nick In-Reply-To: <20220824210134.GA1005@altlinux.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,KAM_SHORT,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 List-Id: On 8/24/22 23:01, Dmitry V. Levin wrote: > On Wed, Aug 24, 2022 at 10:51:13PM +0200, Nick via Elfutils-devel wrote: >> I try to compile elfutils on OpenWrt with the newest gcc 12.2.0 version. >> However, it fails due to -Werror=use-after-free. A workaround is a patch >> that I found on the mailinglist, to disable -Werror >> (https://sourceware.org/legacy-ml/elfutils-devel/imported/msg00994.html) >> I modified it to apply to newest elfutils version. The error with >> elfutils 0.187 and gcc 12.2.0: >> >> In function 'bigger_buffer', >>     inlined from '__libdw_gunzip' at gzip.c:376:12: >> gzip.c:98:9: error: pointer may be used after 'realloc' >> [-Werror=use-after-free] >>    98 |     b = realloc (state->buffer, more -= 1024); >>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> gzip.c:96:13: note: call to 'realloc' here >>    96 |   char *b = realloc (state->buffer, more); >>       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > This warning is definitely wrong, looks like a regression in gcc, please > report this to compiler people, otherwise they will never know they > introduced a bug that needs fixing. I think it is not the only failure. I added a comment under this already existing bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069#c24 If you look at this comment I am not sure if that is ever fixed: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104069#c20 The write here about using "pragma" statements to suppress the warning. What about introducing the disabling of werror by a configure flag? Bests Nick