Message: Re: Double delete in G4CrossSectionDataSetRegistry? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Double delete in G4CrossSectionDataSetRegistry? 

Forum: Hadronic Processes
Re: Question Double delete in G4CrossSectionDataSetRegistry? (Kareem Kazkaz)
Re: Idea Re: Double delete in G4CrossSectionDataSetRegistry? (Vladimir Ivanchenko)
Re: Question Re: Double delete in G4CrossSectionDataSetRegistry? (Matthew Blackston)
Date: 05 Nov, 2010
From: Michael H. Kelsey <Michael H. Kelsey>

On Wed, 03 Nov 2010 18:04:03 GMT, Matthew Blackston wrote:
> I'm getting a similar error. I'm using
> 
>        Geant4 version Name: geant4-09-03-patch-01 (9-April-2010)
> 
> The error is:
> 
> dualImager(90997) malloc: *** error for object 0x109953460: pointer
> being freed was not allocated
> *** set a breakpoint in malloc_error_break to debug
> 
> When I use gdb and set the malloc_error_break, I get the following
> backtrace:
> 
> (gdb) backtrace
> #0 0x00007fff887a9491 in malloc_error_break ()
> #1 0x00007fff886d3603 in free ()
> #2 0x00000001013f5de1 in
> G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection(this=0x109953460)
> at src/G4ElectroNuclearCrossSection.cc:80
> #3 0x00000001013ef67b in G4CrossSectionDataSetRegistry::Clean
> (this=0x102314d90) at src/G4CrossSectionDataSetRegistry.cc:72
> #4 0x00000001013ef71c in
> G4CrossSectionDataSetRegistry::~G4CrossSectionDataSetRegistry
> (this=0x102314d90) at src/G4CrossSectionDataSetRegistry.cc:61
> #5 0x00000001013ef774 in __tcf_0 () at
> src/G4CrossSectionDataSetRegistry.cc:50
> #6 0x00007fff886df7f4 in __cxa_finalize ()
> #7 0x00007fff886df70c in exit ()
> #8 0x0000000100002153 in start () at G4ReferenceCountedHandle.hh:315

Hi, Matthew. Could you run in GDB and set two breakpoints?

 break 'G4ElectroNuclearCrossSection::~G4ElectroNuclearCrossSection()'

Then run your job. If you capture the |where| traceback each time it stops, it should isolate exact where the double-delete originates. It's not in the Registry::Clean() call, as that explicitly sets the pointers stored in the vector to zero, even before clearing the vector (so any cached reference will see the null pointer).

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Double delete in G4CrossSectionDataSetRegistry?   (Matthew Blackston - 09 Nov, 2010)
1 More: Re: Double delete in G4CrossSectionDataSetRegistry?   (Michael H. Kelsey - 09 Nov, 2010)
2 Idea: Re: Double delete in G4CrossSectionDataSetRegistry?   (Vladimir Ivanchenko - 10 Nov, 2010)
1 None: Re: Double delete in G4CrossSectionDataSetRegistry?   (Matthew Blackston - 10 Nov, 2010)
 Add Message Add Message
to: "Re: Double delete in G4CrossSectionDataSetRegistry?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]