Problem calling virtual functions from base class constructors

Description

Since at least 12.2 of SunStudio, running unit tests crashes in a test case that clones an AuthenticationStatement. The crash shows a stack trace that isn't possible, and the this pointer changes in the debugger across calls such that the compiler seems to be trashing the object in some way when it executes the call.

I've traced it to the use of virtual methods inside base class constructors, in this case SubjectStatementImpl calling setSubject, which calls a virtual releaseDOM method. Moving that down to the subclass constructor fixes the crash.

It should be possible to rework these clone operations as two stages, one to initialize an empty object via copy constructor, and then an internal _clone method that actually copies the content.

Environment

Solaris 10, both archs, compiler package version > 12.0

Activity

Show:

Scott Cantor November 21, 2011 at 9:49 PM

Scott Cantor November 16, 2011 at 9:10 PM

Confirmed same results on 12.3 beta, both archs.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Original estimate

Components

Fix versions

Affects versions

Created November 16, 2011 at 8:54 PM
Updated August 7, 2012 at 1:11 AM
Resolved November 21, 2011 at 9:49 PM

Flag notifications