php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52121 pcntl_signal() restart_syscalls doesn't behave as expected
Submitted: 2010-06-18 18:01 UTC Modified: 2017-10-24 06:47 UTC
Votes:9
Avg. Score:4.3 ± 0.9
Reproduced:6 of 7 (85.7%)
Same Version:3 (50.0%)
Same OS:1 (16.7%)
From: nick dot telford at gmail dot com Assigned:
Status: Open Package: PCNTL related
PHP Version: 5.3.2 OS: Ubuntu 10.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-06-18 18:01 UTC] nick dot telford at gmail dot com
Description:
------------
The 3rd parameter of pcntl_signal() is "restart_syscalls". The docs provide very 
little information about it, however reading here 
http://www.win.tue.nl/~aeb/linux/lk/lk-4.html#ss4.5 shows that it should cause 
the following behaviour when a wait() call is made:
    "The effect is that upon an interrupt the system call is aborted, the user 
program's signal handler is called, and afterwards the system call is restarted 
from the beginning."

The pcntl implementation of the restart_syscalls parameter appears to restart 
the syscalls *without* calling the userland signal handler.

While I understand that this cannot be fixed (due to the "tick" based signal 
handling in PHP), the "restart_syscalls" parameter should not default to "true".

If the default parameter value is not changed, at the very least a big red note 
should be made in the documentation warning of this inconsistency.

Expected result:
----------------
restart_syscalls parameter, when true, should cause wait() calls to get restarted 
after calling the userland signal handler.

Actual result:
--------------
restart_syscalls parameter, when true, causes wait() calls to get restarted 
*without* calling the userland signal handler.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-18 23:43 UTC] felipe@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: lbarnaud
 [2017-10-24 06:47 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: lbarnaud +Assigned To:
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Aug 25 05:01:26 2019 UTC