Last modified: 2014-11-14 06:52:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T75037, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 73037 - PHP errors swallowed.
PHP errors swallowed.
Status: RESOLVED FIXED
Product: MediaWiki-Vagrant
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-05 18:32 UTC by Jon
Modified: 2014-11-14 06:52 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jon 2014-11-05 18:32:27 UTC
Add a line like foo()bar(); to your php.
Localhost says `This webpage is not available`

I can't find the php error logs so I can't debug it. I'm sure they exist somewhere but why don't these kind of errors output to the screen?
Comment 1 Bryan Davis 2014-11-05 18:34:50 UTC
Check /vagrant/logs/hhvm/error.log. I agree that we should figure out how to tune HHVM's error reporting to be nicer for development work.
Comment 2 Jon 2014-11-05 18:50:27 UTC
Nothing in there for me. :-/
Comment 3 Gerrit Notification Bot 2014-11-05 21:35:19 UTC
Change 171443 had a related patch set uploaded by MaxSem:
Output HHVM errors to the user

https://gerrit.wikimedia.org/r/171443
Comment 4 Gerrit Notification Bot 2014-11-05 23:25:13 UTC
Change 171443 abandoned by MaxSem:
Output HHVM errors to the user

Reason:
Eh

https://gerrit.wikimedia.org/r/171443
Comment 5 Max Semenik 2014-11-08 00:27:41 UTC
So what happens is that MW sets up home-made gzipping and sends Content-Encoding:gzip, however when it crashes, HHVM outputs the error in plaintext, choking browser's decoder.
Comment 6 Bryan Davis 2014-11-08 00:39:48 UTC
(In reply to Max Semenik from comment #5)
> So what happens is that MW sets up home-made gzipping and sends
> Content-Encoding:gzip, however when it crashes, HHVM outputs the error in
> plaintext, choking browser's decoder.

I've poked at this problem a bit today and found out some things. First, HHVM's error log should be written to /vagrant/logs/hhvm/error.log. I can confirm on several test vms that this works for me. I can also confirm however that the HHVM interpreter buffers it's log writes such that errors may not be written to this file immediately. I looked through the code a bit and couldn't find a setting that would disable this caching or make it flush faster.

The next thing I've figured out is that you get slightly different results based on where the error is located. If I add the "foo()bar();" invalid PHP syntax in a file like $IP/index.php I get an error page from HHVM. It's an ugly page and it has a 200 response status, but it is an error page.

If I bury the syntax error somewhere like  in the middle of CoreParserFunctions::ns() I just get an empty "500 hphp_invoke" response from the server. If I wait long enough then I see a parse failure in the error.log file.  This corresponds to what Max is reporting in the context-encoding mismatch. If the error happens before we set that header you will se something, but after the header is set everyone gets confused.
Comment 7 Max Semenik 2014-11-08 00:43:29 UTC
Minimum repro:

<?php

header( 'Content-Encoding: gzip' );

echo gzencode( somefunc() );
Comment 8 Gerrit Notification Bot 2014-11-08 00:54:49 UTC
Change 172002 had a related patch set uploaded by MaxSem:
Don't use output compression

https://gerrit.wikimedia.org/r/172002
Comment 9 Gerrit Notification Bot 2014-11-13 22:49:41 UTC
Change 172002 merged by jenkins-bot:
Don't use output compression

https://gerrit.wikimedia.org/r/172002
Comment 10 Max Semenik 2014-11-13 23:00:14 UTC
Jon, does it fix the issue for you?
Comment 11 Jon 2014-11-14 06:52:42 UTC
I see errors now. This is good.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links