« Close

Datasheets and User Guides

Software & Driver

 

5.10 - gdb breaks with "signal SIG40, Real-time event 40."

LJM uses gRPC, which internally uses SIG40 to wake up threads. By default, gdb breaks when the process receives a signal. This causes gdb to output something like the following:

Thread 7 "eNames" received signal SIG40, Real-time event 40.
[Switching to Thread 0x7fffef7fe700 (LWP 90205)]
0x00007ffff7364627 in __GI_epoll_pwait (epfd=17, events=0x7fffef7fd600, maxevents=100, timeout=10000, set=0x7fffef7fe650)
    at ../sysdeps/unix/sysv/linux/epoll_pwait.c:42
42    ../sysdeps/unix/sysv/linux/epoll_pwait.c: No such file or directory.
(gdb)

This looks problematic, but it's actually fine. More info on gdb and signals can be found in section 5.4 Signals of the gdb documentation.

Solution: Suppress gdb's default break behavior for SIG40

To circumvent this, you can use the gdb command:

handle SIG40 noprint nostop

(Related gRPC issue: SIG36 while debugging with gdb #7906.)

Solution: Disable LJM_RPC_ENABLE

For another workaround, try setting the LJM library configuration LJM_RPC_ENABLE to 0 (false). Do this before calling any Open or ListAll calls. This can be done in the startup configs or by writing using WriteLibraryConfigS.

For example, in C:

    int error = LJM_WriteLibraryConfigS("LJM_RPC_ENABLE", 0);
    if (error != LJME_NOERROR) {
        // handle error
        printf("LJM_RPC_ENABLE fail\n");
    }

or, with LJM_Utilities.h:

    SetConfigValue("LJM_RPC_ENABLE", 0);