public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "qrzhang at gatech dot edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/108995] New: Missed signed integer overflow checks in UBsan?
Date: Thu, 02 Mar 2023 19:00:35 +0000	[thread overview]
Message-ID: <bug-108995-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108995

            Bug ID: 108995
           Summary: Missed signed integer overflow checks in UBsan?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qrzhang at gatech dot edu
                CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
                    jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at gcc dot gnu.org
  Target Milestone: ---

$ cat abc.c
int printf(const char *, ...);
int a;
const int b = 44514;
int *c = &a;
void main(void) {
  *c = 65526 * b / 6;
  printf("%d\n", a);
}

Ubsan did not emit any message. However, the outputs are different.

$ gcc-trunk -O3 -fsanitize=undefined abc.c ; ./a.out
-229690488

$ gcc-trunk  -fsanitize=undefined abc.c ; ./a.out
486137394

             reply	other threads:[~2023-03-02 19:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 19:00 qrzhang at gatech dot edu [this message]
2023-03-06 12:42 ` [Bug sanitizer/108995] Missed signed integer overflow checks in UBsan? since r8-343-g2bf54d93f159210d marxin at gcc dot gnu.org
2023-03-07  7:54 ` rguenth at gcc dot gnu.org
2023-03-09 12:57 ` rguenth at gcc dot gnu.org
2023-03-09 13:29 ` cvs-commit at gcc dot gnu.org
2023-03-09 13:30 ` [Bug c/108995] " rguenth at gcc dot gnu.org

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=bug-108995-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).