public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18881] New: c++ multiple inheritance class calls wrong function in threaded environment
@ 2004-12-08 6:49 droe at mintec dot com dot au
2004-12-08 6:53 ` [Bug c++/18881] " droe at mintec dot com dot au
2004-12-08 14:53 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: droe at mintec dot com dot au @ 2004-12-08 6:49 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/18881] c++ multiple inheritance class calls wrong function in threaded environment
2004-12-08 6:49 [Bug c++/18881] New: c++ multiple inheritance class calls wrong function in threaded environment droe at mintec dot com dot au
@ 2004-12-08 6:53 ` droe at mintec dot com dot au
2004-12-08 14:53 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: droe at mintec dot com dot au @ 2004-12-08 6:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From droe at mintec dot com dot au 2004-12-08 06:53 -------
Created an attachment (id=7703)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7703&action=view)
218-line testClass.ii which demonstrates problem
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18881
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c++/18881] c++ multiple inheritance class calls wrong function in threaded environment
2004-12-08 6:49 [Bug c++/18881] New: c++ multiple inheritance class calls wrong function in threaded environment droe at mintec dot com dot au
2004-12-08 6:53 ` [Bug c++/18881] " droe at mintec dot com dot au
@ 2004-12-08 14:53 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-12-08 14:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-12-08 14:53 -------
Invalid as no compiler knows what branch to take when taking the cast:
TestBaseClass_C *self = (TestBaseClass_C *)ptObj;
Since ptObj is void*, it is just a normal cast and not a cast which takes a branch of multiple inheritance.
Cast when calling pthread_create makes the testcase work:
if ((res = pthread_create(
&thread2_Handle,
__null,
TestBaseClass_C::StartThread2,
(TestBaseClass_C *)this)) != 0 )
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18881
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-12-08 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-08 6:49 [Bug c++/18881] New: c++ multiple inheritance class calls wrong function in threaded environment droe at mintec dot com dot au
2004-12-08 6:53 ` [Bug c++/18881] " droe at mintec dot com dot au
2004-12-08 14:53 ` pinskia at gcc dot gnu dot 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).