File size limit exceeded (core dumped)

Hello,

I’m coming across the File size limit exceeded (core dumped) error when trying to store a significant amount data to a mounted usb drive through my legato application. The process which writes the data to the drive is spawned from my application by popen(), though I have the same error if I try to run it with a system() command.
When the process is ran from the command line, it executes as expected with no error.

I found this thread which describes the same issue, but the suggestions don’t seem to help. I even tried to emulate what he was doing by wget’ing a 200MB file from the internet (rather than my own process) and can replicate the same error.

My linux and legato image are based off R13.1 and are lightly customised to meet our requirements.

I’m using a WP7607 modem.

What i’ve tried:

I’ve tried increasing maxFileBytes and maxFileSystemBytes in the adef, but I notice no change to the limits when running system(“ulimit -a”); with or without those values set. Nor does it solve the issue.

I’ve tried mounting my usb drive in /tmp/ and in /home/root/ but neither makes a difference.

At this point it seems like my only other option is to create a native application that has some form of IPC with my legato application to start and stop the process to write the data to the drive, but I’d rather not go this way if at all possible.

I’m sure i’ve probably missed something with my adef , so would appreciate any ideas.

Thanks

Have you tried unsandboxed feature?

Hi, yes my app is already unsandboxed. I had forgotten to mention it.

I was wondering whether the limits set in the processes section of adef only applied to those processes that are set to run? I only wonder this due to the processes showing the limit I set in config get /apps/myAppName/

Are you using something like this?

Similar yes

I had tried your example, which works okay because you’re downloading a file to /dev/null, as soon as you change the output to anything else you get the File size limit exceeded (core dumped) error.

i.e.
curl -o /dev/null -k path/to/large/file.txt works OK
curl -o /home/root/file.txt -k path/to/large/file.txt has File size limit exceeded (core dumped) error

I don’t see problem to run the unsandboxed app to call the script to download the 10MB file with WP76 FW R13.



root@swi-mdm9x28-wp:~# app status
[running] atAirVantage
[running] atQmiLinker
[running] atService
[running] audioService
[running] avcService
[running] cellNetService
[running] dataConnectionService
[running] fwupdateService
[running] gpioService
[running] modemService
[running] portService
[running] positioningService
[running] powerMgr
[running] qmiAirVantage
[running] secStore
[stopped] smsInboxService
[stopped] spiService
[running] tools
[stopped] voiceCallService
[stopped] wifi
[stopped] wifiApTest
[stopped] wifiClientTest
[running] wifiService
[stopped] wifiWebAp
[stopped] hello1
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ls /tmp
hello1.wp76xx.update  legato                resolv.conf
hosts                 legato_logs           sock0
ld.so.cache           pkgdwl                thermal_engi_ipc
ld.so.conf            psm_socket            tmpfdbtable.txt
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cat /home/root/test.sh
wget http://116.66.221.43/10M.bin -O /tmp/10M.bin


root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cm data
Index:                         1
APN:                           Internet
PDP Type:                      IPV4
Connected:                     yes
Auth type:                     PAP
User name:
Password:
Interface:                     rmnet_data0
Family[IPv4]:                  inet
IP[IPv4]:                      49.130.0.7
Gateway[IPv4]:                 49.130.0.8
Dns1[IPv4]:                    10.30.23.130
Dns2[IPv4]:                    10.30.25.130
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# app start hello1
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# ls /tmp/
10M.bin               legato                sock0
hello1.wp76xx.update  legato_logs           thermal_engi_ipc
hosts                 pkgdwl                tmpfdbtable.txt
ld.so.cache           psm_socket
ld.so.conf            resolv.conf

Hi, thanks for your help.

I tried to create a test app as you have done, and still encounter the same error.
Here is the logread output:

Sep 20 11:14:14 swi-mdm9x28-wp user.info Legato:  INFO | main[21289]/TestComponent T=main | main.c _TestComponent_COMPONENT_INIT() 7 | Starting TestComponent
Sep 20 11:14:14 swi-mdm9x28-wp user.err Legato: =ERR= | main[21289] | Connecting to 212.183.159.230 (212.183.159.230:80)
Sep 20 11:14:14 swi-mdm9x28-wp user.err Legato: =ERR= | main[21289] | File size limit exceeded (core dumped)

/tmp/wget.sh

wget http://212.183.159.230/20MB.zip -P /tmp/

adef

sandboxed: false
executables:
{
  main = (TestComponent)
}

processes:
{
  run:
  {
    (main)
  }
}

start: manual

cdef

sources: {
  main.c
}

main.c

#include "legato.h"
#include "interfaces.h"
#include <stdlib.h>

COMPONENT_INIT
{
  LE_INFO("Starting TestComponent");
  system("/tmp/wget.sh");
}

ls -lh output of tmp folder

root@swi-mdm9x28-wp:/tmp# ls -lh
-rw-------    1 root     root      100.0K Sep 20 11:14 20MB.zip
-rw-r--r--    1 root     root         237 Jan  6  1980 hosts
-rw-r--r--    1 root     root       13.2K Sep 20 06:52 ld.so.cache
-rw-r--r--    1 root     root          28 Jan  6  1980 ld.so.conf
drwx-----x    2 root     root         120 Sep 20 11:14 legato
drwxrwxrwx    2 root     root         120 Sep 20 06:52 legato_logs
drwx------    2 root     root          80 Jan  6  1980 pkgdwl
drw-r--r--    2 root     root          60 Jan  6  1980 psm_socket
-rw-r--r--    1 root     root          54 Sep 20 06:56 resolv.conf
srwx------    1 root     root           0 Sep 20 06:53 sock0
srwxr-xr-x    1 root     root           0 Jan  6  1980 thermal_engi_ipc
-rw-r--r--    1 root     root           0 Sep 20 11:17 tmpfdbtable.txt
-rwxr-xr-x    1 root     root          46 Sep 20 11:14 wget.sh

Can you use wp76 fw r13 and use the same script as mine?

Hi,

Updating my adef file to

sandboxed: false
executables:
{
  main = (TestComponent)
}

processes:
{
  run:
  {
    (main)
  }

  maxFileBytes: 103840K
}

start: manual

Appears to be working correctly, thank you. I’m none the wiser why its not working in my proper application, but this gives me a head start. Thanks