GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » PANDA » PandaRoot » Bugs, Fixes, Releases » Stuck with a segfault in mvd reco
icon9.gif  Stuck with a segfault in mvd reco [message #4877] Fri, 10 August 2007 11:39 Go to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
Hi all,

I'm stuck a bit with a seg fault which I don't know where it may come from. It looks as if it has something to do with the framework I/O. Or maybe I just made a stupid mistake.

I committed my last code into rev. 1253.
It appears while doing the reconstruction after running successfully the simulation and the digitization.
I attatched the macros for you to look, what I've done.

Thanks, Ralf.




[color=red]This is the end of my output...[/color]

MvdSimpleHitMaker::PrintParameters()
fpixelCellX:    0.01
fpixelCellY:    0.01
fstripX:        0
fstripY:        0
 next loop step local:  (0.735,0.205,0)   global: (-3.34352,-0.0696125,6.335)    - write cluster         - end of step.
 next loop step local:  (0.025,0.195,0)   global: (-2.305,-1.70345,8.735)        - write cluster         - end of step.
 next loop step local:  (0.025,0.205,0)   global: (-2.315,-1.70345,8.735)        - write cluster         - end of step.
 next loop step local:  (0.015,0.205,0)   global: (-2.315,-1.69345,8.735)        - write cluster         - end of step.
 next loop step local:  (0.725,0.215,0)   global: (-3.34352,-0.0554704,6.335)    - write cluster         - end of step.
 next loop step local:  (0.715,0.215,0)   global: (-3.33645,-0.0483993,6.335)    - write cluster         - end of step.
 next loop step local:  (0.715,0.225,0)   global: (-3.34352,-0.0413283,6.335)    - write cluster         - end of step.
 next loop step local:  (0.705,0.225,0)   global: (-3.33645,-0.0342572,6.335)    - write cluster         - end of step.
 next loop step local:  (0.705,0.235,0)   global: (-3.34352,-0.0271861,6.335)    - write cluster         - end of step.
 next loop step local:  (0.695,0.235,0)   global: (-3.33645,-0.0201151,6.335)    - write cluster         - end of step.
 next loop step local:  (0.695,0.245,0)   global: (-3.34352,-0.013044,6.335)     - write cluster         - end of step.
 next loop step local:  (0.685,0.245,0)   global: (-3.33645,-0.00597293,6.335)   - write cluster         - end of step.
 next loop step local:  (0.685,0.255,0)   global: (-3.34352,0.00109814,6.335)    - write cluster         - end of step.
 next loop step local:  (0.675,0.255,0)   global: (-3.33645,0.0081692,6.335)     - write cluster         - end of step.
 next loop step local:  (0.675,0.265,0)   global: (-3.34352,0.0152403,6.335)     - write cluster         - end of step.
 next loop step local:  (0.665,0.265,0)   global: (-3.33645,0.0223113,6.335)     - write cluster         - end of step.
 next loop step local:  (0.715,0.225,0)   global: (-3.34352,-0.0413283,6.335)    - write cluster         - end of step.
 next loop step local:  (0.515,0.145,0)   global: (-1.17173,1.965,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.515,0.135,0)   global: (-1.17173,1.975,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.515,0.125,0)   global: (-1.17173,1.985,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.515,0.115,0)   global: (-1.17173,1.995,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.555,0.365,0)   global: (-1.21173,1.745,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.565,0.365,0)   global: (-1.22173,1.745,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.565,0.355,0)   global: (-1.22173,1.755,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.565,0.345,0)   global: (-1.22173,1.765,1.94354)       - write cluster         - end of step.
 next loop step local:  (0.185,0.755,0)   global: (0.668322,3.51068,6.335)       - write cluster         - end of step.
 next loop step local:  (0.185,0.745,0)   global: (0.675393,3.51775,6.335)       - write cluster         - end of step.
 next loop step local:  (0.175,0.745,0)   global: (0.668322,3.52482,6.335)       - write cluster         - end of step.
 next loop step local:  (0.165,0.745,0)   global: (0.661251,3.53189,6.335)       - write cluster         - end of step.
         - end of MvdSimpleHitMaker::makeHits().

Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1236777264 (LWP 30074)]
0xb78cf5fa in TStreamerInfo::WriteBufferAux<char**> () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
(gdb) bt
#0  0xb78cf5fa in TStreamerInfo::WriteBufferAux<char**> () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#1  0xb78c9d95 in TStreamerInfo::WriteBufferClones () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#2  0xb6a14200 in TBranchElement::FillLeaves () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libTree.so.5.14
#3  0xb6a0d779 in TBranch::Fill () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libTree.so.5.14
#4  0xb6a13028 in TBranchElement::Fill () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libTree.so.5.14
#5  0xb6a1314a in TBranchElement::Fill () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libTree.so.5.14
#6  0xb6a48b43 in TTree::Fill () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libTree.so.5.14
#7  0xb34f7726 in CbmRootManager::Fill (this=0x8c8aa60) at /home/ralfk/Pandaroot/pandaroot/base/CbmRootManager.cxx:330
#8  0xb34fe593 in CbmRunAna::Run (this=0x8c8a910, Ev_start=0, Ev_end=10000) at /home/ralfk/Pandaroot/pandaroot/base/CbmRunAna.cxx:143
#9  0xb3534591 in G__CbmDict_764_0_8 (result7=0xbff9e534, funcname=0x8c83068 "\001", libp=0xbff9aa90, hash=0)
    at /home/ralfk/Pandaroot/build/base/CbmDict.cxx:9056
