[Rivet] [Rivet-svn] r1745 - in trunk: include/Rivet src

Frank Siegert frank.siegert at durham.ac.uk
Wed Aug 5 16:44:49 BST 2009


blackhole at projects.hepforge.org, Wednesday 05 August 2009:
> Author: fsiegert
> Date: Wed Aug  5 16:34:46 2009
> New Revision: 1745

Nevermind. On a different machine the problem is still there, even without 
the smart pointer. So I'll debug further ...

Frank


> Log:
> When running the rivet executable with multiple analyses I had
> reproducably (but not with all analysis combinations?) the effect that
> the _info object of one of the analyses had been reset to 0x6666666
> right before event analysis started, causing a crash.
> The only way I found to fix this is to not use a smart pointer for the
> _info object, but a regular pointer. This works right away (with no
> other changes).
> If somebody has a reason for using a smart pointer here and any idea
> how to debug this, let me know and I can re-test with a smart pointer.
>
> Modified:
>    trunk/include/Rivet/Analysis.hh
>    trunk/src/Analysis.cc
>
> Modified: trunk/include/Rivet/Analysis.hh
> =======================================================================
>======= --- trunk/include/Rivet/Analysis.hh	Wed Aug  5 15:02:59
> 2009	(r1744) +++ trunk/include/Rivet/Analysis.hh	Wed Aug  5 16:34:46
> 2009	(r1745) @@ -59,7 +59,7 @@
>      Analysis(const std::string& name);
>
>      /// The destructor.
> -    virtual ~Analysis() { }
> +    virtual ~Analysis();
>      //@}
>
>    public:
> @@ -401,7 +401,7 @@
>    protected:
>
>      /// Pointer to analysis metadata object
> -    shared_ptr<AnalysisInfo> _info;
> +    AnalysisInfo * _info;
>
>
>    private:
>
> Modified: trunk/src/Analysis.cc
> =======================================================================
>======= --- trunk/src/Analysis.cc	Wed Aug  5 15:02:59 2009	(r1744)
> +++ trunk/src/Analysis.cc	Wed Aug  5 16:34:46 2009	(r1745)
> @@ -17,10 +17,14 @@
>        _analysishandler(0),
>        _madeHistoDir(false)
>    {
> -    _info.reset( AnalysisInfo::make(name) );
> +    _info = AnalysisInfo::make(name);
>      setBeams(ANY, ANY);
>    }
> -
> +
> +  Analysis::~Analysis()
> +  {
> +    if (_info) delete _info;
> +  }
>
>    IAnalysisFactory& Analysis::analysisFactory() {
>      return handler().analysisFactory();



More information about the Rivet mailing list