Cannot call any Legato services API from a legato thread


#1

Hi All

I’m getting stucked into a strange issue on legato 15.12.1.beta: I’ve created a simple helloworld application that in the main call the le_result_t le_pos_Get3DLocation(…).

It used to work but when I try to call the same api from a legato thread insteadm, the applciation exit with Code1.

If I remove the legato API le_pos_Get3DLocation and just keep the legato thread running (a simple loop with 5 second sleep and some logs) it works without any issue, so the legasto threads are ok, but when I try to call a legato api inside I got this (my_sms_loop is a print of the thread function):
Thank you in advacne for your help!

[pid 2844] writev(12, [{“DUH\1\1 \0\0”, 8}, {“5\37\0CECU1\0&\305YA\3SdkCmco\0”, 22}, {"\0\2\0\0\f\0my_sms_loop\0\0\2\0\0\r\0in the l"…, 45}], 3) = 75
[pid 2844] gettimeofday({1456768501, 914907}, NULL) = 0
[pid 2844] send(3, “<8>Feb 29 17:55:01 Legato: EMR”…, 180, MSG_NOSIGNAL) = 180
[pid 2844] clock_gettime(CLOCK_MONOTONIC, {254, 94884777}) = 0
[pid 2844] clock_gettime(CLOCK_MONOTONIC, {254, 96471836}) = 0
[pid 2844] writev(12, [{“DUH\1\3\0\0\0”, 8}, {“SdkC\27\v\0\0”, 8}], 2) = 16
[pid 2844] tgkill(2839, 2841, SIGRTMIN) = 0
[pid 2844] futex(0xb6a564b8, FUTEX_WAIT, 2841, NULL <unfinished …>
[pid 2841] <… read resumed> 0x408078, 10024) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 2841] — SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=2839, si_uid=0} —
[pid 2841] madvise(0xb6257000, 8364032, MADV_DONTNEED) = 0
[pid 2841] exit(0) = ?
[pid 2844] <… futex resumed> ) = 0
[pid 2844] tgkill(2839, 2842, SIGRTMIN) = 0
[pid 2844] futex(0xb62564b8, FUTEX_WAIT, 2842, NULL <unfinished …>
[pid 2842] <… futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 2842] — SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=2839, si_uid=0} —
[pid 2842] futex(0xb6c8292c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
[pid 2842] madvise(0xb5a57000, 8364032, MADV_DONTNEED) = 0
[pid 2842] exit(0) = ?
[pid 2844] <… futex resumed> ) = 0
[pid 2844] close(11) = 0
[pid 2844] unlink("/var/dltpipes/dlt2839") = 0
[pid 2844] close(12) = 0
[pid 2844] close(-1) = -1 EBADF (Bad file descriptor)
[pid 2844] close(-1) = -1 EBADF (Bad file descriptor)
[pid 2844] mq_unlink(“dlt_message_queue.2839”) = -1 ENOENT (No such file or directory)
[pid 2844] exit_group(1) = ?
[pid 2849] +++ exited with 1 +++
[pid 2848] +++ exited with 1 +++
[pid 2847] +++ exited with 1 +++
[pid 2843] +++ exited with 1 +++
[pid 2842] +++ exited with 1 +++
[pid 2841] +++ exited with 1 +++
[pid 2844] +++ exited with 1 +++


#2

Hi.

Can you post some code that will allow us to reproduce the issue?

Thanks.