#10 0xb72d962d in Cint::G__ExceptionWrapper () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#11 0xb73af956 in G__call_cppfunc () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#12 0xb7388a5b in G__interpret_func () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#13 0xb737c6d4 in G__getfunction () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#14 0xb74173bd in G__getstructmem () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#15 0xb740e819 in G__getvariable () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#16 0xb73534c2 in G__getitem () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#17 0xb73637dd in G__getexpr () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#18 0xb73bdb07 in G__exec_function () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#19 0xb73c2fa0 in G__exec_statement () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#20 0xb733fc07 in G__exec_tempfile_core () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#21 0xb733fe87 in G__exec_tempfile () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#22 0xb73cfbfa in G__process_cmd () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCint.so.5.14
#23 0xb786bc14 in TCint::ProcessLine () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#24 0xb78663a4 in TCint::ProcessLineSynch () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#25 0xb7799271 in TApplication::ProcessFile () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#26 0xb7795a6e in TApplication::ProcessLine () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libCore.so.5.14
#27 0xb67522f3 in TRint::Run () from /data_hilbert/Software/fairroot/cbmsoft/tools/root/lib/libRint.so.5.14
#28 0x08048dd0 in main ()
(gdb) list
1       <<C++-namespaces>>: No such file or directory.
        in <<C++-namespaces>>
(gdb) 


  • Attachment: runsim.C
    (Size: 5.16KB, Downloaded 455 times)
  • Attachment: rundigi.C
    (Size: 3.35KB, Downloaded 403 times)
  • Attachment: runreco.C
    (Size: 2.50KB, Downloaded 413 times)
