reentrant func in signal handler