# Legato getting crash when removing application

**URL:** <https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490>\
**Category:** Legato Application Framework\
**Created:** [April 26, 2023, 8:54am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490 "2023-04-26T08:54:32Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 26, 2023, 8:54am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/1 "2023-04-26T08:54:33Z")

</div>

This issue happened when we tried to remove the application. So we came up with a test script:

```auto
count=0;while true;do count=$((count+1));echo "===Loop $count===";echo "---Updating MQTT app---";update MQTT_0009.ag35x.update && update -g && /usr/bin/app_reload;sleep 2;echo "------Updating MMTEST_SDK app-----";update MMTEST_SDK.ag35x.update && update -g && /usr/bin/app_reload;sleep 1;app status;sleep 2;app stop MMTEST_SDK;app stop TC_MQTT_0009;echo "------app installed ------";app status;sleep 2;echo "----app removed------";app remove MMTEST_SDK;sleep 1;app remove TC_MQTT_0009;sleep 1;echo "-----App status after Removal----";app status;done

```

After running certain iterations of this script, legato will crash. And the log printed from serial port:

```auto
Apr 25 06:44:14 mdm9607 user.crit Legato: *CRT* | MMTEST_SDK[3653]/framework T=main | LE_FILENAME TermSignalHandler() 643 | Terminated

[2023-04-26_10:39:02:826]Apr 25 06:44:14 mdm9607 user.crit Legato: *CRT* | TC_MQTT_0009[3606]/framework T=main | LE_FILENAME TermSignalHandler() 643 | Terminated

[2023-04-26_10:39:02:826]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | configTree[1118]/configTree T=main | nodeIterator.c OnTransactionTimeout() 142 | Write transaction <0x10001d1d> timer expired, for user root, <0>.

[2023-04-26_10:39:02:832]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | configTree[1118]/configTree T=main | treeUser.c tu_TerminateConfigClient() 517 | A fatal error occurred. Killing config session <0x812c409c> for user root, <0>. Reason: Transaction timeout.

[2023-04-26_10:39:02:835]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | updateDaemon[1119]/framework T=main | le_cfg_client.c SessionCloseHandler() 451 | Component for le_cfg disconnected

[2023-04-26_10:39:02:838]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | watchdog[1120]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_instStat:e160a983e92b4310ae8af3fbeff75a1b).

[2023-04-26_10:39:02:842]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | audioDaemon[1137]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (audioDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:842]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | supervisor[1103]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_instStat:e160a983e92b4310ae8af3fbeff75a1b).

[2023-04-26_10:39:02:845]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | atServerDaemon[1132]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (atServerDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:846]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | powerManagerService[1189]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (powerManagerService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:849]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | portDaemon[1179]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (portDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:852]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | gpioService[1159]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (gpioService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:854]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | fwupdateDaemon[1153]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (fwupdateDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:857]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | posDaemon[1184]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (posDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:860]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | secStore[1194]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (secStore.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:860]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | update[3680]/framework T=main | le_appRemove_client.c SessionCloseHandler() 451 | Component for le_appRemove disconnected

[2023-04-26_10:39:02:863]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | cellNetService[1142]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (cellNetService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:865]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | dcsDaemon[1147]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (dcsDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:02:868]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | _UNKNOWN_[1452]/framework T=LegatoAudioThread | LE_FILENAME SessionCloseHandler() 451 | Component for le_audio disconnected

[2023-04-26_10:39:02:868]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | atClientDaemon[1131]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (atClientDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:009]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1173]/framework T=MrcProcessThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:014]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1173]/framework T=SmsSendingThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:018]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1173]/framework T=MdcEventThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:021]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1173]/framework T=PulseRingSignalThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:024]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1173]/framework T=ECallThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:024]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | rSimDaemon[1174]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (rSimDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).

[2023-04-26_10:39:03:027]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | _appStopClient[3681]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused

[2023-04-26_10:39:03:029]Apr 25 06:44:47 mdm9607 user.emerg Legato: *EMR* | _appStopClient[3684]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused

[2023-04-26_10:39:03:218]
[2023-04-26_10:39:03:218]INITzCC?[2023-04-26_10:39:03:233]INIT: Sending processes the TERM signal

[2023-04-26_10:39:03:424]init-eu-full stop sequence

```

We investigated into the issue, found that some file/directory went missing, next moment, legato got crashed. Later on, we added some print info for debug this issue, and then we observed the following error in the Snapshot.

```auto
Nov 1 00:07:17 mdm9607 user.crit Legato: *CRT* | MMTEST_SDK[2458]/framework T=main | LE_FILENAME TermSignalHandler() 643 | Terminated
Nov 1 00:07:18 mdm9607 user.crit Legato: *CRT* | TC_MQTT_0009[2412]/framework T=main | LE_FILENAME TermSignalHandler() 643 | Terminated
Nov 1 00:07:25 mdm9607 user.crit Legato: *CRT* | updateDaemon[1093]/framework T=main | LE_FILENAME file_Copy() 575 | eyelyn1 Attempting to copy a directory, '/legato/systems/current/config/modemService.scissors', into a file, '/legato/systems/unpack/config/modemServi
Nov 1 00:07:25 mdm9607 user.crit Legato: *CRT* | updateDaemon[1093]/framework T=main | LE_FILENAME file_CopyRecursive() 826 | eyelyn5 Attempting to copy a directory, '/legato/systems/current/config/modemService.scissors', into a file, '/legato/systems/unpack/config/m
Nov 1 00:07:25 mdm9607 user.err Legato: =ERR= | updateDaemon[1093]/updateDaemon T=main | system.c system_Snapshot() 791 | eyelyn file_CopyRecursive -1
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | configTree[1092]/configTree T=main | nodeIterator.c OnTransactionTimeout() 142 | Write transaction <0x10000c7b> timer expired, for user root, <0>.
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | configTree[1092]/configTree T=main | treeUser.c tu_TerminateConfigClient() 517 | A fatal error occurred. Killing config session <0x8155909c> for user root, <0>. Reason: Transaction timeout.
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | updateDaemon[1093]/framework T=main | le_cfg_client.c SessionCloseHandler() 451 | Component for le_cfg disconnected
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | watchdog[1094]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_instStat:e160a983e92b4310ae8af3fbeff75a1b).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | audioDaemon[1116]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (audioDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | supervisor[1077]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (le_instStat:e160a983e92b4310ae8af3fbeff75a1b).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | powerManagerService[1162]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (powerManagerService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | gpioService[1136]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (gpioService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | secStore[1167]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (secStore.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | fwupdateDaemon[1131]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (fwupdateDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | posDaemon[1157]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (posDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | update[2484]/framework T=main | le_appRemove_client.c SessionCloseHandler() 451 | Component for le_appRemove disconnected
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | cellNetService[1121]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (cellNetService.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | atClientDaemon[1110]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (atClientDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | atServerDaemon[1111]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (atServerDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | portDaemon[1152]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (portDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | dcsDaemon[1126]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (dcsDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | rSimDaemon[1147]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (rSimDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1146]/framework T=MrcProcessThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _UNKNOWN_[1434]/framework T=LegatoAudioThread | LE_FILENAME SessionCloseHandler() 451 | Component for le_audio disconnected
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1146]/framework T=SmsSendingThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1146]/framework T=MdcEventThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1146]/framework T=PulseRingSignalThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | modemDaemon[1146]/framework T=ECallThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (modemDaemon.watchdogChain.le_wdog:572ba176b790548eed89b7ba6f9f4b14).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2485]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2486]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2490]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2492]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2494]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2496]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2497]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2498]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _appStopClient[2499]/appStopClient_exe T=main | appStopClient.c _appStopClient_exe_COMPONENT_INIT() 53 | Error sending app name to the AppStop server socket. Connection refused
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | smsInboxService[1172]/framework T=main | LE_FILENAME ClientSocketHangUp() 852 | Session closed by server (smsInboxService.smsInboxService.le_sim:f834c96427271edede285bc9174fc4f3).
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _UNKNOWN_[1441]/framework T=TelcoStatusThread | LE_FILENAME SessionCloseHandler() 451 | Component for le_mdc disconnected
Nov 1 00:07:51 mdm9607 user.emerg Legato: *EMR* | _UNKNOWN_[1441]/framework T=LegatoMainThread | LE_FILENAME ClientSocketHangUp() 852 | Session closed
INIT: Sending processes the TERM signal1 mdm9607 user.emerg Legato: *EMR* | _appStopClie
init-eu-full stop sequence
killall: dlt-system: no process killed
killall: mm_mw_diag: no process killed

```

```auto
2282778 2023/04/04 22:28:02.196330 16262.9448 98 ATB4 SYS SYSL 0 log info verbose 1 <10>Nov 1 04:30:25 Legato: *CRT* | updateDaemon[1122]/framework T=main | LE_FILENAME file_CopyRecursive() 890 | Error reading file/directory information, '/legato/systems/current/config/modemService.paper'. (No such file or directory)
2282779 2023/04/04 22:28:02.196352 16262.9452 33 ATB4 DR STM 0 log info verbose 1 $GPRMC,,V,,,,,,,,,,N*53
2282780 2023/04/04 22:28:02.196357 16262.9463 99 ATB4 SYS SYSL 0 log info verbose 1 <11>Nov 1 04:30:25 Legato: =ERR= | updateDaemon[1122]/updateDaemon T=main | system.c system_Snapshot() 791 | eyelyn file_CopyRecursive -19
2282781 2023/04/04 22:28:02.196361 16262.9475 100 ATB4 SYS SYSL 0 log info verbose 1 <14>Nov 1 04:30:25 Legato: INFO | modemDaemon[1177]/le_pa T=main | pa_mrc.c sGetQmiRespSignalStrength() 510 | ===== gsm_sig_info_valid
2282782 2023/04/04 22:28:02.196366 16262.9487 101 ATB4 SYS SYSL 0 log info verbose 1 <14>Nov 1 04:30:25 Legato: INFO | modemDaemon[1177]/le_pa T=main | pa_mrc.c pa_mrc_GetSignalStrength() 613 | exit, rssi:-87

```

We suspect that “file\_CopyRecursive” function has failed at this moment.

Could you please advice how can we resolve this issue?

Thanks a lot!

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 26, 2023, 9:05am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/2 "2023-04-26T09:05:30Z")

