Bug #69031 [NEW]: Long messages into stdout/stderr are truncated incorrectly
| From: | dz at heroku dot com | Date: | Wed, 11 Feb 2015 15:36:43 +0000 |
| Subject: | Bug #69031 [NEW]: Long messages into stdout/stderr are truncated incorrectly | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-190589@lists.php.net to get a copy of this message | ||
From: dz at heroku dot com
Operating system: irrelevant
PHP version: 5.6.5
Package: FPM related
Bug Type: Bug
Bug description:Long messages into stdout/stderr are truncated incorrectly
Description:
------------
The maximum zlog message length is 1024 including timestamp et cetera.
With very long messages over 1024 characters, these get wrapped into
multiple chunks correctly, but then the "WARNING: child blah said into
blah" gets added and the zlog call truncates the messages using "..." at
the end, resulting in a couple dozen bytes getting lost.
This change calculates the length at which wrapping needs to occur
correctly.
To reproduce, long a long message to stderr, e.g. a bit of Shakespeare:
Test script:
---------------
file_put_contents('php://stderr', "If it were done when 'tis done, then
'twere well // It were done quickly. If the assassination // Could
trammel up the consequence, and catch, // With his surcease, success;
that but this blow // Might be the be-all and the end-all--here, // But
here, upon this bank and shoal of time,-- // We'd jump the life to come.
But in these cases // We still have judgement here; that we but teach //
Bloody instructions, which being taught, return // To plague the
inventor: this even-handed justice // Commends the ingredients of our
poison'd chalice // To our own lips. He's here in double trust: //
First, as I am his kinsman and his subject, // Strong both against the
deed: then, as his host, // Who should against his murderer shut the
door, // Not bear the knife myself. Besides, this Duncan // Hath borne
his faculties so meek, hath been // So clear in his great office, that
his virtues // Will plead like angels, trumpet-tongued, against // The
deep damnation of his taking-off: // And pity, like a naked new-born
babe, // Striding the blast, or heaven's cherubin, hors'd // Upon the
sightless couriers of the air, // Shall blow the horrid deed in every
eye, // That tears shall drown the wind.--I have no spur // To prick the
sides of my intent, but only // Vaulting ambition, which o'erleaps
itself, // And falls on the other. // Is this a dagger which I see
before me, // The handle toward my hand? Come, let me clutch thee:-- //
I have thee not, and yet I see thee still. // Art thou not, fatal
vision, sensible // To feeling as to sight? or art thou but // A dagger
of the mind, a false creation, // Proceeding from the heat-oppressed
brain? // I see thee yet, in form as palpable // As this which now I
draw. // Thou marshall'st me the way that I was going; // And such an
instrument I was to use. // Mine eyes are made the fools o' the other
senses, // Or else worth all the rest: I see thee still; // And on thy
blade and dudgeon gouts of blood, // Which was not so before.--There's
no such thing: // It is the bloody business which informs // Thus to
mine eyes.--Now o'er the one half-world // Nature seems dead, and wicked
dreams abuse // The curtain'd sleep; now witchcraft celebrates // Pale
Hecate's offerings; and wither'd murder, // Alarum'd by his sentinel,
the wolf, // Whose howl's his watch, thus with his stealthy pace, //
With Tarquin's ravishing strides, towards his design // Moves like a
ghost.--Thou sure and firm-set earth, // Hear not my steps, which way
they walk, for fear // Thy very stones prate of my whereabout, // And
take the present horror from the time, // Which now suits with
it.--Whiles I threat, he lives; // Words to the heat of deeds too cold
breath gives. // ");
Expected result:
----------------
[11-Feb-2015 16:25:30] WARNING: [pool www] child 15441 said into stderr:
"If it were done when 'tis done, then 'twere well // It were done
quickly. If the assassination // Could trammel up the consequence, and
catch, // With his surcease, success; that but this blow // Might be the
be-all and the end-all--here, // But here, upon this bank and shoal of
time,-- // We'd jump the life to come. But in these cases // We still
have judgement here; that we but teach // Bloody instructions, which
being taught, return // To plague the inventor: this even-handed justice
// Commends the ingredients of our poison'd chalice // To our own lips.
He's here in double trust: // First, as I am his kinsman and his
subject, // Strong both against the deed: then, as his host, // Who
should against his murderer shut the door, // Not bear the knife myself.
Besides, this Duncan // Hath borne his faculties so meek, hath been //
So clear in his great office, that his virtues // Will plead like
angels, trumpet-tongued, against // The d"
[11-Feb-2015 16:25:30] WARNING: [pool www] child 15441 said into stderr:
"eep damnation of his taking-off: // And pity, like a naked new-born
babe, // Striding the blast, or heaven's cherubin, hors'd // Upon the
sightless couriers of the air, // Shall blow the horrid deed in every
eye, // That tears shall drown the wind.--I have no spur // To prick the
sides of my intent, but only // Vaulting ambition, which o'erleaps
itself, // And falls on the other. // Is this a dagger which I see
before me, // The handle toward my hand? Come, let me clutch thee:-- //
I have thee not, and yet I see thee still. // Art thou not, fatal
vision, sensible // To feeling as to sight? or art thou but // A dagger
of the mind, a false creation, // Proceeding from the heat-oppressed
brain? // I see thee yet, in form as palpable // As this which now I
draw. // Thou marshall'st me the way that I was going; // And such an
instrument I was to use. // Mine eyes are made the fools o' the other
senses, // Or else worth all the rest: I see "
[11-Feb-2015 16:25:30] WARNING: [pool www] child 15441 said into stderr:
"thee still; // And on thy blade and dudgeon gouts of blood, // Which
was not so before.--There's no such thing: // It is the bloody business
which informs // Thus to mine eyes.--Now o'er the one half-world //
Nature seems dead, and wicked dreams abuse // The curtain'd sleep; now
witchcraft celebrates // Pale Hecate's offerings; and wither'd murder,
// Alarum'd by his sentinel, the wolf, // Whose howl's his watch, thus
with his stealthy pace, // With Tarquin's ravishing strides, towards his
design // Moves like a ghost.--Thou sure and firm-set earth, // Hear not
my steps, which way they walk, for fear // Thy very stones prate of my
whereabout, // And take the present horror from the time, // Which now
suits with it.--Whiles I threat, he lives; // Words to the heat of deeds
too cold breath gives. // "
Actual result:
--------------
[11-Feb-2015 16:35:20] WARNING: [pool www] child 27103 said into stderr:
"If it were done when 'tis done, then 'twere well // It were done
quickly. If the assassination // Could trammel up the consequence, and
catch, // With his surcease, success; that but this blow // Might be the
be-all and the end-all--here, // But here, upon this bank and shoal of
time,-- // We'd jump the life to come. But in these cases // We still
have judgement here; that we but teach // Bloody instructions, which
being taught, return // To plague the inventor: this even-handed justice
// Commends the ingredients of our poison'd chalice // To our own lips.
He's here in double trust: // First, as I am his kinsman and his
subject, // Strong both against the deed: then, as his host, // Who
should against his murderer shut the door, // Not bear the knife myself.
Besides, this Duncan // Hath borne his faculties so meek, hath been //
So clear in his great office, that his virtues // Will plead like
angels, trumpet-tongued, against // The...
[11-Feb-2015 16:35:20] WARNING: [pool www] child 27103 said into stderr:
"/ Striding the blast, or heaven's cherubin, hors'd // Upon the
sightless couriers of the air, // Shall blow the horrid deed in every
eye, // That tears shall drown the wind.--I have no spur // To prick the
sides of my intent, but only // Vaulting ambition, which o'erleaps
itself, // And falls on the other. // Is this a dagger which I see
before me, // The handle toward my hand? Come, let me clutch thee:-- //
I have thee not, and yet I see thee still. // Art thou not, fatal
vision, sensible // To feeling as to sight? or art thou but // A dagger
of the mind, a false creation, // Proceeding from the heat-oppressed
brain? // I see thee yet, in form as palpable // As this which now I
draw. // Thou marshall'st me the way that I was going; // And such an
instrument I was to use. // Mine eyes are made the fools o' the other
senses, // Or else worth all the rest: I see thee still; // And on thy
blade and dudgeon gouts of blood, // Which was ...
[11-Feb-2015 16:35:20] WARNING: [pool www] child 27103 said into stderr:
"orms // Thus to mine eyes.--Now o'er the one half-world // Nature seems
dead, and wicked dreams abuse // The curtain'd sleep; now witchcraft
celebrates // Pale Hecate's offerings; and wither'd murder, // Alarum'd
by his sentinel, the wolf, // Whose howl's his watch, thus with his
stealthy pace, // With Tarquin's ravishing strides, towards his design
// Moves like a ghost.--Thou sure and firm-set earth, // Hear not my
steps, which way they walk, for fear // Thy very stones prate of my
whereabout, // And take the present horror from the time, // Which now
suits with it.--Whiles I threat, he lives; // Words to the heat of deeds
too cold breath gives. // "
--
Edit bug report at https://bugs.php.net/bug.php?id=69031&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69031&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69031&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69031&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69031&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69031&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69031&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69031&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69031&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69031&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69031&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69031&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69031&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69031&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69031&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69031&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69031&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69031&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69031&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69031&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69031&r=mysqlcfg