public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug sanitizer/106739] New: runtime error coredump case on c++17/20
@ 2022-08-25  9:20 zhkefa at live dot cn
  2022-08-25 11:04 ` [Bug sanitizer/106739] [11/12/13 Regression] runtime error coredump case on c++17/20 since r11-2445-g8c00059ce058ea2a marxin at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zhkefa at live dot cn @ 2022-08-25  9:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106739
           Summary: runtime error coredump case on c++17/20
           Product: gcc
           Version: 10.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: sanitizer
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhkefa at live dot cn
                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: ---

code file test.cc:
=============================
class A {
public:
    A(int i): i(i){}
    int get() {return i;}
private:
    int i{0};
};

void func() {
    typedef int (A::*f)();
    f fs[] = {&A::get};
    A *a = new A{1};
    for (int i = 0; i < 1; ++i) {
        (a->*fs[i])();
    }
    delete a;
}

int main() {
    func();
    return 0;
}

===============
envirment: gcc10.4

g++ -fsanitize=address -fsanitize=undefined -std=c++17 test.cc

./a.out
runtime error: index 4198816 out of bounds for type func[1]
runtime error: load of address 0x7ffd97570f08 whith insufficient space for an
object of type 'long int'

if compile with -std=c++14 or -std=c++11, everything ok.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-02 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-25  9:20 [Bug sanitizer/106739] New: runtime error coredump case on c++17/20 zhkefa at live dot cn
2022-08-25 11:04 ` [Bug sanitizer/106739] [11/12/13 Regression] runtime error coredump case on c++17/20 since r11-2445-g8c00059ce058ea2a marxin at gcc dot gnu.org
2022-08-25 15:07 ` rguenth at gcc dot gnu.org
2022-10-19  7:08 ` [Bug sanitizer/106739] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-12-02 13:19 ` jakub at gcc dot gnu.org
2022-12-02 13:41 ` marxin at gcc dot gnu.org

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).