Hi again @kdunwoody @CoRfr .
I think I’ve stumbled upon another IDL file
issue, but this time relating to file fd IN
?
I migrated to Legato 17.09.0 from 16.10.3 about a day ago and manually implemented the ifgen fix (issue 19) for file fd OUT
as per the previous posts.
Legato: 17.09.0_cf35276670208f4a6ce776bcd22775de_modified
Firmware: SWI9X15Y_07.12.09.00 r34123 CARMD-EV-FRMWR1 2017/04/26 23:34:19
Bootloader: SWI9X15Y_07.12.09.00 r34123 CARMD-EV-FRMWR1 2017/04/26 23:34:19
PRI PN: 9905383
PRI Rev: 01.07
Carrier PRI Name: GENERIC
Carrier PRI Rev: 001.033_000
SKU: 1102816
MCU Version: 001.003
LAST RESET REASON: Unknown
RESETS COUNT: Expected: 0 Unexpected: 0
I built my own .sdef using mksys
after running bin/legs
in the legato dir downloaded from GitHub - legatoproject/legato-af at 17.09.0.
I did try building the system in Dev Studio 5.3 after adding 17.09.0 as a custom package but the system crashed after applying the update (possibly a toolchain related problem?).
Anyway, the test I was running basically consists of performing these operations every 5 minutes:
- Connect to a webserver (HTTPS using libcurl) and sync system time
- Read sensor data from an external serial device.
- Store data on SD card
- Connect to FTP server and upload file (with libcurl)
My test app ran fine for roughly 20 hours until I observed some odd behavior. It’s running unsandboxed
.
Oct 25 06:26:26 | myService[22052]/framework T=main | my_web_client.c my_web_FtpUploadFile() 958 | Sending message to server and waiting for response : 23 bytes sent
Oct 25 06:26:26 | myService[22052]/framework T=main | LE_FILENAME unixSocket_SendMsg() 441 | Sending fd 19.
Oct 25 06:26:26 | myWeb[22051]/framework T=main | LE_FILENAME unixSocket_ReceiveMsg() 669 | Ancillary data was discarded because it couldn't fit in our buffer
...
Oct 25 06:26:26 | myWeb[22051]/myWebServiceComponent T=main | myWebService.c FtpUploadFile() 1026 | Couldn't open file: Bad file descriptor
...
I noted several FTP Timeouts logged for a couple of hours leading up to this which would have resulted in the file size growing by ~49 bytes each time. Could this be a file size restriction imposed in a later version of Legato?
Note that I’ve set maxFileBytes: 8192K
and have been able to upload a file several MB in size without issue before.
This is what the log usually looks like when it’s working.
Oct 25 23:21:29 | myService[5051]/framework T=main | my_web_client.c my_web_FtpUploadFile() 958 | Sending message to server and waiting for response : 23 bytes sent
Oct 25 23:21:29 | myService[5051]/framework T=main | LE_FILENAME unixSocket_SendMsg() 441 | Sending fd 19.
Oct 25 23:21:29 | myWeb[5050]/framework T=main | LE_FILENAME ExtractFileDescriptor() 34 | Received fd (209).
...
Oct 25 23:21:29 | myWeb[5050]/myWebServiceComponent T=main | myWebService.c FtpUploadFile() 1030 | Local file size: 49 bytes.
...
The function signature looks like this:
le_result_t my_web_FtpUploadFile(const char* filename, int fd);
DEFINE MAX_STR_LEN = 512;
FUNCTION le_result_t FtpUploadFile
(
string filename [MAX_STR_LEN] IN,
file fd IN
);
Additionaly, issues with the HTTPS queries started to fail and logged this on libcurl’s verbose output:
error reading ca cert file /etc/ssl/certs/ca-certificates.crt (Error while reading file.)
And the error message was: curl_easy_perform() failed: Problem with the SSL CA cert (path? access rights?)
I’m unsure if these are related to each other but they appear to be caused by file reading issues. In any case, they never appeared in 16.10.3 after months of running continuously and uninterrupted.
Nothing has changed in the .cdef’s or .adef’s. They include all the files and libs needed as per the httpGet
sample code. Do I need to add anything else or explicitely give access to certain dirs since moving from Legato 16.10.3?
Note that restarting the app resolves both issues (temporarily) until it falls over again some 10’s of hours later.
Any help would be much appreciated. Thanks.
Raf