GCC version: gcc version 3.4.3 20041125 (Red Hat 3.4.3-7)
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-java-awt=gtk --host=i386-redhat-linux
Compile line: gcc -Wall -Wshadow -ggdb -g3 testClass.ii -o virtualTest 
-lpthread -lstdc++

DESCRIPTION:-
TestDerivedClass inherits from TestBaseClass_A, TestBaseClass_B & 
TestBaseClass_C.
T1_Process & T2_Process are defined virtual in TestBaseClass_C and redefined in
TestDerivedClass.
A TestDerivedClass object starts 2 threads using different static methods
StartThread1 and StartThread2 from TestBaseClass_C.
StartThread1 receives the TestDerivedClass "this" pointer and invokes T1_Process
through it.

NOW THE BUG IS that some random function is run instead of
TestDerivedClass::T1_Process.

The bug does not show if TestBaseClass_C is the first-mentioned inherited_from
class in the declaration of TestDerivedClass. This is not a workaround for us
because we wish to use redefined methods from all inherired classes, not just
the first one.

-- 
           Summary: c++ multiple inheritance class calls wrong function in
                    threaded environment
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: droe at mintec dot com dot au
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-redhat-linux
  GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux


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

Reply via email to