[JIRA] Created: (CPPOST-70) Problem calling virtual functions from base class constructors
Scott Cantor (JIRA)
noreply at shibboleth.net
Wed Nov 16 20:54:25 GMT 2011
Problem calling virtual functions from base class constructors
--------------------------------------------------------------
Key: CPPOST-70
URL: https://issues.shibboleth.net/jira/browse/CPPOST-70
Project: OpenSAML 2 - C++
Issue Type: Bug
Components: SAML 1, SAML 2
Affects Versions: 2.4.3, 2.4.2, 2.4.1, 2.4
Environment: Solaris 10, both archs, compiler package version > 12.0
Reporter: Scott Cantor
Assignee: Scott Cantor
Priority: Critical
Fix For: 2.5
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.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the commits
mailing list