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:11
Avg. Score:4.0 ± 1.1
Reproduced:8 of 9 (88.9%)
Same Version:4 (50.0%)
Same OS:2 (25.0%)
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nick dot telford at gmail dot com
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 11:01:29 2024 UTC