PX4 v1.7.3 slow memory leak

I have been running standalone PX4 v1.7.3 on Snapdragon Flight and somewhere between 2 and 2.5 hours, the DSP crashes. From the syslog it is not clear what is the reason for the crash, but I suspect it’s some form of slow memory leak because sometimes I get …

Fatal error on the ADSP!
ADSP subsystem failure reason: Out of memory

And sometimes it’s just ‘Exception detected’

May 24 23:29:00 linaro-developer kernel: [10027.984146] Fatal error on the ADSP!
May 24 23:29:00 linaro-developer kernel: [10027.986696] ADSP subsystem failure reason: :Excep :0:Exception detected
May 24 23:29:00 linaro-developer kernel: [10027.993546] subsys-restart: subsystem_restart_dev(): Restart sequence requested for adsp, restart_level = RELATED.
May 24 23:29:00 linaro-developer kernel: [10027.994566] subsys-restart: subsystem_shutdown(): [f6050e40]: Shutting down adsp
May 24 23:29:00 linaro-developer kernel: [10027.998815] init: adsprpcd main process ended, respawning
May 24 23:29:00 linaro-developer kernel: [10028.081085] adsp_state_notifier_fn: sysmon_send_event failed (-38).
May 24 23:29:00 linaro-developer kernel: [10028.086271] L-Notify: Generel: 4
May 24 23:29:00 linaro-developer kernel: [10028.549397] init: adsprpcd main process (1863) terminated with status 255
May 24 23:29:00 linaro-developer kernel: [10028.549434] init: adsprpcd main process ended, respawning
May 24 23:29:01 linaro-developer kernel: [10028.714624] subsys-restart: subsystem_powerup(): [f6050e40]: Powering up adsp
May 24 23:29:01 linaro-developer kernel: [10028.717352] pil-q6v5-lpass fe200000.qcom,lpass: adsp: loading from 0x05a00000 to 0x06e00000
May 24 23:29:01 linaro-developer kernel: [10028.838480] ------------[ cut here ]------------

Here is mini-dm crash log

[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.876 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/04] 47:10.877 thread_create returned error 1537 pthread.c
[08500/02] 47:11.928 mmpm_register: MMPM client for USM ADSP core 12 0117 UltrasoundStreamMgr_Mmpm.cpp
[08500/02] 47:11.928 ADSP License DB: License validation function with id 164678 stored. 0280 adsp_license_db.cpp
[08500/02] 47:11.928 AvsCoreSvc: StartSvcHandler Enter 0518 AdspCoreSvc.cpp
[08500/02] 47:11.928 AdspCoreSvc: Started successfully 0534 AdspCoreSvc.cpp
[08500/02] 47:11.932 loading BLSP configuration 0217 blsp_config.c
[08500/02] 47:11.980 HAP:110:cannot find /oemconfig.so 0141 load.c
[08500/03] 47:11.980 HAP:111::error: -1: 0 == dynconfig_init(&conf, “security”) 0696 sigverify.c
[08500/02] 47:11.980 opened /usr/share/data/adsp/blsp.config 0237 blsp_config.c
[08500/02] 47:11.980 HAP:79:cannot find /voiceproc_tx.so 0141 load.c
[08500/02] 47:11.980 read 39 bytes 0248 blsp_config.c
[08500/02] 47:11.980 found tty- next char 4 0087 blsp_config.c
[08500/02] 47:11.980 uart_dev_id 4 0098 blsp_config.c
[08500/02] 47:11.980 found bam- next char 1 0129 blsp_config.c
[08500/02] 47:11.980 bam_id 10 0137 blsp_config.c
[08500/02] 47:11.980 set tty-4 = BAM-10 0161 blsp_config.c
[08500/02] 47:11.980 2-wire UART enabled for tty-4 0186 blsp_config.c
[08500/02] 47:11.980 found tty- next char 1 0087 blsp_config.c
[08500/02] 47:11.980 uart_dev_id 1 0098 blsp_config.c
[08500/02] 47:11.980 found bam- next char 9 0129 blsp_config.c
[08500/02] 47:11.980 bam_id 9 0137 blsp_config.c
[08500/02] 47:11.980 set tty-1 = BAM-9 0161 blsp_config.c
[08500/02] 47:11.980 2-wire UART enabled for tty-1 0186 blsp_config.c
[08500/02] 47:11.980 UART tty-1: BAM-9, 2-wire: 1 0198 blsp_config.c
[08500/02] 47:11.980 UART tty-2: BAM: [not found] 0203 blsp_config.c
[08500/02] 47:11.980 UART tty-3: BAM: [not found] 0203 blsp_config.c
[08500/02] 47:11.980 UART tty-4: BAM-10, 2-wire: 1 0198 blsp_config.c
[08500/02] 47:11.980 UART tty-5: BAM: [not found] 0203 blsp_config.c
[08500/02] 47:11.980 UART tty-6: BAM: [not found] 0203 blsp_config.c
[08500/02] 47:11.980 HAP:79:cannot find /voiceproc_rx.so 0141 load.c
[08500/02] 47:11.980 BLSP configuration loaded 0270 main.c

I do not get this crash in PX4 v1.5.4. But on v1.7.3 it’s very consistent.