Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault on var_dump() of simplehtmldom object #3991

Closed
andrisi opened this issue Oct 15, 2014 · 13 comments
Closed

Segmentation fault on var_dump() of simplehtmldom object #3991

andrisi opened this issue Oct 15, 2014 · 13 comments
Labels

Comments

@andrisi
Copy link

andrisi commented Oct 15, 2014

When loading bigger files using the simplehtmldom library (http://simplehtmldom.sourceforge.net/) and then doing a var_dump on it will cause a Segmentation fault. Just do a "wget -o index.html http://index.hu" and then run the code below.

<?
require('lib/simplehtmldom/simple_html_dom.php');
$dom = file_get_html('index.html');
var_dump($dom);
@paulbiss paulbiss added the crash label Oct 15, 2014
@Majkl578
Copy link
Contributor

I got this one:

Fatal error: String length exceeded 2^31-2: 2147483647

Not a segfault. HHVM build from master.

@andrisi
Copy link
Author

andrisi commented Oct 15, 2014

We might be using different versions, I'm using Using "HipHop VM 3.2.0 (dbg)" version. It still seems to be an error. Or you can create an invalid string from code?

@Majkl578
Copy link
Contributor

Can you try 3.3.0 or nightly? I had master in dbg and didn't get a segfault.

@andrisi
Copy link
Author

andrisi commented Oct 15, 2014

Tried 3.3, same results. Core dumped: Segmentation fault.

@Majkl578
Copy link
Contributor

Interesting. Could you run it under gdb and obtain a backtrace?

$ gdb --args hhvm test.php
...
(gdb) run
<when it crashes>
(gdb) bt

@paulbiss
Copy link
Contributor

This was fixed recently (I think), try building from master after 27ae84e

If that fixes it we should probably make sure this gets picked for 3.3.1

@andrisi
Copy link
Author

andrisi commented Oct 16, 2014

gdb output for 3.3 is at: https://gist.github.com/andrisi/79c11c0d05c0b979d88d

@paulbiss
Copy link
Contributor

The patch I referenced wasn't in 3.3 (it will be in 3.3.1)

@paulbiss
Copy link
Contributor

paulbiss commented Nov 3, 2014

Please re-open if you're still seeing crashes in 3.3.1 or master.

@paulbiss paulbiss closed this as completed Nov 3, 2014
@jurosh
Copy link

jurosh commented May 2, 2015

I have error: Fatal error: String length exceeded 2^31-2 on HipHop VM 3.7.0 using on project in Laravel...

@paulbiss
Copy link
Contributor

paulbiss commented May 2, 2015

The fix for this bug involved triggering a fatal error if the maximum size of the output buffer is exceeded.

@andrisi
Copy link
Author

andrisi commented May 2, 2015

Perhaps printing nothing, or just stopping would be a more plesant fix, then throwing a fatal error on a simple var_dump? We shall do some (unreliable) check before every var_dump() to avoid fatal errors? But of course, using var_dump() in a real setting is uncommon.

@jurosh
Copy link

jurosh commented May 2, 2015

Ok, so my app is working now - I had missing storage folders for some caching... but it was really strange what it was doing...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants