help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bus error at virtual method call


From: Paul Pluzhnikov
Subject: Re: bus error at virtual method call
Date: 30 Sep 2004 20:05:44 -0700
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

paul.vanhagen@wanadoo.nl (Paul van Hagen) writes:

> I have used the -O3 level optimizer. The same code runs fine on a Linux
> environment, same code, same compiler, different hardware.

That doesn't mean anything ...
Is your code valgrind-clean on Linux?

> I have narrowed it down to a call to a private virtual method that is called
> from a public base class method, such as in:

Try to produce a minimal complete example, which still shows the problem.
Then we can tell you whether it's a gcc bug or your bug.

> When I compile for debugging (-DDEBUG -g) the problem disappears.

It is quite likely that you have a bug, and trash B's vtbl.
Without -O, gcc emits temporaries for everything, and you trash
storage for some such temporary instead, without any apparent
ill effect.

> Is there a way to circumvent this problem by refactoring, lowering O level
> or perhaps use other compilation flags.

Sure: compile with -DDEBUG -g :-)

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]