Project

General

Profile

Bug #2628

ReaderSource passes a temporary PrincipalMaker even though it is required outside the constructor.

Added by Christopher Green over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
I/O
Target version:
Start date:
04/05/2012
Due date:
% Done:

0%

Estimated time:
Occurs In:
Scope:
Internal
Experiment:
-
SSI Package:
Duration:

Description

The constructor of ReaderSource passes a temporary PrincipalMaker to the constructor of the detail object by const &. However, the detail object is intended to save this for use in its getNext_ function. The detail class author is intended to save this by value as a class data member since it is a fairly lightweight object, but there are no explicit instructions to this effect and it is not intuitively obvious that this needs to be done.

The consequence of doing this wrong (eg saving a PrincipalMaker const & in class data) is a hard-to-trace segfault in the guts of the construction of the first EventPrincipal.

The PrincipalMaker should be saved as class data in ReaderSource, and the lifetime issue will therefore not arise, however the detail class author decides to hang on to a PrincipalMaker.

History

#1 Updated by Christopher Green over 8 years ago

  • Category set to I/O

#2 Updated by Christopher Green over 8 years ago

  • Status changed from Accepted to Resolved
  • Assignee set to Christopher Green
  • Target version set to 1.00.12

#3 Updated by Christopher Green over 8 years ago

  • Status changed from Resolved to Closed


Also available in: Atom PDF