seslabSJU / tinyIoT

7 stars 0 forks source link

DELETE operation on fopt of a group makes server crash #16

Open reinaortega opened 5 months ago

reinaortega commented 5 months ago

DELETE operation on fopt of a group makes server crash during the DELETE operation of the first member with:

Segmentation fault (core dumped)

For test: TC_CSE_GMG_005_DEL

LAMXkE commented 4 months ago

It seems it is also fixed.

SCR-20240305-knty

And I modified function on fb4a6b5a54b8d59bdd2d4b2c63a5dfcbe37c8bb2 to match the standard TS 0004 - 7.4.14.3.5

SCR-20240305-lkzu

Except unless the reference in question is a virtual resource reference.

reinaortega commented 3 months ago

Server crushed when trying to fan out the Delete operation:

Mon Mar 11 13:34:16 2024 DEBUG [HTTP]: [DELETE] /TinyIoT/MyAe1/MyGroup/fopt Mon Mar 11 13:34:16 2024 DEBUG [HTTP]: fr: CAE20240311T1334150016 Mon Mar 11 13:34:16 2024 DEBUG [HTTP]: to: TinyIoT/MyAe1/MyGroup/fopt Mon Mar 11 13:34:16 2024 INFO [HTTP]: Request : DELETE Mon Mar 11 13:34:16 2024 INFO [HTTP]: Client connected 127.0.0.1

Mon Mar 11 13:34:16 2024 DEBUG [HTTP]: ip: 127.0.0.1 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: CSE_RELATIVE Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [O2M]: handle fopt Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: get_acop_macp : CAE20240311T1334150016 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Non-Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: RI : Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rtnode not found Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : TinyIoT/MyAe1 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [MAIN]: handle_onem2m_request Mon Mar 11 13:34:16 2024 INFO [O2M]: Delete oneM2M resource Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [DB]: Delete [RI] CAE20240311T1334150016 Mon Mar 11 13:34:16 2024 DEBUG [DB]: SQL : DELETE FROM general WHERE uri LIKE 'TinyIoT/MyAe1/%' OR ri='CAE20240311T1334150016'; Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rsc : 2002 Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : TC_CSE_GMG_005_DEL-m_delete737307 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Non-Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: RI : TC_CSE_GMG_005_DEL-m_delete737307 Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rtnode not found Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : TinyIoT/MyAe1 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rtnode not found Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : CAE20240311T1334150016 Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Non-Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: RI : CAE20240311T1334150016 Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rtnode not found Mon Mar 11 13:34:16 2024 DEBUG [O2M]: mid : 2a Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: Non-Hierarchical Addressing Mon Mar 11 13:34:16 2024 DEBUG [UTIL]: RI : 2a Mon Mar 11 13:34:16 2024 DEBUG [O2M]: rtnode not found Segmentation fault (core dumped)

LAMXkE commented 3 months ago

You are trying to delete a parent AE of GRP resource with fopt. ( first mid is TinyIoT/MyAe1 )

It seems memory is corrupted because after successful deletion of first member all child of MyAe1 including GRP resource itself will be deleted as well. I see MEMBER_RESOURCE_ADDRESS1, MEMBER_RESOURCE_ADDRESS2 is set to AE at TestCase but is it okay to have parent ae as member ?

I can't find what should CSE do if this is requested. Should it remove its parent resource and delete itself after full fopt procedure?

I tried to find detail about it on TS 0001 10.2.7.9 and TS 0004 7.4.14.2.4 but couldn't find it.