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

Better handling when prior steps fail #64

Closed
ezyang opened this issue Mar 8, 2010 · 2 comments
Closed

Better handling when prior steps fail #64

ezyang opened this issue Mar 8, 2010 · 2 comments

Comments

@ezyang
Copy link

ezyang commented Mar 8, 2010

Here are some sample traces that occur if you haven't setup your environment properly:

ezyang@ezyang:~/Dev/hiphop$ hiphop-php/src/hphp/hphp  --keep-tempdir=1 --log=3 hiphop-php/src/test.php 
running hphp...
creating temporary directory /tmp/hphp_qunIhO ...
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/stdclass.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/exception.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/arrayaccess.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/iterator.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/pear_error.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/reflection.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/splobjectstorage.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/directory.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/classes/splfile.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/globals/symbols.php
Unable to open file /home/ezyang/Dev/hiphop/src/lib/system/globals/constants.php
Core dumped: Segmentation fault

and

ezyang@ezyang:~/Dev/hiphop/hiphop-php$ src/hphp/hphp  --keep-tempdir=1 --log=3 src/test.php 
running hphp...
creating temporary directory /tmp/hphp_gZj9Qm ...
parsing inputs...
parsing ./src/test.php...
parsing inputs took 0'00" (1 ms) wall time
pre-optimizing...
pre-optimizing took 0'00" (0 ms) wall time
inferring types...
inferring types took 0'00" (0 ms) wall time
post-optimizing...
post-optimizing took 0'00" (0 ms) wall time
creating CPP files...
creating CPP files took 0'00" (42 ms) wall time
compiling and linking CPP files...
CMake Error at /home/ezyang/Dev/hiphop/hiphop-php/CMake/FindLibEvent.cmake:29 (message):\n  Could NOT find libevent.\nCall Stack (most recent call first):\n  /home/ezyang/Dev/hiphop/hiphop-php/CMake/HPHPFindLibs.cmake:38 (find_package)\n  /home/ezyang/Dev/hiphop/hiphop-php/CMake/HPHPSetup.cmake:2 (include)\n  CMakeLists.txt:31 (include)\n\n\nmake: *** No targets specified and no makefile found.  Stop.\n
compiling and linking CPP files took 0'02" (2734 ms) wall time
running executable /tmp/hphp_gZj9Qm/program --file src/test.php...
sh: /tmp/hphp_gZj9Qm/program: not found
command failed: "/tmp/hphp_gZj9Qm/program --file src/test.php"
all files saved in /tmp/hphp_gZj9Qm ...
running hphp took 0'03" (3074 ms) wall time

These are all clearly PEBCAK problems, but it would be nice if HipHop didn't blindly chug ahead when the warning signs were being thrown.

@scottmac
Copy link
Contributor

scottmac commented Mar 8, 2010

Fixed in faacb3b for the last one, can you open another issue for the first one with a reproduce case and a backtrace maybe?

@ezyang
Copy link
Author

ezyang commented Mar 8, 2010

Set HPHP_HOME to some spurious directory (in my case it was .. the real home).

hhvm-bot pushed a commit that referenced this issue Jan 25, 2018
Summary:
This adds the Aarch64 equivalent code that was seen at the bottom of  commit 1c338be.
This takes advantage of the assert to save 2 instructions per instance.

The standard regression tests were run with 6 option sets.  No new problems were observed.
The generated assembly code was as expected.

