Code hangs randomly after 1hr/1day/30 days - stack

I am using Altera Cyclone V FPGA with ARM 7 core,
I am running a application with 7 thread with mutexes.
The application randomly hangs after 1hr or 1 Day or 1 Month, no defined time.
I ran strace when the application is running smoothly and it gives:
---------------------------------------------------------------------------------------------------------
-------------------- RUNNING / HEALTHY STATE
---------------------------------------------------------------------------------------------------------
root#socfpga:~# strace -p 297 -f
Process 297 attached with 7 threads
[pid 311] recvfrom(6, <unfinished ...>
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 340] nanosleep({0, 500000000}, <unfinished ...>
......
[pid 339] <... nanosleep resumed> NULL) = 0
[pid 339] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
[pid 297] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 297] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 340] <... nanosleep resumed> NULL) = 0
[pid 340] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 339] <... nanosleep resumed> NULL) = 0
[pid 339] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
[pid 297] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 297] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 340] <... nanosleep resumed> NULL) = 0
[pid 340] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 339] <... nanosleep resumed> NULL) = 0
[pid 339] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
[pid 297] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 297] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 340] <... nanosleep resumed> NULL) = 0
[pid 340] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
.......
[pid 297] nanosleep({0, 10000000}, NULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
[pid 297] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 297] gettimeofday({1495402377, 473913}, NULL) = 0
[pid 297] write(3, "20170521 21:32:57.473 INFO d"..., 100) = 100
[pid 297] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 297] gettimeofday({1495402377, 474831}, NULL) = 0
[pid 297] write(3, "20170521 21:32:57.474 ERROR d"..., 110) = 110
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, <unfinished ...>
[pid 340] <... nanosleep resumed> NULL) = 0
[pid 340] nanosleep({0, 500000000}, <unfinished ...>
[pid 297] <... nanosleep resumed> NULL) = 0
[pid 297] nanosleep({0, 10000000}, NULL) = 0
[pid 297] nanosleep({0, 10000000}, ^CProcess 297 detached
<detached ...>
Process 309 detached
Process 310 detached
Process 311 detached
Process 312 detached
Process 339 detached
Process 340 detached
randomly the application hangs and the strace output is as follows:
---------------------------------------------------------------------------------------------------------
-------------------- HANG STATE
---------------------------------------------------------------------------------------------------------
root#socfpga:~# strace -p 297
Process 297 attached
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL^CProcess 297 detached
<detached ...>
root#socfpga:~# strace -p 297 -f
Process 297 attached with 7 threads
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 340] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 339] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 311] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 310] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 309] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 297] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 312] <... futex resumed> ) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid 312] --- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
[pid 312] rt_sigreturn() = -1 EINTR (Interrupted system call)
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL^CProcess 297 detached
Process 309 detached
Process 310 detached
Process 311 detached
Process 312 detached
<detached ...>
Process 339 detached
Process 340 detached
root#socfpga:~# strace -p 310
Process 310 attached
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL^CProcess 310 detached
<detached ...>
root#socfpga:~# strace -p 311
Process 311 attached
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL^CProcess 311 detached
<detached ...>
root#socfpga:~# strace -p 312
Process 312 attached
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL
) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL
) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
--- SIGRT_2 {si_signo=SIGRT_2, si_code=SI_TIMER, si_pid=0, si_uid=0, si_value=209660} ---
rt_sigreturn() = -1 EINTR (Interrupted system call)
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL^CProcess 312 detached
<detached ...>
root#socfpga:~# strace -p 339
Process 339 attached
futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL
^CProcess 339 detached
<detached ...>
Quit anyway? (y or n) y
Detaching from program: /home/user/user/process_cc, process 297
root#socfpga:~# gdb -p 309
GNU gdb (Linaro GDB) 7.8-2014.09
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-angstrom-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.linaro.org>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 309
warning: process 309 is a cloned process
Reading symbols from /home/user/user/process_cc...done.
Reading symbols from /usr/lib/liblog4c.so.3...done.
Loaded symbols for /usr/lib/liblog4c.so.3
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux-armhf.so.3
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
0x76f3ed50 in ?? () from /lib/libpthread.so.0
(gdb) bt
#0 0x76f3ed50 in ?? () from /lib/libpthread.so.0
#1 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit
A debugging session is active.
Inferior 1 [process 309] will be detached.
Quit anyway? (y or n) y
Detaching from program: /home/user/user/process_cc, process 309
root#socfpga:~# gdb -p 310
GNU gdb (Linaro GDB) 7.8-2014.09
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "arm-angstrom-linux-gnueabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://bugs.linaro.org>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 310
warning: process 310 is a cloned process
Reading symbols from /home/user/user/process_cc...done.
Reading symbols from /usr/lib/liblog4c.so.3...done.
Loaded symbols for /usr/lib/liblog4c.so.3
Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done.
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
Loaded symbols for /lib/libpthread.so.0
Reading symbols from /lib/libm.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libm.so.6
Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/librt.so.1
Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux-armhf.so.3...(no debugging symbols found)...done.
Loaded symbols for /lib/ld-linux-armhf.so.3
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
0x76f3ed50 in ?? () from /lib/libpthread.so.0
(gdb) bt
#0 0x76f3ed50 in ?? () from /lib/libpthread.so.0
#1 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb)
#0 0x76f3ed50 in ?? () from /lib/libpthread.so.0
#1 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) quit
A debugging session is active.
Inferior 1 [process 310] will be detached.
Quit anyway? (y or n) y
Detaching from program: /home/user/user/process_cc, process 310
Memory layout.
Start Addr End Addr Size Offset objfile
0x10000 0x23000 0x13000 0x0 /home/user/user/process_cc
0x33000 0x34000 0x1000 0x13000 /home/user/user/process_cc
0x34000 0x208000 0x1d4000 0x0
0x1eba000 0x1edb000 0x21000 0x0 [heap]
0x73800000 0x73801000 0x1000 0x0
0x73801000 0x74000000 0x7ff000 0x0 [stack:340]
0x74000000 0x74001000 0x1000 0x0
0x74001000 0x74800000 0x7ff000 0x0 [stack:339]
0x74800000 0x74821000 0x21000 0x0
0x74821000 0x74900000 0xdf000 0x0
0x74900000 0x74921000 0x21000 0x0
0x74921000 0x74a00000 0xdf000 0x0
0x74a00000 0x74a21000 0x21000 0x0
0x74a21000 0x74b00000 0xdf000 0x0
0x74b64000 0x74b65000 0x1000 0x0
0x74b65000 0x75364000 0x7ff000 0x0 [stack:312]
0x75364000 0x75365000 0x1000 0x0
0x75365000 0x75b64000 0x7ff000 0x0 [stack:311]
0x75b64000 0x75b65000 0x1000 0x0
0x75b65000 0x76364000 0x7ff000 0x0 [stack:310]
0x76364000 0x76365000 0x1000 0x0
0x76365000 0x76b64000 0x7ff000 0x0 [stack:309]
0x76b64000 0x76d64000 0x200000 0xff200000 /dev/mem
0x76d64000 0x76e89000 0x125000 0x0 /lib/libc-2.20.so
0x76e89000 0x76e99000 0x10000 0x125000 /lib/libc-2.20.so
0x76e99000 0x76e9b000 0x2000 0x125000 /lib/libc-2.20.so
0x76e9b000 0x76e9c000 0x1000 0x127000 /lib/libc-2.20.so
0x76e9c000 0x76e9f000 0x3000 0x0
0x76e9f000 0x76ea5000 0x6000 0x0 /lib/librt-2.20.so
0x76ea5000 0x76eb4000 0xf000 0x6000 /lib/librt-2.20.so
---Type <return> to continue, or q <return> to quit---
0x76eb4000 0x76eb5000 0x1000 0x5000 /lib/librt-2.20.so
0x76eb5000 0x76eb6000 0x1000 0x6000 /lib/librt-2.20.so
0x76eb6000 0x76f1f000 0x69000 0x0 /lib/libm-2.20.so
0x76f1f000 0x76f2e000 0xf000 0x69000 /lib/libm-2.20.so
0x76f2e000 0x76f2f000 0x1000 0x68000 /lib/libm-2.20.so
0x76f2f000 0x76f30000 0x1000 0x69000 /lib/libm-2.20.so
0x76f30000 0x76f44000 0x14000 0x0 /lib/libpthread-2.20.so
0x76f44000 0x76f54000 0x10000 0x14000 /lib/libpthread-2.20.so
0x76f54000 0x76f55000 0x1000 0x14000 /lib/libpthread-2.20.so
0x76f55000 0x76f56000 0x1000 0x15000 /lib/libpthread-2.20.so
0x76f56000 0x76f58000 0x2000 0x0
0x76f58000 0x76f6e000 0x16000 0x0 /usr/lib/liblog4c.so.3
0x76f6e000 0x76f75000 0x7000 0x16000 /usr/lib/liblog4c.so.3
0x76f75000 0x76f77000 0x2000 0x15000 /usr/lib/liblog4c.so.3
0x76f77000 0x76f96000 0x1f000 0x0 /lib/ld-2.20.so
0x76f99000 0x76f9b000 0x2000 0x0
0x76fa4000 0x76fa5000 0x1000 0x0
0x76fa5000 0x76fa6000 0x1000 0x0 [sigpage]
0x76fa6000 0x76fa7000 0x1000 0x1f000 /lib/ld-2.20.so
0x76fa7000 0x76fa8000 0x1000 0x20000 /lib/ld-2.20.so
0x7e9f4000 0x7ea1a000 0x26000 0x0 [stack]
0xffff0000 0xffff1000 0x1000 0x0 [vectors]
Please point out the reason for such behavior so that the issue can be resolved.

