php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47816 pcntl tests failing on NetBSD
Submitted: 2009-03-28 01:43 UTC Modified: 2009-03-28 19:08 UTC
From: mbeccati@php.net Assigned: mbeccati (profile)
Status: Closed Package: PCNTL related
PHP Version: 5.3CVS-2009-03-28 (CVS) OS: NetBSD 4
Private report: No CVE-ID: None
 [2009-03-28 01:43 UTC] mbeccati@php.net
Description:
------------
There are a few problems with the new pcntl extension on my NetBSD 4.0 system. The extension compiles fine, but a few tests fail.

First, it seems that NetBSD sigtimedwait / sigwaitinfo implementations return 0 on success and -1 on failure, rather then the signal number: see http://www.daemon-systems.org/man/sigwait.2.html

A patch is available here: http://www.beccati.com/misc/php/pcntl_sigtimedwait_HEAD.diff

I didn't commit myself as you might want a better (autoconf based?) fix.

Second, there are a couple of kernel bugs interfering with pcntl properly working:

http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=41076 (Fixed in -current)
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=41085 (Under investigation)

Once those bugs have been fixed the extensions should be properly working on NetBSD.

Reproduce code:
---------------
pcntl_sigprocmask(SIG_BLOCK, array(SIGTERM));
posix_kill(posix_getpid(), SIGTERM);
var_dump(pcntl_sigwaitinfo(array(SIGTERM), $siginfo));
var_dump($siginfo);


Expected result:
----------------
int(15)
array(3) {
  [u"signo"]=>
  int(15)
  [u"errno"]=>
  int(0)
  [u"code"]=>
  int(0)
}


Actual result:
--------------
int(0)
NULL


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-28 03:08 UTC] lbarnaud@php.net
Hi, 

This looks good, please commit :)

Thanks for your tests on NetBSD.

 [2009-03-28 19:08 UTC] mbeccati@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC