Closed heliosfa closed 5 years ago
Just started looking into this. As far as I can tell this appears to be an issue introduced with some revision of the hardware model. The offending function is P_builder::Preplace, which falls over at the line
if (!par->pPlace->Place(task)) task->LinkFlag();
after building an engine "VirtualSystem". Not had time to look at it further, but it appears the engine is not being built correctly, because gdb says placement is hitting a bad iterator trying to iterate through the threads - in the line in Placement::Place
pTh = iterator->next_thread();
The Preplace function was originally designed to make sure that if you've not defined a topology or placed anything yet, we automatically create a 'default' topology and map to it so that something can be sensibly built. Preplace was working at about the time of the workshop IIRC. (It was definitely working at some point near that time frame).
I am adding Mark as an assignee for obvious reasons...and will continue digging myself.
Fixed in commit 853ecc0 on the bugfix93 branch. The issue was simply that Placement now includes an Init() method that initialises an iterator into the engine associated with its parent. Within P_Builder, meanwhile, when a task with no existing engine (i.e. no topology) was found it was creating a new engine and associating it with the parent Orchestrator, but forgot to initialise the parent's Placement object.
Review if you wish but I suspect this particular fix is likely to be non-contentious; 1 line in one place that isn't going to have further ramifications.
In Development, I can create a reproducible segfault by executing the following command sequence:
(note the lack of
topology /set1
andlink /link = plate_100x100
)Clearly this should NOT happen and we should have a graceful error instead.