Before
=====
0000000005e8b574 <_ZN4HPHP5ffs64Em>:
...
 5e8b5e4:       52801382        mov     w2, #0x9c                       // #156
 5e8b5e8:       97dc48c9        bl      559d90c <_ZN4HPHP11assert_failEPKcS1_jS1_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE>
 5e8b5ec:       f94017a0        ldr     x0, [x29,#40]
 5e8b5f0:       f100001f        cmp     x0, #0x0        //<<---
 5e8b5f4:       dac00000        rbit    x0, x0          //<<---
 5e8b5f8:       dac01000        clz     x0, x0          //<<---
 5e8b5fc:       9a8007e0        csinc   x0, xzr, x0, eq //<<---
 5e8b600:       51000400        sub     w0, w0, #0x1

After
====
0000000005e8b574 <_ZN4HPHP5ffs64Em>:
...
 5e8b5e4:       52801382        mov     w2, #0x9c                       // #156
 5e8b5e8:       97dc48c9        bl      559d90c <_ZN4HPHP11assert_failEPKcS1_jS1_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE>
 5e8b5ec:       f94017a0        ldr     x0, [x29,#40]
 5e8b5f0:       dac00000        rbit    x0, x0          //<<---
 5e8b5f4:       dac01000        clz     x0, x0          //<<---
 5e8b5f8:       f90023a0        str     x0, [x29,#64]
 5e8b5fc:       f94023a0        ldr     x0, [x29,#64]
Closes #8077

Reviewed By: edwinsmith

Differential Revision: D6766056

Pulled By: mxw

fbshipit-source-id: 65242fbf90ed8fbc39e2f3776e251e248ff3cab2
facebook-github-bot pushed a commit that referenced this issue Jun 6, 2024
…rence

Summary:
Prior to this diff, the `EarlyAppWrite` was taken in by value, which meant that
there were 6 unique event handlers that needed to perform the allocate
stack/move/call/cleanup/exception handling for each call to `handleAppWrite` or
`ignoreEarlyAppWrite`.

This diff changes the signature to take the parameter by reference. This means
that w.r.t the caller, there are no locally scoped variables with non-trivial
destructors, so that the EventHandlers can simply tail call into the function.

Before:
```
0000000000039774 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>:
   39774:       d10143ff        sub     sp, sp, #0x50
   39778:       f9001bfe        str     x30, [sp, #48]
   3977c:       a9044ff4        stp     x20, x19, [sp, #64]
   39780:       d53bd053        mrs     x19, tpidr_el0
   39784:       910003f4        mov     x20, sp
   39788:       f9401669        ldr     x9, [x19, #40]
   3978c:       f90017e9        str     x9, [sp, #40]
   39790:       b9412029        ldr     w9, [x1, #288]
   39794:       71004d3f        cmp     w9, #0x13
   39798:       9a9f0029        csel    x9, x1, xzr, eq  // eq = none
   3979c:       3dc00120        ldr     q0, [x9]
   397a0:       f900053f        str     xzr, [x9, #8]
   397a4:       f940092a        ldr     x10, [x9, #16]
   397a8:       b9401929        ldr     w9, [x9, #24]
   397ac:       3d8003e0        str     q0, [sp]
   397b0:       f9000bea        str     x10, [sp, #16]
   397b4:       b9001be9        str     w9, [sp, #24]
   397b8:       910003e1        mov     x1, sp
   397bc:       94000011        bl      39800 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateENS_13EarlyAppWriteE>
   397c0:       b27d028        orr     x0, x20, #0x8
   397c4:       97ffb75a        bl      2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev>
   397c8:       f9401668        ldr     x8, [x19, #40]
   397cc:       f94017e9        ldr     x9, [sp, #40]
   397d0:       eb09011f        cmp     x8, x9
   397d4:       540000a1        b.ne    397e8 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE+0x74>  // b.any
   397d8:       a9444ff4        ldp     x20, x19, [sp, #64]
   397dc:       f9401bfe        ldr     x30, [sp, #48]
   397e0:       910143ff        add     sp, sp, #0x50
   397e4:       d65f03c0        ret
   397e8:       9400770e        bl      57420 <__stack_chk_fail@plt>
   397ec:       aa0003f3        mov     x19, x0
   397f0:       b27d028        orr     x0, x20, #0x8
   397f4:       97ffb74e        bl      2752c <_ZNSt6__ndk110unique_ptrIN5folly5IOBufENS_14default_deleteIS2_EEED2Ev>
   397f8:       aa1303e0        mov     x0, x19
   397fc:       940078d1        bl      57b40 <__wrap__Unwind_Resume@plt>

```

After:
```
0000000000039714 <_ZN4fizz2sm12EventHandlerINS_6client11ClientTypesELNS2_9StateEnumE1ELNS_5EventE16EE6handleERKNS2_5StateERNS_5ParamE>:
   39714:       14000001        b       39718 <_ZN4fizz2smL19handleEarlyAppWriteERKNS_6client5StateERNS_5ParamE>
```

Reviewed By: zalecodez

Differential Revision: D58164235

fbshipit-source-id: 9d06f5bf7f1a2c931131597f53ef6c3cd734fe46
This issue was closed.
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