public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/94747] New: Undefined behavior: integer overflow in libsupc++/dyncast.cc
@ 2020-04-24 15:23 hiraditya at msn dot com
  2020-04-24 16:33 ` [Bug libstdc++/94747] " jakub at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hiraditya at msn dot com @ 2020-04-24 15:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94747
           Summary: Undefined behavior: integer overflow in
                    libsupc++/dyncast.cc
           Product: gcc
           Version: 7.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hiraditya at msn dot com
  Target Milestone: ---

Integer overflow reported by asan with the following stack trace. If this is
not 
sufficient I can try to provide a repro

gcc/7.x/libstdc++-v3/libsupc++/dyncast.cc:53:11: runtime error: negation of 16
cannot be represented in type 'unsigned long'
>     #0 in __dynamic_cast gcc/7.x/libstdc++-v3/libsupc++/dyncast.cc:53
>     #1 in bool std::has_facet<std::ctype<char> >(std::locale const&) gcc/7.x/.../bits/locale_classes.tcc:110
>     #2 in std::basic_ios<char, std::char_traits<char> >::_M_cache_locale(std::locale const&) gcc/7.x/.../bits/basic_ios.tcc:159
>     #3 in std::basic_ios<char, std::char_traits<char> >::init(std::basic_streambuf<char, std::char_traits<char> >*) gcc/7.x/.../bits/basic_ios.tcc:132
>     #4 in std::basic_ostream<char, std::char_traits<char> >::basic_ostream(std::basic_streambuf<char, std::char_traits<char> >*) gcc/7.x/.../ostream:85
>     #5 in std::ios_base::Init::Init() gcc/7.x/libstdc++-v3/src/c++98/ios_init.cc:91
>     #6 in __cxx_global_var_init gcc/7.x/.../iostream:74

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

end of thread, other threads:[~2020-05-04 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-24 15:23 [Bug libstdc++/94747] New: Undefined behavior: integer overflow in libsupc++/dyncast.cc hiraditya at msn dot com
2020-04-24 16:33 ` [Bug libstdc++/94747] " jakub at gcc dot gnu.org
2020-04-24 18:14 ` redi at gcc dot gnu.org
2020-04-24 19:59 ` [Bug libstdc++/94747] Confusing code " nathan at gcc dot gnu.org
2020-05-04 17:26 ` nathan 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).