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

Question Double delete in G4CrossSectionDataSetRegistry? 

Forum: Hadronic Processes
Date: 27 Jul, 2009
From: Kareem Kazkaz <Kareem Kazkaz>

Hello everyone.

On a simulation that I run, the simulation doesn't necessarily end cleanly, with a bunch of malloc errors reported. This is after the simulation has completed running, and the program is trying to clean up after itself (i.e., after EndOfRunAction has been called). Here is a transcript of the messages from the Idle> prompt:

Idle> exit
Graphics systems deleted.
Visualization Manager deleting...
CUORE(18743) malloc: *** error for object 0x41bd450: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
CUORE(18743) malloc: *** error for object 0x41c1850: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
CUORE(18743) malloc: *** error for object 0x4227050: Non-aligned pointer being freed (2)
*** set a breakpoint in malloc_error_break to debug
One of my colleagues may have traced the malloc errors down to the G4CrossSectionDataSetRegistry::Clean() method. He has found that simply by commenting out line 71, "delete xSections[i];", the malloc errors go away.

Could it be possible that the entries in the xSections vector are being deleted elsewhere? Perhaps G4CrossSectionDataSetRegistry::Clean() or DeRegister() is called from somewhere else, and then when the class is destroyed Clean() is called again?

On a related note, I'm curious as to why the entries within the xSections vector is set to 0 within this class, rather than calling xSections.erase().

Thanks for any comments.

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

1 Idea: Re: Double delete in G4CrossSectionDataSetRegistry?   (Vladimir Ivanchenko - 27 Jul, 2009)
(_ Question: Re: Double delete in G4CrossSectionDataSetRegistry?   (Matthew Blackston - 03 Nov, 2010)
1 Idea: Re: Double delete in G4CrossSectionDataSetRegistry?   (Vladimir Ivanchenko - 03 Nov, 2010)
1 None: Re: Double delete in G4CrossSectionDataSetRegistry?   (Matthew Blackston - 05 Nov, 2010)
... 1 Message(s)
2 None: Re: Double delete in G4CrossSectionDataSetRegistry?   (Michael H. Kelsey - 05 Nov, 2010)
1 None: Re: Double delete in G4CrossSectionDataSetRegistry?   (Matthew Blackston - 09 Nov, 2010)
... 3 Message(s)
 Add Message Add Message
to: "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 ]