Re: Stuck with a segfault in mvd reco [message #4878 is a reply to message #4877] Fri, 10 August 2007 11:55 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Ralf

The problem is not really in the Streamer. The problem is that you want to write something to the file which can not be handled
by the streamer. Please check which data classes you write to the
file. Did you change something in a class which goes to the file?

Ciao

Florian
Re: Stuck with a segfault in mvd reco [message #4879 is a reply to message #4877] Fri, 10 August 2007 12:14 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
Hi Florian,

The thing is that I did the full chain several times (to be sure my files are not screwed) and the reco runs some events before without problems.

But I'll look into the data classes.

Ralf.
Re: Stuck with a segfault in mvd reco [message #4898 is a reply to message #4877] Mon, 13 August 2007 12:31 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
Well here is a list of the data objects I want to store (pandaroot/mvd/MvdData/MvdCluster.cxx):
class MvdCluster : public CbmHit{

[...]

private:
  unsigned int _frontend;
  unsigned int _wafer;
  unsigned int _clusterSize;
  double _totaldE;
  double _meanTime;
  std::string _detPart;
  unsigned int _mcid;

}

The surprising thing is that before the Crash several events are done correctly!

What could be wrong?

ciao, Ralf.
Re: Stuck with a segfault in mvd reco [message #4899 is a reply to message #4898] Mon, 13 August 2007 12:54 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Ralf

I think the problem is the string, which has varying length. You
try to fill a variable with unfixed length into a TClonesArray
which depends on that your layout of the memory don't change
between different events.
As a test please try to change your program that you don't store
the string and run it again.

Ciao

Florian
Re: Stuck with a segfault in mvd reco [message #4900 is a reply to message #4877] Mon, 13 August 2007 12:55 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
Shall I use the TString instead? This is a root Object. I'll try this.
Ralf
Re: Stuck with a segfault in mvd reco [message #4901 is a reply to message #4900] Mon, 13 August 2007 13:02 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Ralf

Also TString does not work, because this is also an object
which has no fixed size. I would propose to code the name into
an integer. This works for shure.

Ciao

Florian
Re: Stuck with a segfault in mvd reco [message #4902 is a reply to message #4877] Mon, 13 August 2007 13:15 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
Hi Florian,

I commented the string out but it still breaks.
I thought that the TString is made for the storage in root files. My prevous data formats contain such a TString, too. Could the problem arise from that?

Ralf

Edit:

I made a run with valgrind and there it runs through. This is very strange.

[Updated on: Mon, 13 August 2007 14:08]

Report message to a moderator

Re: Stuck with a segfault in mvd reco [message #4906 is a reply to message #4902] Mon, 13 August 2007 15:21 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Ralf

> I commented the string out but it still breaks.
Ok. This is not the result i hoped for.

> I thought that the TString is made for the storage in root
> files.

I would say TString is the Root class to handle character arrays,
i don't know if it was made for storage in files.
The problem comes from the TClonesarray.
From the Root manual

>> A TClonesArray is an array of identical (clone) objects. The >> memory for the object is allocated only once in the lifetime
>> of the clonesarray.

> My prevous data formats contain such a TString, too. Could the
> problem arise from that?

This i don't understand? What do you mean exactely?

> I made a run with valgrind and there it runs through. This is > very strange.

This is indeed verry strange. Maybe valgrind prevents you from overwriting some array bondaries. Can you check what is written to your string?

Ciao

Florian
Re: Stuck with a segfault in mvd reco [message #4907 is a reply to message #4906] Mon, 13 August 2007 15:26 Go to previous messageGo to next message
StefanoSpataro is currently offline  StefanoSpataro
Messages: 2736
Registered: June 2005
Location: Torino
first-grade participant

From: *physik.uni-giessen.de
Is it not enough to use a Char_t XXXX[200], so with a fixed size?
Re: Stuck with a segfault in mvd reco [message #4908 is a reply to message #4877] Mon, 13 August 2007 15:48 Go to previous messageGo to next message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
OK, I'm getting closer:

First of all I made a mistake when using the clonesarray:
I had in my MvdRecoTask.cxx:
((*fClusterOutputArray)[size++]) = *it;

And I should have used:
MvdCluster* clust = new ((*fClusterOutputArray)[size++]) MvdCluster(**it);


So this seems ok now.

Now there is a problem with the copy constructor of MvdCluster:
Program received signal SIGFPE, Arithmetic exception.
[Switching to Thread -1236543792 (LWP 15045)]
0xb2fedddb in MvdCluster (this=0xb141dc0, c=@0x94fb988) at /home/ralfk/Pandaroot/pandaroot/mvd/MvdData/MvdCluster.cxx:29
29      , _mcid(c._mcid)
Current language:  auto; currently c++

MvdCluster::MvdCluster(const MvdCluster& c)
: CbmHit(c)
, _frontend(c._frontend)
, _wafer(c._wafer)
, _clusterSize(c._clusterSize)
, _totaldE(c._totaldE)
, _meanTime(c._meanTime)
, _mcid(c._mcid)
{
  // Copy Constructor
}

The all members are unsigned integer or double. Maybe the ":CbmHit(c)" is wrong.

Ralf.
Re: Stuck with a segfault in mvd reco [message #4909 is a reply to message #4877] Mon, 13 August 2007 16:36 Go to previous message
Ralf Kliemt is currently offline  Ralf Kliemt
Messages: 507
Registered: May 2007
Location: GSI, Darmstadt
first-grade participant

From: 141.30.85*
MvdCluster* clust = new ((*fClusterOutputArray)[size++]) MvdCluster(**it);
delete *it;

That did it!
I could even put back the std::string object and it is stored.

Thanks for your support.

Cheers, Ralf.
Previous Topic: Problems with DPMGen and Geant4
Next Topic: genfit demo
Goto Forum:
  


Current Time: Tue Nov 19 05:20:51 CET 2024

Total time taken to generate the page: 0.00781 seconds