Re: SIGUSR1 in clock_nanosleep()? how to isolate this issue?

2020-08-21 Thread Sebastiaan Koppe via Digitalmars-d-learn

On Thursday, 20 August 2020 at 18:58:43 UTC, mw wrote:

Hi,

I run into an issue: it's SIGUSR1 in clock_nanosleep()

[...]

Anyone has some suggestions on how to isolate this issue?

Thanks.


Try "handle SIGUSR1 nostop noprint" and "handle SIGUSR2 nostop 
noprint" in gdb.


Re: SIGUSR1 in clock_nanosleep()? how to isolate this issue?

2020-08-20 Thread Steven Schveighoffer via Digitalmars-d-learn

On 8/20/20 2:58 PM, mw wrote:

Hi,

I run into an issue: it's SIGUSR1 in clock_nanosleep()


The GC uses SIGUSR1 (and SIGUSR2). Maybe that's the issue?

https://github.com/dlang/druntime/blob/e1fb19829ebef0419782de43ce4b0e2a1ba140be/src/core/thread/osthread.d#L1946

-Steve


SIGUSR1 in clock_nanosleep()? how to isolate this issue?

2020-08-20 Thread mw via Digitalmars-d-learn

Hi,

I run into an issue: it's SIGUSR1 in clock_nanosleep()

---
...
[New Thread 0x70ae0700 (LWP 36860)]
[New Thread 0x7fffcbfff700 (LWP 36861)]
[Detaching after fork from child process 36862]
[New Thread 0x7fffd2eff700 (LWP 36863)]
[New Thread 0x7fffd26fe700 (LWP 36864)]
[New Thread 0x7fffd1efd700 (LWP 36865)]
[New Thread 0x7fffd16fc700 (LWP 36866)]

Thread 10 "lt" received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x70ae0700 (LWP 36860)]
0x75d99361 in clock_nanosleep () from 
/usr/lib/x86_64-linux-gnu/libc.so.6

(gdb) where
#0  0x75d99361 in clock_nanosleep () from 
/usr/lib/x86_64-linux-gnu/libc.so.6
#1  0x75d9eeb7 in nanosleep () from 
/usr/lib/x86_64-linux-gnu/libc.so.6
#2  0x5585cb89 in 
_D4core6thread8osthread6Thread5sleepFNbNiSQBo4time8DurationZv ()
#3  0x555d42b2 in checktatus() (this=0x71262170) 
at ttt.d:1368

#4  0x55612ee5 in xxxThread() () at aaa.d:88
#5  0x555d736f in 
_D3std11concurrency__T6_spawnTPFZvZQnFbQjZ4execMFZv ()
at 
.../ldc2-1.23.0-linux-x86_64/bin/../import/std/concurrency.d:556

#6  0x5585c32a in thread_entryPoint ()
#7  0x76020609 in start_thread (arg=) at 
pthread_create.c:477
#8  0x75ddb103 in clone () from 
/usr/lib/x86_64-linux-gnu/libc.so.6

---


I tried some simple example which is similar to my app structure, 
e.g.

--
void threadFunc() {
  foreach (i; 0..10) {
auto stats = core.memory.GC.stats();
writeln(stats);
Thread.sleep( dur!("msecs")( 50 ) );
  }
}

void main() {
  spawn();
  spawn();
  thread_joinAll();
}
--

however, it runs fine.


Anyone has some suggestions on how to isolate this issue?

Thanks.