public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60585] New: Virtual function related memory access errors with multiple virtual inheritance
@ 2014-03-19 12:09 andris.pavenis at iki dot fi
  2014-03-19 14:00 ` [Bug c++/60585] " redi at gcc dot gnu.org
  2014-11-28  8:43 ` andris.pavenis at iki dot fi
  0 siblings, 2 replies; 3+ messages in thread
From: andris.pavenis at iki dot fi @ 2014-03-19 12:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60585

            Bug ID: 60585
           Summary: Virtual function related memory access errors with
                    multiple virtual inheritance
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: andris.pavenis at iki dot fi

Created attachment 32392
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32392&action=edit
Simplified C++ test example

The attached reduced example causes valgrind to complain about access to
uninitialized value when built with gcc-4.9.0 20140318 on Linux (both i86 and
x86_64, included output is from 32 bit version):

andpav@andris-HP-Z230:~/Tests/2014-03-18$ g++-4.9 -O2 -Wall -Wextra virtual.cpp 
andpav@andris-HP-Z230:~/Tests/2014-03-18$ valgrind ./a.out 
==10812== Memcheck, a memory error detector
==10812== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==10812== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==10812== Command: ./a.out
==10812== 
==10812== Use of uninitialised value of size 4
==10812==    at 0x80484C6: virtual thunk to F::f() const (in
/home/andpav/Tests/2014-03-18/a.out)
==10812==    by 0x8048379: main (in /home/andpav/Tests/2014-03-18/a.out)
==10812== 
==10812== 
==10812== HEAP SUMMARY:
==10812==     in use at exit: 0 bytes in 0 blocks
==10812==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==10812== 
==10812== All heap blocks were freed -- no leaks are possible
==10812== 
==10812== For counts of detected and suppressed errors, rerun with: -v
==10812== Use --track-origins=yes to see where uninitialised values come from
==10812== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
andpav@andris-HP-Z230:~/Tests/2014-03-18$ g++-4.9 -v
Using built-in specs.
COLLECT_GCC=g++-4.9
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/i686-pc-linux-gnu/4.9.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.9-20140318/configure --program-suffix=-4.9
--enable-languages=c,c++ --enable-lto
Thread model: posix
gcc version 4.9.0 20140318 (experimental) (GCC) 

There are also ocasional crashes (SIGSEGV) in real software from which the
reduced example has been created.

Also reproduced with gcc-4.8 (Fedora 20 x86_64 and Ubuntu 13.10 i686) and
gcc-4.7 (Ubuntu-13.10 i686). Does not happen with gcc-4.6 (Ubuntu 12.04)

Also specifying -fno-inline-small-functions together with -O2 or -O3 for
affected gcc versions make the problem not happen (both reduced example and
real software)


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

* [Bug c++/60585] Virtual function related memory access errors with multiple virtual inheritance
  2014-03-19 12:09 [Bug c++/60585] New: Virtual function related memory access errors with multiple virtual inheritance andris.pavenis at iki dot fi
@ 2014-03-19 14:00 ` redi at gcc dot gnu.org
  2014-11-28  8:43 ` andris.pavenis at iki dot fi
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2014-03-19 14:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60585

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-19
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.2, 4.9.0


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

* [Bug c++/60585] Virtual function related memory access errors with multiple virtual inheritance
  2014-03-19 12:09 [Bug c++/60585] New: Virtual function related memory access errors with multiple virtual inheritance andris.pavenis at iki dot fi
  2014-03-19 14:00 ` [Bug c++/60585] " redi at gcc dot gnu.org
@ 2014-11-28  8:43 ` andris.pavenis at iki dot fi
  1 sibling, 0 replies; 3+ messages in thread
From: andris.pavenis at iki dot fi @ 2014-11-28  8:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andris Pavenis <andris.pavenis at iki dot fi> ---
Reproduced also with gcc-5.0 20141123 snapshot on Linux x86_64


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

end of thread, other threads:[~2014-11-28  8:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-19 12:09 [Bug c++/60585] New: Virtual function related memory access errors with multiple virtual inheritance andris.pavenis at iki dot fi
2014-03-19 14:00 ` [Bug c++/60585] " redi at gcc dot gnu.org
2014-11-28  8:43 ` andris.pavenis at iki dot fi

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