php -R - $argn seems to have last char missing

Bug #1572465 reported by tracey jaquith
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
php7.0 (Ubuntu)
Fix Released
Medium
Nish Aravamudan
Xenial
Fix Committed
Medium
Unassigned

Bug Description

last char of lines to "php -R" seem to be missing final (non-whitespace chars).

[Impact]

 * Users expect `php -R` to execute the entire provided string.

[Test Case]

 * /bin/echo ruhro | /usr/bin/php7.0 -R 'echo "$argn\n";'
   Should print "ruhro", but prints "ruhr" without the specified fix.

[Regression Potential]

 * There is very little chance of regression as the bugfix in question is an upstream backport. The only possibility would seem to be a user's PHP script relying on the now-broken behavior, but I find it challenging to think of a way that could actually be done.

[Other Info]

 * Test build at https://launchpad.net/~nacc/+archive/ubuntu/lp1572465 was successfully tested by the original reporter.

Tags: patch xenial
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in php7.0 (Ubuntu):
status: New → Confirmed
Revision history for this message
tracey jaquith (tracey-pooh) wrote :

one of my coworkers found this!
https://bugs.php.net/bug.php?id=71624

he wondered if maybe was fixed in v7.0.3, but not v7.0.4 yet?

Revision history for this message
Nish Aravamudan (nacc) wrote :

Thank you for reporting this bug and finding the upstream bug report.

The bug was only reported with 7.0.3, not that it was fixed in 7.0.3 (and to be clear, everything in 7.0.3 should be present in 7.0.4, unless explicitly reverted due to introducing a new bug, as I understand it).

The fix in question is: https://github.com/php/php-src/commit/68ebfc87ad4f3842cd680c32ab307344c8659ce3, and is in 7.0.5. Can you try the test build at https://launchpad.net/~nacc/+archive/ubuntu/lp1572465 once it is finished?

Changed in php7.0 (Ubuntu):
assignee: nobody → Nish Aravamudan (nacc)
status: Confirmed → In Progress
Revision history for this message
Nish Aravamudan (nacc) wrote :
Revision history for this message
tracey jaquith (tracey-pooh) wrote :

confirmed working, woohoo, thanks!!!

Mathew Hodson (mhodson)
tags: added: xenial
Changed in php7.0 (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Nish Aravamudan (nacc) wrote : Re: [Bug 1572465] Re: php -R - $argn seems to have last char missing

On Apr 20, 2016 21:40, "tracey jaquith" <email address hidden> wrote:
>
> confirmed working, woohoo, thanks!!!

Thank you for testing! Since 16.04 has released, I will need to submit this
as a SRU, which I will do when I return from vacation next week.

Revision history for this message
Daniel Holbach (dholbach) wrote :

I'm uploading the fix to yakkety first. Can you update the bug description and everything according to https://wiki.ubuntu.com/SRU?

Changed in php7.0 (Ubuntu):
status: In Progress → Fix Committed
Mathew Hodson (mhodson)
Changed in php7.0 (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package php7.0 - 7.0.4-7ubuntu4

---------------
php7.0 (7.0.4-7ubuntu4) yakkety; urgency=medium

  * debian/patches/0053-backport-68ebfc87.patch: Fix bug #71624,
    PHP_MODE_PROCESS_STDIN (CLI SAPI called with '-R') did not properly
    set $argi and $argn. Closes LP: #1572465.

 -- Nishanth Aravamudan <email address hidden> Wed, 20 Apr 2016 19:05:43 -0700

Changed in php7.0 (Ubuntu):
status: Fix Committed → Fix Released
Nish Aravamudan (nacc)
description: updated
Revision history for this message
tracey jaquith (tracey-pooh) wrote :

hmm, i'm likely confused -- but this seems to be the version mentioned where the fix is?
i'm still seeing the behaviour (using vagrant 5/2 build ubuntu/xenial64 (virtualbox, 20160502.0.0) )

echo "boom" | php -R 'print_r($argn);'; echo; echo ================; php -v;
boo
================
PHP 7.0.4-7ubuntu2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Revision history for this message
tracey jaquith (tracey-pooh) wrote :

(or maybe the

php7.0 - 7.0.4-7ubuntu4 (mentioned above on 4/26)
    -v-
php7.0 - 7.0.4-7ubuntu2 (my output above)

is my problem?)

Revision history for this message
Nish Aravamudan (nacc) wrote :

@tracey, the fix is only available in yakkety right now. You could try the test build in the PPA mentioned above, but Xenial's fix will need to wait on the SRU process.

Revision history for this message
tracey jaquith (tracey-pooh) wrote :

ok, thanks! sorry i needed that clue! 8-)

Mathew Hodson (mhodson)
Changed in php7.0 (Ubuntu Xenial):
status: New → Triaged
Mathew Hodson (mhodson)
tags: added: patch
Revision history for this message
Nish Aravamudan (nacc) wrote :

Hello,

via Bug 1569609, php7.0 7.0.8-0ubuntu0.16.04.1 is now in xenial-proposed. Please test that version and indicate if it fixes the issue for you on 16.04.

-Nish

Changed in php7.0 (Ubuntu Xenial):
status: Triaged → Fix Committed
Revision history for this message
Martin Pitt (pitti) wrote :

Unsubscribing sponsors then.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.