From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id A43A53858024 for ; Thu, 9 Feb 2023 17:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A43A53858024 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-ej1-x631.google.com with SMTP id rp23so8675740ejb.7 for ; Thu, 09 Feb 2023 09:46:25 -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=l4eVhXmX8N/DtPBQpi0ByuL3vBbCJR/xzuqJ/fGZV58=; b=XkWa+Yn5IevIZR7C6HQn4jvNhsuazvFMQryaZ0CwsnkdGKyrF2EAhcxSOc+7yrh/ui +rNYQmdeaOBucUC8IgdhUvS61fEQ1+YBJw8jx3hCHPCIfb2ceVtL292zAVEFkPLmVWZD 9YiW3QlMsw/okI3LmKvx/4zYeKS6uh47T0DeaG7SQ2mqOdzdt11Ec048RHyOi/kSZ210 mjNX27tjgldBAAcgYXFJFANimKX4zHQUvmRJqYkC8zUmnFbieRRWLpWelAbc3Em0D+7A cmMofGjoV5Z2CPdp6p1Qn1xngyG3OgTmrQ1t0111SY4F+eZzmTixEJPOtiSNtNJMdkZS 10dQ== 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=l4eVhXmX8N/DtPBQpi0ByuL3vBbCJR/xzuqJ/fGZV58=; b=uXz7IfksFvO3r4zO99AOlyZo9Myk9mxGf5sYZNm0600n8eDlaHLm4r5S54SlVSdAi0 /CDlGJ4ptSezsP1WLnxx3F4DrTYxg+aHwN5OZnizLP2Nm2F8EhxiU755IrxP5F0huvE/ zs/bgA4b4bUJ9crLRyqXbwh36LkATmETAn3gm9i1EBx3kUpbXhsN7GNb1L8JuDs+nJ3C qmNDse686rDjHN05D36zTd5aJ9WVtsbQkxPbIFAaEQlI20SzanWfFHhd2m08LLPuEDMb A+bQtlCkwW48LBg4vyEzhw3sXeJ7XzrtZ61Idmn7KkiNJwMgCvEw+ltOqjPPRf97e/di Bqmw== X-Gm-Message-State: AO0yUKV1/vZ0luDr8P1EIlnuIByp76NUPUyT3JfFRxNQZRhQpbVDyoiR nzIr+w+X6h9jbnlGlShi55tRpbZC++hcn15P0Hs= X-Google-Smtp-Source: AK7set/G2rZaniHlKL5WiZrO3SidVE+NkQ9VZ8+5Y713JwpFi2bWEUyylZd0ya6jnoXNYXajrovIheih/6xBvfe3kCs= X-Received: by 2002:a17:906:14c1:b0:887:7d91:d016 with SMTP id y1-20020a17090614c100b008877d91d016mr2708008ejc.110.1675964784380; Thu, 09 Feb 2023 09:46:24 -0800 (PST) MIME-Version: 1.0 References: <86edqzxfku.fsf@aarsen.me> In-Reply-To: <86edqzxfku.fsf@aarsen.me> From: praveen ab Date: Thu, 9 Feb 2023 23:15:51 +0530 Message-ID: Subject: Re: Random Crash Observed while running program compiled with latest gcc To: =?UTF-8?Q?Arsen_Arsenovi=C4=87?= Cc: gcc-help@gcc.gnu.org Content-Type: multipart/alternative; boundary="000000000000a10f6c05f447f5ea" X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,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: --000000000000a10f6c05f447f5ea Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Xi Ruoyao and Arsen Arsenovi=C4=87 Thanks for the suggestion to use -fsanitize=3Dundefined flag, with this flag I am able to identify and fix multiple runtime errors and further able to find many more as I am proceeding with running different scenarios. @Arsen Arsenovi=C4=87: I am using GCC 11.3 (I started observing the random = crash issue due to UBs with gcc > 7.4) On Thu, Feb 9, 2023 at 4:37 PM Arsen Arsenovi=C4=87 wrote: > Hi, > > praveen ab via Gcc-help writes: > > > Hi All, > > > > We are upgrading the GCC version for our existing C/C++ project. > > Earlier we were using gcc 5.4 and everything was working fine.(The > > application works fine even with gcc 7.4) > > When trying to build the application using gcc 8.1 and above we are > > observing the random crashes mostly segmentation fault. > > Any suggestions on how to debug this? > > > > Right now I am trying the following: > > Enabling the -Wall flag and trying to fix all the warnings > > Using GDB to inspect memory location and variables. > > > > Please Suggest anything else that needs to be checked? > > The UB sanitizer might also prove useful to detect UB that does not > necessarily result in crashes. Pass -fsanitize=3Dundefined to enable it. > > I can't provide much more specific instructions, but it's quite likely > that there's a good bit of UB in the code you're building, if it broke > in such a regard on compiler updates. > > Is there a reason for using GCC 8 as opposed to newer GCC versions? > > Best of luck, have a great day. > -- > Arsen Arsenovi=C4=87 > --=20 *Thanks and Regards,* *Praveen AB* --000000000000a10f6c05f447f5ea--