|
|
|
|
while(fgets(line,100,jitter)
before, but I haven't tried the if(strstr(line,ntp))
so I'll try that. thanks!Then I think your while loop needs rewind whenever it thinks it gets to the end. |
at your normal user shell, nothing happens? |
I tried using a debugger and everything worked accordingly, it just "stopped." It hangs at random spots during each run (when I open my csv, itll freeze at random write parts). |
The fact that you need '|cat' to work-around some issue is suspicious.
Don't confuse apparent early success with being bug-free.
|
|
gdb man page wrote: |
---|
backtrace bt Print a backtrace of the entire stack: one line per frame for all frames in the stack. You can stop the backtrace at any time by typing the system interrupt charac- ter, normally Ctrl-c. backtrace n bt n Similar, but print only the innermost n frames. backtrace -n bt -n Similar, but print only the outermost n frames. backtrace full bt full bt full n bt full -n Print the values of the local variables also. n specifies the number of frames to print, as described above. The names where and info stack (abbreviated info s) are additional aliases for backtrace. In a multi-threaded program, gdb by default shows the backtrace only for the current thread. To display the backtrace for several or all of the threads, use the command thread apply . For example, if you type thread apply all backtrace, gdb will display the backtrace for all the threads; this is handy when you debug a core dump of a multi-threaded program. |
All that you've managed to show are the various levels of wrapper around 'sleep'. |
Doing a backtrace is a good idea, but what's this!? |
and since there's nothing in the code you've shown that would cause a call to sleep() |
|
|
|
|
#0 0x00007ffff5b4d85d in nanosleep () from /lib64/libc.so.6 #1 0x00007ffff5b4d6f4 in sleep () from /lib64/libc.so.6 #2 0x00007ffff6422eb9 in std::this_thread::__sleep_for(std::chrono::duration<long, std::ratio<1l, 1l> >, std::chrono::duration<long, std::ratio<1l, 1000000000l> >) () from /lib64/libstdc++.so.6 #3 0x0000000000404c5c in void std::this_thread::sleep_for<long, std::ratio<1l, 1000000000l> >(std::chrono::duration<long, std::ratio<1l, 1000000000l> > const&) () #4 0x0000000000404b92 in void std::this_thread::sleep_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) () #5 0x0000000000403ba9 in resync() () #6 0x00000000004040b5 in main () |
|
|
|
|
|
|
this_thread::sleep_until(nextTime);
, nextTime has already passed and sleep_until() doesn't account for that possibility.