Based on the strace output, it looks like all 7 threads are waiting for the same mutex:
[pid 312] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 340] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 339] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 311] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 310] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 309] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
[pid 297] futex(0x1eba830, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
Attaching to the process (not a specific thread) with gdb and executing thread apply all bt would be a good start to identify which thread holds the mutex those threads are waiting for. If it is not obvious from the output, switch to one of the threads that are waiting (t <gdb-thread-id>), select the frame before the pthread_mutex_lock call (s <frame-id>; assuming pthread mutexes are used) and determine the owner by executing print <pthread_mutex_t-ptr>->__data.__owner. If gdb cannot resolve __data.__owner, you need to identify the owner via print *((int*)(<pthread_mutex_t-ptr>)+2). Search for the ID in the info threads output or in the initial command output to identify the owning thread and its stack trace (t <gdb-thread-id> and bt).
Be sure to create a core dump for later analysis by executing generate in gdb (can be reopened later with gdb <executable> <core-dump>).

Related

Apache2 Passenger not updating Ruby on Rails classes on restart

Forgive me as I am a bit new to this but I have inherited an Ruby On Rails web application that runs on Apache2 Passenger. I have tried to make a small change to the application which works succssefully on DEV so I have deployed to our PROD environment. However after deploying and restarting Apache2 none of my changes are taking effect. If I change the
config.cache_classes = true
Setting in the config/environments/production.rb to false then all is fine, however everything I read is that should only be set to false in dev.
This leads me to believe that the cache is not being refreshed once Apache2 is started. Any ideas on what this could be? I don't see any errors in the Apache2 error log (debug level set), below is a snippet from a restart.
[Tue Sep 27 09:30:09.840437 2022] [mpm_event:notice] [pid 6259:tid 139952997727168] AH00491: caught SIGTERM, shutting down
[ N 2022-09-27 09:30:09.8404 6264/T8 age/Cor/CoreMain.cpp:614 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2022-09-27 09:30:09.8405 6264/T1 age/Cor/CoreMain.cpp:1112 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2022-09-27 09:30:09.8406 6264/T1 age/Cor/CoreMain.cpp:1026 ]: Checking whether to disconnect long-running connections for process 6492, application /var/www/fpsmidas (production)
[ N 2022-09-27 09:30:09.8408 6264/T8 Ser/Server.h:903 ]: [ServerThr.1] Freed 0 spare client objects
[ N 2022-09-27 09:30:09.8409 6264/T8 Ser/Server.h:559 ]: [ServerThr.1] Shutdown finished
[ N 2022-09-27 09:30:09.8421 6264/Td Ser/Server.h:903 ]: [ServerThr.4] Freed 0 spare client objects
[ N 2022-09-27 09:30:09.8421 6264/Td Ser/Server.h:559 ]: [ServerThr.4] Shutdown finished
[ N 2022-09-27 09:30:09.8422 6264/Ta Ser/Server.h:903 ]: [ServerThr.2] Freed 0 spare client objects
[ N 2022-09-27 09:30:09.8422 6264/Tc Ser/Server.h:903 ]: [ServerThr.3] Freed 0 spare client objects
[ N 2022-09-27 09:30:09.8422 6264/Ta Ser/Server.h:559 ]: [ServerThr.2] Shutdown finished
[ N 2022-09-27 09:30:09.8422 6264/Tc Ser/Server.h:559 ]: [ServerThr.3] Shutdown finished
[ N 2022-09-27 09:30:09.8436 6264/Tf Ser/Server.h:903 ]: [ApiServer] Freed 0 spare client objects
[ N 2022-09-27 09:30:09.8436 6264/Tf Ser/Server.h:559 ]: [ApiServer] Shutdown finished
[ N 2022-09-27 09:30:09.8437 6264/T1 age/Cor/CoreMain.cpp:1026 ]: Checking whether to disconnect long-running connections for process 6492, application /var/www/fpsmidas (production)
[ N 2022-09-27 09:30:09.8586 6264/T8 age/Cor/CoreMain.cpp:614 ]: Signal received. Gracefully shutting down... (send signal 1 more time(s) to force shutdown)
[Tue Sep 27 09:30:09.859619 2022] [core:trace4] [pid 6259] mpm_common.c(429): end of generation 0
[ N 2022-09-27 09:30:10.0068 6264/T1 age/Cor/CoreMain.cpp:1185 ]: Passenger core shutdown finished
[ N 2022-09-27 09:30:10.0867 11570/T1 age/Wat/WatchdogMain.cpp:1297 ]: Starting Passenger watchdog...
[ N 2022-09-27 09:30:10.1067 11574/T1 age/Cor/CoreMain.cpp:1200 ]: Starting Passenger core...
[ N 2022-09-27 09:30:10.1068 11574/T1 age/Cor/CoreMain.cpp:250 ]: Passenger core running in multi-application mode.
[ W 2022-09-27 09:30:10.1142 11574/T1 age/Cor/CoreMain.cpp:927 ]: WARNING: potential privilege escalation vulnerability detected. Phusion Passenger is running as root, and part(s) of the Passenger root path (/opt/passenger-5.3.4) can be changed by non-root user(s):
- /opt/passenger-5.3.4 is not secure: it can be modified by group root
Please either fix up the permissions for the insecure paths, or install Passenger in a different location that can only be modified by root.
[ N 2022-09-27 09:30:10.1142 11574/T1 age/Cor/CoreMain.cpp:935 ]: Passenger core online, PID 11574
[Tue Sep 27 09:30:10.115046 2022] [ssl:trace2] [pid 11556:tid 140281045076928] ssl_engine_rand.c(126): Init: Seeding PRNG with 656 bytes of entropy
[Tue Sep 27 09:30:10.115077 2022] [ssl:info] [pid 11556:tid 140281045076928] AH01887: Init: Initializing (virtual) servers for SSL
[Tue Sep 27 09:30:10.121210 2022] [ssl:info] [pid 11556:tid 140281045076928] AH01876: mod_ssl/2.4.29 compiled against Server: Apache/2.4.29, Library: OpenSSL/1.1.1
[ N 2022-09-27 09:30:10.1332 11574/T7 age/Cor/CoreMain.cpp:614 ]: Signal received. Gracefully shutting down... (send signal 2 more time(s) to force shutdown)
[ N 2022-09-27 09:30:10.1332 11574/T1 age/Cor/CoreMain.cpp:1112 ]: Received command to shutdown gracefully. Waiting until all clients have disconnected...
[ N 2022-09-27 09:30:10.1333 11574/T9 Ser/Server.h:903 ]: [ServerThr.2] Freed 0 spare client objects
[ N 2022-09-27 09:30:10.1333 11574/T9 Ser/Server.h:559 ]: [ServerThr.2] Shutdown finished
[ N 2022-09-27 09:30:10.1333 11574/T7 Ser/Server.h:903 ]: [ServerThr.1] Freed 0 spare client objects
[ N 2022-09-27 09:30:10.1333 11574/T7 Ser/Server.h:559 ]: [ServerThr.1] Shutdown finished
[ N 2022-09-27 09:30:10.1334 11574/Tf Ser/Server.h:903 ]: [ApiServer] Freed 0 spare client objects
[ N 2022-09-27 09:30:10.1334 11574/Tf Ser/Server.h:559 ]: [ApiServer] Shutdown finished
[ N 2022-09-27 09:30:10.1334 11574/Tb Ser/Server.h:903 ]: [ServerThr.3] Freed 0 spare client objects
[ N 2022-09-27 09:30:10.1334 11574/Tb Ser/Server.h:559 ]: [ServerThr.3] Shutdown finished
[ N 2022-09-27 09:30:10.1334 11574/Td Ser/Server.h:903 ]: [ServerThr.4] Freed 0 spare client objects
[ N 2022-09-27 09:30:10.1335 11574/Td Ser/Server.h:559 ]: [ServerThr.4] Shutdown finished
[ N 2022-09-27 09:30:10.1640 11599/T1 age/Wat/WatchdogMain.cpp:1297 ]: Starting Passenger watchdog...
[ N 2022-09-27 09:30:10.1807 11602/T1 age/Cor/CoreMain.cpp:1200 ]: Starting Passenger core...
[ N 2022-09-27 09:30:10.1808 11602/T1 age/Cor/CoreMain.cpp:250 ]: Passenger core running in multi-application mode.
[ W 2022-09-27 09:30:10.1883 11602/T1 age/Cor/CoreMain.cpp:927 ]: WARNING: potential privilege escalation vulnerability detected. Phusion Passenger is running as root, and part(s) of the Passenger root path (/opt/passenger-5.3.4) can be changed by non-root user(s):
- /opt/passenger-5.3.4 is not secure: it can be modified by group root
Please either fix up the permissions for the insecure paths, or install Passenger in a different location that can only be modified by root.
[ N 2022-09-27 09:30:10.1883 11602/T1 age/Cor/CoreMain.cpp:935 ]: Passenger core online, PID 11602
[Tue Sep 27 09:30:10.189036 2022] [ssl:trace2] [pid 11597:tid 140281045076928] ssl_engine_rand.c(126): Init: Seeding PRNG with 656 bytes of entropy
[Tue Sep 27 09:30:10.189153 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(401): AH00821: shmcb_init allocated 512000 bytes of shared memory
[Tue Sep 27 09:30:10.189161 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(417): AH00822: for 511912 bytes (512000 including header), recommending 32 subcaches, 88 indexes each
[Tue Sep 27 09:30:10.189165 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(450): AH00824: shmcb_init_memory choices follow
[Tue Sep 27 09:30:10.189167 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(452): AH00825: subcache_num = 32
[Tue Sep 27 09:30:10.189170 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(454): AH00826: subcache_size = 15992
[Tue Sep 27 09:30:10.189173 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(456): AH00827: subcache_data_offset = 2128
[Tue Sep 27 09:30:10.189175 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(458): AH00828: subcache_data_size = 13864
[Tue Sep 27 09:30:10.189178 2022] [socache_shmcb:debug] [pid 11597:tid 140281045076928] mod_socache_shmcb.c(460): AH00829: index_num = 88
[Tue Sep 27 09:30:10.189256 2022] [socache_shmcb:info] [pid 11597:tid 140281045076928] AH00830: Shared memory socache initialised
[Tue Sep 27 09:30:10.189261 2022] [ssl:info] [pid 11597:tid 140281045076928] AH01887: Init: Initializing (virtual) servers for SSL
[Tue Sep 27 09:30:10.191097 2022] [ssl:info] [pid 11597:tid 140281045076928] AH01876: mod_ssl/2.4.29 compiled against Server: Apache/2.4.29, Library: OpenSSL/1.1.1
[Tue Sep 27 09:30:10.191123 2022] [watchdog:debug] [pid 11597:tid 140281045076928] mod_watchdog.c(454): AH010033: Watchdog: Running with WatchdogInterval 1000ms
[Tue Sep 27 09:30:10.191128 2022] [watchdog:debug] [pid 11597:tid 140281045076928] mod_watchdog.c(462): AH02974: Watchdog: found parent providers.
[Tue Sep 27 09:30:10.191132 2022] [watchdog:debug] [pid 11597:tid 140281045076928] mod_watchdog.c(508): AH02977: Watchdog: found child providers.
[Tue Sep 27 09:30:10.191135 2022] [watchdog:debug] [pid 11597:tid 140281045076928] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_singleton_).
[Tue Sep 27 09:30:10.191139 2022] [watchdog:debug] [pid 11597:tid 140281045076928] mod_watchdog.c(516): AH02978: Watchdog: Looking for child (_default_).
[Tue Sep 27 09:30:10.191655 2022] [core:trace4] [pid 11597:tid 140281045076928] mpm_common.c(533): mpm child 11623 (gen 0/slot 0) started
[Tue Sep 27 09:30:10.191949 2022] [core:trace4] [pid 11597:tid 140281045076928] mpm_common.c(533): mpm child 11624 (gen 0/slot 1) started
[Tue Sep 27 09:30:10.191968 2022] [mpm_event:notice] [pid 11597:tid 140281045076928] AH00489: Apache/2.4.29 (Ubuntu) Phusion_Passenger/5.3.4 OpenSSL/1.1.1 configured -- resuming normal operations
[Tue Sep 27 09:30:10.191973 2022] [mpm_event:info] [pid 11597:tid 140281045076928] AH00490: Server built: 2020-08-12T21:33:25
[Tue Sep 27 09:30:10.191982 2022] [core:notice] [pid 11597:tid 140281045076928] AH00094: Command line: '/usr/sbin/apache2'
[Tue Sep 27 09:30:10.191986 2022] [core:debug] [pid 11597:tid 140281045076928] log.c(1570): AH02639: Using SO_REUSEPORT: yes (1)
[Tue Sep 27 09:30:10.192288 2022] [watchdog:debug] [pid 11623:tid 140281045076928] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Tue Sep 27 09:30:10.192397 2022] [proxy:debug] [pid 11623:tid 140281045076928] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Tue Sep 27 09:30:10.192412 2022] [proxy:debug] [pid 11623:tid 140281045076928] proxy_util.c(1842): AH00927: initializing worker proxy:reverse local
[Tue Sep 27 09:30:10.192442 2022] [proxy:debug] [pid 11623:tid 140281045076928] proxy_util.c(1877): AH00930: initialized pool in child 11623 for (*) min=0 max=25 smax=25
[Tue Sep 27 09:30:10.192550 2022] [mpm_event:debug] [pid 11623:tid 140280930666240] event.c(2218): AH02471: start_threads: Using epoll (wakeable)
[Tue Sep 27 09:30:10.193150 2022] [watchdog:debug] [pid 11624:tid 140281045076928] mod_watchdog.c(565): AH02980: Watchdog: nothing configured?
[Tue Sep 27 09:30:10.193477 2022] [proxy:debug] [pid 11624:tid 140281045076928] proxy_util.c(1785): AH00925: initializing worker proxy:reverse shared
[Tue Sep 27 09:30:10.193491 2022] [proxy:debug] [pid 11624:tid 140281045076928] proxy_util.c(1842): AH00927: initializing worker proxy:reverse local
[Tue Sep 27 09:30:10.193512 2022] [proxy:debug] [pid 11624:tid 140281045076928] proxy_util.c(1877): AH00930: initialized pool in child 11624 for (*) min=0 max=25 smax=25
[Tue Sep 27 09:30:10.193616 2022] [mpm_event:debug] [pid 11624:tid 140280930666240] event.c(2218): AH02471: start_threads: Using epoll (wakeable)
[ N 2022-09-27 09:30:10.1964 11574/T1 age/Cor/CoreMain.cpp:1185 ]: Passenger core shutdown finished
[ E 2022-09-27 09:30:12.5618 11602/T5 age/Cor/SecurityUpdateChecker.h:505 ]: Security update check failed: SSL connect error while connecting to https://securitycheck.phusionpassenger.com/v1/check.json (if this error persists check your connection security or try upgrading Passenger) (next check in 24 hours)
Any thoughts would be greatly appreciated.
I managed to figure out the problem, when deploying my coding changes I backed up the original file in the same directory just appending a date to it, for example my personnel_controller.rb was renamed to personnel_controller_20220926.rb and the modified personnel_controller.rb from dev was moved over. For whatever reason Rails (or maybe Apache) was still interrupting the old file rather then the new one. Once I moved the old file to a new location outside of the applicaitons directory and restarted Apache all worked fine. I am still new to Ruby on Rails in general so if anyone has an explanation as to why this is I would be curious to know.

Play a SDP file with VLC?

Goal
Confirming that VLC can play a stream from a locally given SDP file.
This appears to be possible based on testimonies:
Playing RTP using VLC - Stack Overflow
How to send SDP over RTP - Stack Overflow
Experiment
So I looked for a publicly available case and found Mobile Streaming, RTSP/RTP, Wowza Streaming Engine | Wowza Media Systems.
This works, plays color video with sound:
vlc rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov
I managed to extract SDP file using trick from networking - How can I capture network traffic of a single process? - Ask Ubuntu
strace -f -e trace=network -s 10000 mplayer rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov 2>&1 | grep a=
... then reformatted the file and saved to bbb.sdp
File looks like (actual line don't start with whitespace, and finish with Windows-style line ending):
o=- 785981631 785981631 IN IP4 184.72.239.149
s=BigBuckBunny_115k.mov
c=IN IP4 184.72.239.149
t=0 0
a=sdplang:en
a=range:npt=0- 596.48
a=control:*
m=audio 0 RTP/AVP 96
a=rtpmap:96 mpeg4-generic/12000/2
a=fmtp:96 profile-level-id=1;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1490
a=control:trackID=1
m=video 0 RTP/AVP 97
a=rtpmap:97 H264/90000
a=fmtp:97 packetization-mode=1;profile-level-id=42C01E;sprop-parameter-sets=Z0LAHtkDxWhAAAADAEAAAAwDxYuS,aMuMsg==
a=cliprect:0,0,160,240
a=framesize:97 240-160
a=framerate:24.0
a=control:trackID=2
Then:
vlc bbb.sdp
shows an entry in playlist with correct duration (09:56, the information is in the SDP) but no video appears.
Trace network calls
VLC media player 2.1.6 Rincewind (revision 2.1.6-0-gea01d28)
Process 15739 attached
[0xf19118] [http] lua interface: Lua HTTP interface
Process 15740 attached
[pid 15739] bind(7, {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 0
[pid 15739] bind(7, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
[0xf19118] [http] main interface error: socket bind error (Permission denied)
[pid 15739] bind(7, {sa_family=AF_INET6, sin6_port=htons(8080), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, 28) = -1 EADDRINUSE (Address already in use)
[0xf19118] [http] main interface error: socket bind error (Permission denied)
[0xf19118] [http] main interface error: cannot create socket(s) for HTTP host
[0xf19118] [http] lua interface error: Error loading script /usr/lib/vlc/lua/intf/http.luac: lua/intf/http.lua:328: Failed to create HTTP host
[pid 15739] +++ exited with 0 +++
Process 15741 attached
Process 15742 attached
Process 15743 attached
Process 15744 attached
[0xf3f9a8] dummy interface: using the dummy interface module...
Process 15745 attached
[pid 15745] bind(16, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(17, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EADDRINUSE (Address already in use)
[pid 15745] bind(14, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(16, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(18, {sa_family=AF_INET, sin_port=htons(49463), sin_addr=inet_addr("0.0.0.0")}, 16Unable to determine our source address: ) = 0
This computer has an invalid IP address: 0.0.0.0
[pid 15745] bind(17, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16 <unfinished ...>
[pid 15743] bind(15, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16 <unfinished ...>
[pid 15745] <... bind resumed> ) = 0
[pid 15743] <... bind resumed> ) = 0
[pid 15743] bind(19, {sa_family=AF_INET, sin_port=htons(55667), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(20, {sa_family=AF_INET, sin_port=htons(15947), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(17, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15743] bind(20, {sa_family=AF_INET, sin_port=htons(45441), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(14, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
[pid 15745] bind(22, {sa_family=AF_INET, sin_port=htons(55005), sin_addr=inet_addr("0.0.0.0")}, 16) = 0
Process 15746 attached
[pid 15743] +++ exited with 0 +++
Process 15747 attached
Process 15748 attached
Process 15749 attached
Process 15750 attached
Process 15751 attached
[0x7f2f80c01838] live555 demux error: no data received in 10s, aborting
[pid 15746] --- SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=15738, si_uid=1000} ---
[pid 15746] +++ exited with 0 +++
[pid 15751] --- SIGRTMIN {si_signo=SIGRTMIN, si_code=SI_TKILL, si_pid=15738, si_uid=1000} ---
[pid 15751] +++ exited with 0 +++
[pid 15747] +++ exited with 0 +++
[pid 15748] +++ exited with 0 +++
[pid 15749] +++ exited with 0 +++
[pid 15750] +++ exited with 0 +++
[pid 15745] +++ exited with 0 +++
It appears that VLC does not even try to connect to IP 184.72.239.149 .
I'm clueless. Is this a bug?
Questions
Why would playing directly from RTSP URL work, and not playing a locally saved SDP file?
What to do?
When you receive the SDP from the server during a RTSP request, it is customized by the server to tell you where it's going to send the stream it's starting. Without the RTSP control channel to tell the server you want an RTP stream, it will not stream out.
Direct SDP playback is useful essentially only if you have a broadcast/multicast RTP stream, or a continuous "push" RTP stream, not if you have a VOD stream that would otherwise be issued by RTSP.

CKAN Dataset Upload Page giving a Server

When creating a dataset you are required to either upload the csv or xml file containing the data or link to the data file located on a server. When I attempt to upload a csv or xml file the upload process starts but the page eventually crash with the following message.
Server Error
An internal server error occurred
also see below error in /var/log/apache2/ckan_default.error.log
[Mon Aug 10 19:08:18.934269 2015] [:error] [pid 1243] 2015-08-10 19:08:18,934 INFO [ckan.lib.base] / render time 0.169 seconds
[Mon Aug 10 19:08:21.217534 2015] [:error] [pid 1243] 2015-08-10 19:08:21,217 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:23.832089 2015] [:error] [pid 1244] 2015-08-10 19:08:23,831 INFO [ckan.lib.base] /user/admin render time 0.413 seconds
[Mon Aug 10 19:08:24.430716 2015] [:error] [pid 1243] 2015-08-10 19:08:24,430 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:26.858892 2015] [:error] [pid 1243] 2015-08-10 19:08:26,858 WARNI [ckan.lib.maintain] Function get_action() in module ckan.lib.helpers has been deprecated and will be removed in a later release of ckan. helpers.get_action() is deprecated and will be removed in a future version of CKAN. Instead, please use the extra_vars param to render() in your controller to pass results from action functions to your templates.
[Mon Aug 10 19:08:27.080089 2015] [:error] [pid 1243] 2015-08-10 19:08:27,079 WARNI [ckan.lib.maintain] Function get_action() in module ckan.lib.helpers has been deprecated and will be removed in a later release of ckan. helpers.get_action() is deprecated and will be removed in a future version of CKAN. Instead, please use the extra_vars param to render() in your controller to pass results from action functions to your templates.
[Mon Aug 10 19:08:27.190495 2015] [:error] [pid 1243] 2015-08-10 19:08:27,190 INFO [ckan.lib.base] /dataset/grocery-prices render time 0.551 seconds
[Mon Aug 10 19:08:27.664450 2015] [:error] [pid 1244] 2015-08-10 19:08:27,664 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:30.847326 2015] [:error] [pid 1243] 2015-08-10 19:08:30,847 INFO [ckan.lib.base] /dataset/edit/grocery-prices render time 0.405 seconds
[Mon Aug 10 19:08:31.373743 2015] [:error] [pid 1244] 2015-08-10 19:08:31,373 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:34.934102 2015] [:error] [pid 1243] 2015-08-10 19:08:34,933 INFO [ckan.lib.base] /dataset/new render time 0.091 seconds
[Mon Aug 10 19:08:35.451324 2015] [:error] [pid 1244] 2015-08-10 19:08:35,451 INFO [ckan.lib.base] /dataset/new_resource/grocery-prices render time 0.412 seconds
[Mon Aug 10 19:08:36.271926 2015] [:error] [pid 1244] 2015-08-10 19:08:36,271 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
[Mon Aug 10 19:08:49.310932 2015] [:error] [pid 1244] 2015-08-10 19:08:49,310 INFO [ckan.lib.base] /api/2/util/resource/format_autocomplete render time 0.006 seconds
[Mon Aug 10 19:09:11.244287 2015] [:error] [pid 1243] /usr/lib/ckan/default/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
[Mon Aug 10 19:09:11.244325 2015] [:error] [pid 1243] sess._flush_warning("related attribute set")
[Mon Aug 10 19:09:11.518274 2015] [:error] [pid 1243] 2015-08-10 19:09:11,518 INFO [ckan.lib.base] /dataset/new_resource/grocery-prices render time 0.176 seconds
[Mon Aug 10 19:09:11.975593 2015] [:error] [pid 1244] 2015-08-10 19:09:11,975 INFO [ckan.lib.base] /api/i18n/en render time 0.002 seconds
Not sure what caused this error and the logs do not provide enough information. The file is not deposited to the dataset directory location.
Using CKAN 2.3 on a Ubuntu 14.04 server running apache2

Thinking-Sphinx & Rails - Content not indexed anymore

I have a Rails application that indexes classifeds ads. I'm using thinking-sphinx.
Yesterday, I realized that my ads are not getting indexed anymore. I'm a beginner in Rails so I don't know exactly what is happening here...
We can see the issue in searchd.query.log file :
[Sun May 19 22:19:46.432 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Sun May 19 22:19:46.446 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Sun May 19 22:19:46.455 2013] 0.000 sec [all/4/ext **21** (0,1000000000)] [ad_core]
[Sun May 19 22:19:46.590 2013] 0.000 sec [all/5/ext 0 (0,25)] [ad_core]
[Mon May 20 01:21:50.385 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 01:21:50.400 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 01:21:50.409 2013] 0.000 sec [all/4/ext **21** (0,1000000000)] [ad_core]
[Mon May 20 01:21:50.633 2013] 0.000 sec [all/5/ext 0 (0,25)] [ad_core]
[Mon May 20 02:13:12.492 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:12.508 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:12.521 2013] 0.000 sec [all/4/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:12.780 2013] 0.000 sec [all/5/ext 0 (0,25)] [ad_core]
[Mon May 20 02:13:21.341 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:21.453 2013] 0.000 sec [all/5/ext 0 (0,25)] [ad_core]
[Mon May 20 02:13:36.183 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:36.197 2013] 0.000 sec [all/5/ext 0 (0,1000000000)] [ad_core]
[Mon May 20 02:13:36.206 2013] 0.000 sec [all/4/ext 0 (0,1000000000)] [ad_core]
After 2AM, the 21 ads are not taken into account anymore ...
Could you please advice on how to track the problem ?
Is there any simple solution to maybe initialize the indexation ?
please find please what command "rake ts:index" returns me :
Generating Configuration to /home/kar/www/myapp/releases/20130520063222/config/development.sphinx.conf
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)
using config file '/home/kar/www/myapp/releases/20130520063222/config/**development**.sphinx.conf'...
indexing index 'ad_core'...
WARNING: collect_hits: mem_limit=0 kb too low, increasing to 17152 kb
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.012 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'ad'...
total 1 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 5 writes, 0.000 sec, 0.1 kb/call avg, 0.0 msec/call avg
rotating indices: succesfully sent SIGHUP to searchd (pid=13500).
I think I have several problems here, the first one is that I'm taking development index file instead of production... I have to review my deployment procedure...

ant-contrib stopped being recognized

Ant is no more able to find ant contribs and I am puzzled since I did not remember changing anything on the machine.
$ ant -f ./build-ivy.xml
Buildfile: ./build-ivy.xml
[taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xml. It could not be found.
BUILD FAILED
/var/lib/jenkins/jobs/Lakshmi-MySQL/workspace/build-ivy.xml:41: Problem: failed to create task or type antlib:org.apache.ivy.ant:settings
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
This appears to be an antlib declaration.
Action: Check that the implementing library exists in one of:
-/usr/share/ant/lib
-/var/lib/jenkins/.ant/lib
-a directory added on the command line with the -lib argument
Now the ant-contrib jar file is (as before) in /var/lib/jenkins/.ant/lib and is readable by the user
$ ls -l /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar
-rw-r--r-- 1 jenkins root 224277 Jun 29 09:24 /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar
$ jar tf /var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar | head -n 3
META-INF/
META-INF/MANIFEST.MF
net/
Edit
checking with strace: ant is reading the file:
...
[pid 10400] stat("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] stat("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] open("/var/lib/jenkins/.ant/lib/ant-contrib-1.0b3.jar", O_RDONLY) = 15
[pid 10400] fstat(15, {st_mode=S_IFREG|0644, st_size=224277, ...}) = 0
[pid 10400] fcntl(15, F_GETFD) = 0
[pid 10400] fcntl(15, F_SETFD, FD_CLOEXEC) = 0
[pid 10400] lseek(15, 0, SEEK_END) = 224277
[pid 10400] lseek(15, 224149, SEEK_SET) = 224149
[pid 10400] read(15, "ls/Walls.classPK\1\2\24\3\n\0\0\0\10\0\323]b5\362j"..., 128) = 128
[pid 10400] mmap(NULL, 19477, PROT_READ, MAP_SHARED, 15, 0x32000) = 0x7fb234002000
[pid 10400] lseek(15, 43, SEEK_SET) = 43
[pid 10400] read(15, "PK\3\4\n\0\0\0\10\0\322]b5\214\246\227\251\206\0\0\0\240\0\0\0\24\0\0\0", 30) = 30
[pid 10400] lseek(15, 93, SEEK_SET) = 93
[pid 10400] read(15, "M\215\261\16\203 \24Ew\22\376\341\215\355\0>\264\222\224M;upj\323\265A\304\224\244\240\1"..., 134) = 134
...
ANT_HOME was not set this caused the ant script in an ant 1.8.4 installation to execute the default ant 1.7.1 binary (which does not work with ant-contrib)
After setting ANT_HOME to the ant 1.8.4 installation everything worked as expected.

Resources