Node State Manager in 64bit systems ...

Hoyer, Marko (ADITG/SW2) mhoyer at de.adit-jv.com
Mon Oct 17 03:49:57 EDT 2016


Hello,

It seems Node State Manager will have some problems in 64 bit systems. The mechanism to wait for lifecycle_complete events uses a pointer as id to match incoming events to the lifecycle consumer data structure:

NodeStateAccess.c
if(NSMA__pCurrentLcConsumer == (NodeStateLifeCycleConsumer*) u32RequestId)

node_state_life_cycle_consumer_call_lifecycle_request(NSMA__pCurrentLcConsumer,
                                                         u32ShutdownType,
                                                         (guint) NSMA__pCurrentLcConsumer,
                                                         NULL,
                                                         &NSMA__vOnLifecycleRequestFinish,
                                                         NULL);

This might lead to following situations:

-        A lifecycle_complete event from one of the clients is not detected due to a not matching point (the pointer is different after a cast.)

-        A lifecycle _complete event from one client is detected as the answer of another one (32bits are not compared. The id might fit for different pointers.)

Solution:

-        I suggest to implement a 32 bit id generation independent from pointers. Ids can be just generated by counting up an integer during registration. I would not expect any overflow. With this solution, the interface can be kept as it is.

In addition:

-        This issue is reported by the compiler as a warning. I suggest to change the compiler settings to treat warnings as errors. This way, such kind of errors are detected very fast.

Best regards

Marko Hoyer
Advanced Driver Information Technology GmbH
Software Group II (ADITG/SW2)
Robert-Bosch-Str. 200
31139 Hildesheim
Germany
Tel. +49 5121 49 6948
Fax +49 5121 49 6999
mhoyer at de.adit-jv.com
ADIT is a joint venture company of Robert Bosch GmbH/Robert Bosch Car Multimedia GmbH and DENSO Corporation
Sitz: Hildesheim, Registergericht: Amtsgericht Hildesheim HRB 3438
Geschäftsführung: Wilhelm Grabow, Ken Yaguchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genivi.org/pipermail/genivi-projects_lists.genivi.org/attachments/20161017/a7623051/attachment.html>


More information about the genivi-projects mailing list