public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: praveen ab <praveenasb@gmail.com>
To: "Arsen Arsenović" <arsen@aarsen.me>
Cc: gcc-help@gcc.gnu.org
Subject: Re: Random Crash Observed while running program compiled with latest gcc
Date: Thu, 9 Feb 2023 23:15:51 +0530	[thread overview]
Message-ID: <CAFtRY17TXnChTXGM5iPsV+7C8M2QdM_K-FPmJquxrmrVs8SHXg@mail.gmail.com> (raw)
In-Reply-To: <86edqzxfku.fsf@aarsen.me>

[-- Attachment #1: Type: text/plain, Size: 1671 bytes --]

Hi Xi Ruoyao and Arsen Arsenović

Thanks for the suggestion to use -fsanitize=undefined 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ć: 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ć <arsen@aarsen.me> wrote:

> Hi,
>
> praveen ab via Gcc-help <gcc-help@gcc.gnu.org> 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=undefined 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ć
>


-- 
*Thanks and Regards,*
*Praveen AB*

      reply	other threads:[~2023-02-09 17:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 10:56 praveen ab
2023-02-09 10:59 ` Xi Ruoyao
2023-02-09 11:01 ` Arsen Arsenović
2023-02-09 17:45   ` praveen ab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFtRY17TXnChTXGM5iPsV+7C8M2QdM_K-FPmJquxrmrVs8SHXg@mail.gmail.com \
    --to=praveenasb@gmail.com \
    --cc=arsen@aarsen.me \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).