</div>

is this only happening to your application?  
how about a simple helloworld application?

BTW, i don’t have such file /legato/systems/current/config/modemService.paper either.

```auto
root@swi-mdm9x28-wp:~# ls /legato/systems/current/config/ -l
-rw------- 1 root root 145 Jan 6 08:06 modemService.scissors
-rw-rw-rw- 1 root root 2 Jan 6 08:00 resources.paper
-rw-rw-rw- 1 root root 1077 Jan 6 08:07 secStore.paper
-rw-rw-rw- 1 root root 33283 Jan 6 08:00 system.scissors
root@swi-mdm9x28-wp:~# find / -name "modemService.paper"
find: /proc/2258: No such file or directory
root@swi-mdm9x28-wp:~#

```

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 26, 2023, 9:09am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/3 "2023-04-26T09:09:49Z")

</div>

Hi,

Thanks for your prompt reply.  
This file was created during the removal process, it is not there in normal situation.

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 26, 2023, 9:11am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/4 "2023-04-26T09:11:37Z")

</div>

how about running your script to remove a simple helloworld application?  
Did you tune the sleep() to be longer period like 30 seconds inside your script?  
Does the problem still exist after power cycle?

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 26, 2023, 9:18am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/5 "2023-04-26T09:18:02Z")

</div>

