MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000362JANABugpublic2013-06-28 08:162014-01-23 09:40
Reporterdavidl 
Assigned Todavidl 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Summary0000362: null_data_source not defined
DescriptionThis is actually a couple of issues. These are related and came up while implementing the translation table in the DAQ and TTab plugins. The desired behavior was to have the DAQ plugin create low level objects and the TTab plugin take those and generate detector hit objects. If only the DAQ plugin is present, no translation is done. If the TTab plugin is present, then translation is done automatically.

This was to be achieved by simply calling JEventLoop::GetSingle from GetObjects to get a DTranslationTable object that can then be used to generate the hit objects by applying the table (via the ApplyTranslationTable method). The issues that came up were:

1.) When calling JEventLoop::Get from a JEventSource::GetObjects method, an infinite recursion is entered and doesn't stop until an "illegal instruction" is encountered. It would be good to have some way of detecting this for event sources as is done for factories.

2.) The temporary solution was to use GetFromFactory instead of GetSingle. This, however, gave a run time link error saying "null_data_source" was not defined. Giving an explicit argument of JEventLoop::DATA_FROM_FACTORY also doesn't work since the argument requires a reference. A temporary variable must then be defined so a reference to it can be passed. In the end the code looked like this:

JEventLoop::data_source_t type = JEventLoop::DATA_FROM_FACTORY; // (this needs to get fixed in JANA)
loop->GetFromFactory(translationTables, "", type);

when it could have looked like this:
oop->GetFromFactory(translationTables);


TagsNo tags attached.
Attached Files

- Relationships
parent of 0000393closed janadot broken by fix for bug 362 

-  Notes
(0000579)
davidl (administrator)
2013-12-13 16:23

Item 1.) here is not easy to implement in a way that won't risk significant performance degradation. For normal factories, the Get method is implemented in the JFactory base class which allows us to use a "busy" flag to check quickly and easily for recursion. For event sources, the first point where we have access by the framework is in the JEventLoop::Get() method. Here, we would have to turn on call stack tracing and check it each time to ensure there is no duplicate entry. We could also put some arbitrary limit on the depth of the call stack without actually recording it, but that would have to be high enough to never be a problem for non-infinite-recursion cases, but be small enough to catch the infinite recursion cases before they caused memory errors.
(0000580)
davidl (administrator)
2013-12-13 16:30

Made data_source by passed by value rather than by reference. Since it is an enum, it really saved almost nothing doing it by reference in the first place.

- Issue History
Date Modified Username Field Change
2013-06-28 08:16 davidl New Issue
2013-12-13 16:23 davidl Note Added: 0000579
2013-12-13 16:30 davidl Note Added: 0000580
2013-12-13 16:30 davidl Status new => resolved
2013-12-13 16:30 davidl Resolution open => fixed
2013-12-13 16:30 davidl Assigned To => davidl
2014-01-23 09:40 davidl Relationship added parent of 0000393


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker