Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

The processes Ive written work fine alone, or in some connectivity patterns (particularly open loop), so why do they seg fault when connected together (particularly closed loop)?

0
Posted

The processes Ive written work fine alone, or in some connectivity patterns (particularly open loop), so why do they seg fault when connected together (particularly closed loop)?

0

EVENT_INIT_CONNECT is fired on processes multiple times in general, possibly with no inputs available on the first call, and with all inputs available on the last. Processes receive this call in the order they appear in a system, so for open-loop simply connected systems, they may all receive only one EVENT_CONNECT call, with all their inputs available. Once connected in a loop, at least one of the processes must receive EVENT_INIT_CONNECT without any inputs available. In this case, if an incautious assumption that Data is present (Due) is made, and a Data object dereferenced (e.g. called) without checking for NULL, a segmentation fault will occur. The solution is to correct the logic in your EVENT_INIT_CONNECT implementation, and make sure Data is Due before you use it.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123