[fpc-pascal] problem with threads and backgrounding, fpc 2.1.3 arm native

Luca Olivetti luca at ventoso.org
Tue Apr 3 22:37:55 CEST 2007


En/na Micha Nelissen ha escrit:
> Luca Olivetti wrote:
>> synchronize and critical sections, c library with callbacks to pascal,
>> etc.) is working flawlessly in the foreground, but it segfaults if I try
>> to background it (or try to use fpFork), and this is a problem since I
>> want to write a daemon (i can use screen though if that isn't possible).
> 
> Backgrounding is not the same as forking. 

I (vaguely) understand the difference, but I think (probably mistakenly) 
that the problems are related.

> Backgrounding is using the
> shell's job control (and sends some signal(s) to the process), forking
> is what the program does itself. Can you list an example that crashes
> with fpfork, and give an strace with it ?

the example daemon.pp, for example, crashes right away, strace doesn't 
seem very useful to me:

luca at lspro:~/fork$ strace -f ./daemon
execve("./daemon", ["./daemon"], [/* 22 vars */]) = 0
syscall: unknown syscall trap 0x00008000


A simple program that just repeatedly sleeps after the fork, dies as 
soon as it receives any signal (e.h HUP, USR1).

Bye
-- 
Luca



More information about the fpc-pascal mailing list