The issue is only present on some particular applications, not all applications.  
We tried to increase the transaction timeout, it will get better, but crashed eventually.

The system will recover after reboot.

Haven’t tried to increase the sleep(), will try that later.

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 26, 2023, 9:21am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/6 "2023-04-26T09:21:51Z")

</div>

if this only happens to some application, and not some simple application, probably you can tune a longer sleep() value.

Also you can put the application in “start:manual” to see if there is improvement. Maybe the init part is too busy to remove application.

> **[Application Definition .adef - Legato Docs](https://docs.legato.io/latest/defFilesAdef.html#defFilesAdef_start)**
>
> legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 26, 2023, 9:24am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/7 "2023-04-26T09:24:24Z")

</div>

Thanks a lot, we will try that, too.

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 27, 2023, 8:14am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/8 "2023-04-27T08:14:19Z")

</div>

Hi [jyijyi](https://forum.legato.io/u/jyijyi)

We’ve tried the 2 methods, sleep() and start:manual, but the issue will present anyway, and no improvement there.

Instead, we’ve seen this behaviour: executed “ls -la” command, then observed files modemService.paper \> modemService.scissors \> modemService.rock files are changing/rename continuously

Could you suggest another way to resolve this?

Thanks a lot!

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 27, 2023, 8:18am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/9 "2023-04-27T08:18:23Z")

</div>

if this is only happening to particular application and not in a simple application like helloworld, then you need to figure which part in your application is making the problem.

For example, you need to diff the source code .c file or .cdef or .adef file.

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [April 27, 2023, 8:34am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/10 "2023-04-27T08:34:12Z")

</div>

Hi,

Now we are suspecting the application is not handling file/directory clean-up correctly, is it one of the possibilities? If so, which process within Legato should we look into?

BR,  
Louis

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [April 27, 2023, 8:52am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/11 "2023-04-27T08:52:24Z")

</div>

you can debug in this file:

> <https://github.com/legatoproject/legato-af/blob/master/framework/liblegato/linux/file.c>

---

<div class="post-metadata">

**Author:** ![louis.huang](https://avatars.discourse-cdn.com/v4/letter/l/5daacb/32.png) [@louis.huang](https://forum.legato.io/u/louis.huang)\
**Post date:** [May 2, 2023, 8:22am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/12 "2023-05-02T08:22:42Z")

</div>

Hi jyijyi，

We are still working on comparing the .adef and .cdef files, no progress there yet.  
Could you please help us to understand the behaviour of modemService got changed/renamed continuously?

As shown below:

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/1/18e78157025d75c28de2d4fb14aaeaca3038af67.png)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [May 2, 2023, 8:37am UTC](https://forum.legato.io/t/legato-getting-crash-when-removing-application/6490/13 "2023-05-02T08:37:07Z")

</div>

I have no idea on this as this is not fully documented in [legato.io](http://legato.io)  
(only see this :[config - Legato Docs](https://docs.legato.io/latest/toolsTarget_config.html))  
As said before, you need to compare the OK and NOK application in adef and cdef
