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

Hangs forever with HHVM #11

Closed
marcioAlmada opened this issue Aug 19, 2014 · 15 comments
Closed

Hangs forever with HHVM #11

marcioAlmada opened this issue Aug 19, 2014 · 15 comments

Comments

@marcioAlmada
Copy link
Contributor

I tried to run docopt with HHVM and it simply hangs forever. All runs fine with Zend PHP.

@shabbyrobe
Copy link
Member

Yikes. Thanks heaps for reporting. I'll look in to this over the next few days.

@marcioAlmada
Copy link
Contributor Author

thnx, docopt is really great!

@shabbyrobe
Copy link
Member

I've tried to run the tests using hhvm and they all pass. Can you please submit a script that replicates the problem?

@marcioAlmada
Copy link
Contributor Author

Sure.

#!/usr/bin/env hhvm
<?php //app

include __DIR__ . '/vendor/autoload.php';

$doc = <<<DOC
App.

Usage:
  app (-h | --help)
  app --version
DOC;

$args = (new \Docopt\Handler(['version'=>'App 0.1']))->handle($doc);

Then run hhmv app. This seems to be enough to hang and fry a computer with HipHop VM 2.4.0 (rel). Only happens with HHVM. Am I doing something wrong?

@shabbyrobe
Copy link
Member

Am I doing something wrong?

This definitely merits further testing on my part - even if you were doing something wrong - and at first glance it doesn't look at all like you are - docopt's failure mode should never be to hang and/or fry any computers!

You've given me enough information to debug for now, so I'll see what I can find and get back to you. Thanks again for your help!

@marcioAlmada
Copy link
Contributor Author

Hi, how should I run the tests? :)

@shabbyrobe
Copy link
Member

On the develop branch, you need to run the following:

git submodule update --init
composer install
php test.php

This will run the PHP version's tests as well as the Python version's language agnostic tests.

Are you running on the master branch or the develop branch?

@marcioAlmada
Copy link
Contributor Author

I wast on master. Switched to develop and HHVM still hangs... wondering why.

It hangs exactly here, when handling this docopt spec.

@shabbyrobe
Copy link
Member

I've tried again using exactly those files, once again I can't reproduce. Sorry! This one's a bit of a doozy. What version of HHVM?

blake-ubu 11:29 2/epilog$ hhvm --version
HipHop VM 3.3.0 (rel)
Compiler: tags/HHVM-3.3.0-0-g0a3cfb87b8a353fc7e1d15374f4adc413e37aba9
Repo schema: 9a391d9a03e15fccba1cde6d35c05b7cdd380238
Extension API: 20140829

blake-ubu 11:29 2/epilog$ ./epilog test

Fatal error: Uncaught exception 'Epilog\FlowException' with message 'Command not defined, try epilog --help' in /home/blake/tmp/hhvm/2/epilog/epilog:14
Stack trace:
#0 {main}
Command not defined, try epilog --help

@marcioAlmada
Copy link
Contributor Author

Ok, to be honest I don't think it's a problem with docopt anymore. Don't waste your time, I'll build the bleeding edge HHVM from source (this will take some minutes ☕) and give you feedback.

@marcioAlmada
Copy link
Contributor Author

Ok, it works as expected with HHVM from master! Thank you for the support.

@shabbyrobe
Copy link
Member

Oh phew, glad to hear it's working for you now. I'd still like to see if there's something we can identify with it, maybe stick a caveat in the README if I can't find what's causing the hang. This could well bite someone else in the future. Do you know what the version was that exhibited the problem?

@marcioAlmada
Copy link
Contributor Author

Problem happened with HHVM 2.4.0, it's the current version for most package managers. Anyway, the minor LTS version of HHVM is 3.3 so most people will be using LTS, this won't be a big deal.

@shabbyrobe
Copy link
Member

Do you think a README note will be enough?

Docopt is tested with PHP 5.3, 5.4, 5.5 and 5.6, and whichever version of HHVM Travis decides to use today.

@marcioAlmada
Copy link
Contributor Author

...and centuries later... #13

It's nice to note this on README but we could add HHVM LTS as a composer platform package too :)

maltsev added a commit to maltsev/docopt.php that referenced this issue Oct 8, 2018
Otherwise the library couldn't be installed using composer require` if HHVM isn't present.

Related issues: docopt#13, docopt#11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants