Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Try to fix PHP/hhvm tests by working around an issue with SET NAMES - #3220

Merged
NateBrady23 merged 1 commit into
TechEmpower:masterfrom
michaelhixson:fix-hhvm-segfault
Jan 30, 2018
Merged

NateBrady23 merged 1 commit into
TechEmpower:masterfrom
michaelhixson:fix-hhvm-segfault

Conversation

@michaelhixson

Copy link
Copy Markdown
Contributor

I think we are running into this problem:

meta/hhvm#8111

We don't solve that problem, but we avoid it by specifying utf8 in a
different fashion. I also took the opportunity to use the "TFB-database"
hostname instead of the DBHOST environment variable because it's simpler
that way.

Here are the steps I took in a local TFB environment that make me think
we're running into the same issue as that GitHub issue:

  • Run toolset/run-tests.py --mode verify --test hvm, see that it fails
    all tests with error messages that look like the application server
    simply isn't there

  • Enable logging in PHP/hhvm/deploy/config.hdf (basically copy the
    "Log" section over from config-debug.hdf), run the test again

  • Look at the log file it spit out, PHP/hhvm/error.log, notice messages
    like this:

    Core dumped: Segmentation fault
    Stack trace in /tmp/stacktrace.28653.log

  • /tmp is cleared by the TFB toolset each run, so I comment out that
    part of benchmarker.py that clears /tmp

  • Run the test again, look at the stacktrace file in /tmp, notice a
    stack trace referring to our implementation code like this:

    #0 PDO->__construct() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:14]
    About PHP #1 Benchmark->setup_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:31]
    Benchmarking tool suggestion. #2 Benchmark->bench_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:10]
    Update and improve Compojure #3 main() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:13]

  • Google a bit, come across a GitHub issue talking about a similar
    problem when they used "SET NAMES"

  • Comment the part of PHP/hhvm/once.php.inc that uses SET NAMES, run
    test again and it worked, except for fortunes which failed because of
    character encoding problems

  • Google for a different way to specify utf8 in the PDO constructor,
    try it again, all tests pass locally

I think we are running into this problem:

  meta/hhvm#8111

We don't solve that problem, but we avoid it by specifying utf8 in a
different fashion.  I also took the opportunity to use the "TFB-database"
hostname instead of the DBHOST environment variable because it's simpler
that way.

Here are the steps I took in a local TFB environment that make me think
we're running into the same issue as that GitHub issue:

 - Run toolset/run-tests.py --mode verify --test hvm, see that it fails
   all tests with error messages that look like the application server
   simply isn't there
 - Enable logging in PHP/hhvm/deploy/config.hdf (basically copy the
   "Log" section over from config-debug.hdf), run the test again
 - Look at the log file it spit out, PHP/hhvm/error.log, notice messages
   like this:

    Core dumped: Segmentation fault
    Stack trace in /tmp/stacktrace.28653.log

 - /tmp is cleared by the TFB toolset each run, so I comment out that
   part of benchmarker.py that clears /tmp
 - Run the test again, look at the stacktrace file in /tmp, notice a
   stack trace referring to our implementation code like this:

    #0  PDO->__construct() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:14]
    TechEmpower#1  Benchmark->setup_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:31]
    TechEmpower#2  Benchmark->bench_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:10]
    TechEmpower#3  main() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:13]

 - Google a bit, come across a GitHub issue talking about a similar
   problem when they used "SET NAMES"
 - Comment the part of PHP/hhvm/once.php.inc that uses SET NAMES, run
   test again and it worked, except for fortunes which failed because of
   character encoding problems
 - Google for a different way to specify utf8 in the PDO constructor,
   try it again, all tests pass locally
@NateBrady23
NateBrady23 merged commit 903997f into TechEmpower:master Jan 30, 2018
zloster pushed a commit to zloster/FrameworkBenchmarks that referenced this pull request Feb 7, 2018
…echEmpower#3220)

I think we are running into this problem:

  meta/hhvm#8111

We don't solve that problem, but we avoid it by specifying utf8 in a
different fashion.  I also took the opportunity to use the "TFB-database"
hostname instead of the DBHOST environment variable because it's simpler
that way.

Here are the steps I took in a local TFB environment that make me think
we're running into the same issue as that GitHub issue:

 - Run toolset/run-tests.py --mode verify --test hvm, see that it fails
   all tests with error messages that look like the application server
   simply isn't there
 - Enable logging in PHP/hhvm/deploy/config.hdf (basically copy the
   "Log" section over from config-debug.hdf), run the test again
 - Look at the log file it spit out, PHP/hhvm/error.log, notice messages
   like this:

    Core dumped: Segmentation fault
    Stack trace in /tmp/stacktrace.28653.log

 - /tmp is cleared by the TFB toolset each run, so I comment out that
   part of benchmarker.py that clears /tmp
 - Run the test again, look at the stacktrace file in /tmp, notice a
   stack trace referring to our implementation code like this:

    #0  PDO->__construct() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:14]
    #1  Benchmark->setup_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/once.php.inc:31]
    #2  Benchmark->bench_db() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:10]
    #3  main() called at [/home/techempower/FrameworkBenchmarks/frameworks/PHP/hhvm/db.php:13]

 - Google a bit, come across a GitHub issue talking about a similar
   problem when they used "SET NAMES"
 - Comment the part of PHP/hhvm/once.php.inc that uses SET NAMES, run
   test again and it worked, except for fortunes which failed because of
   character encoding problems
 - Google for a different way to specify utf8 in the PDO constructor,
   try it again, all tests pass locally
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants