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

Segfault after the upgrade from 3.1 to 3.2. #3595

Closed
vkopitsa opened this issue Aug 26, 2014 · 4 comments
Closed

Segfault after the upgrade from 3.1 to 3.2. #3595

vkopitsa opened this issue Aug 26, 2014 · 4 comments

Comments

@vkopitsa
Copy link

When I go to some pages, processes hhvm go up 1000 mb of RAM and dies with Segfault.

More info on the screenshots:
https://drive.google.com/file/d/0B0rfljKkaTfROU1wRnBrRU9YNXc/edit?usp=sharing
https://drive.google.com/file/d/0B0rfljKkaTfRZ3Vqa21QZnlQYWM/edit?usp=sharing
https://drive.google.com/file/d/0B0rfljKkaTfRamtmbXhkX0Vib28/edit?usp=sharing

ubuntu 14.04, Apache/2.4.7

HipHop VM 3.2.0 (dbg)
Compiler: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
Repo schema: c52ba40f4a246d35a88f1dfc1daf959851ced8aa
Host: MK-vkopitsa
ProcessID: 17880
ThreadID: 7f0ce07ff700
ThreadPID: 17896
Name: unknown program
Type: Segmentation fault
Runtime: hhvm
Version: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
DebuggerCount: 0

ThreadType: Web Request
Server_SERVER_NAME: site.local
Server: site.local
URL: /choologin?view=login&return=L2NvbXBvbmVudC9ha2YvP0l0ZW1pZD0yMDc=

#0  bt_handler at /tmp/tmp.NDtSUGa2KF/hphp/util/process.h:81
#1  HPHP::EmptyArray::Append(HPHP::ArrayData*, HPHP::Variant const&, bool) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/tv-helpers.h:306
#2  HPHP::Array::append(HPHP::Variant const&) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/type-array.cpp:674
#3  HPHP::ExecutionContext::debugBacktrace(bool, bool, bool, HPHP::VMParserFrame*, bool, int) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/bytecode.cpp:2461
#4  HPHP::ExtendedException::computeBacktrace(bool) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/type-array.h:80
#5  HPHP::ExtendedException::ExtendedException(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/exceptions.cpp:33
#6  HPHP::ExecutionContext::handleError(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int, bool, HPHP::ExecutionContext::ErrorThrowMode, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/execution-context.cpp:640
#7  HPHP::raise_message(HPHP::ErrorConstants::ErrorModes, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) at /usr/include/c++/4.8/bits/basic_string.h:293
#8  HPHP::raise_notice(char const*, ...) at /usr/include/c++/4.8/bits/basic_string.h:293
#9  HPHP::TypedValue const* HPHP::ElemSlow<true, (HPHP::KeyType)2>(HPHP::TypedValue&, HPHP::TypedValue&, HPHP::TypedValue*, HPHP::KeyTypeTraits<(HPHP::KeyType)2>::type) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/member-operations.h:194
#10 HPHP::JIT::MInstrHelpers::cGetElemS(HPHP::TypedValue*, HPHP::StringData*, HPHP::JIT::MInstrState*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/tv-helpers.h:306
#11 HPHP::JIT::X64::BackEnd::enterTCHelper(unsigned char*, HPHP::JIT::TReqInfo&) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/jit/back-end-x64.cpp:113
#12 HPHP::JIT::MCGenerator::enterTC(unsigned char*, void*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/rds-header.h:73
#13 HPHP::JIT::MCGenerator::enterTCAfterPrologue(unsigned char*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/jit/mc-generator.h:236
#14 HPHP::ExecutionContext::enterVMAtFunc(HPHP::ActRec*, HPHP::ExecutionContext::StackArgsState) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/bytecode.cpp:1883
#15 HPHP::ExecutionContext::enterVM(HPHP::ActRec*, HPHP::ExecutionContext::StackArgsState, HPHP::Resumable*, HPHP::ObjectData*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/bytecode.cpp:1941
#16 HPHP::ExecutionContext::invokeFunc(HPHP::TypedValue*, HPHP::Func const*, HPHP::Variant const&, HPHP::ObjectData*, HPHP::Class*, HPHP::VarEnv*, HPHP::StringData*, HPHP::ExecutionContext::InvokeFlags) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/vm-regs.h:75
#17 HPHP::ExecutionContext::invokeUnit(HPHP::TypedValue*, HPHP::Unit const*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/vm/bytecode.cpp:2243
#18 invoke_file_impl at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/builtin-functions.cpp:736
#19 invoke_file at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/builtin-functions.cpp:747
#20 HPHP::include_impl_invoke(HPHP::String const&, bool, char const*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/builtin-functions.cpp:758
#21 HPHP::hphp_invoke(HPHP::ExecutionContext*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, HPHP::Array const&, HPHP::VRefParamValue const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool&, std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool, bool, bool) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/base/program-functions.cpp:1716
#22 HPHP::HttpRequestHandler::executePHPRequest(HPHP::Transport*, HPHP::RequestURI&, HPHP::SourceRootInfo&, bool) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/server/http-request-handler.cpp:379
#23 HPHP::HttpRequestHandler::handleRequest(HPHP::Transport*) at /tmp/tmp.NDtSUGa2KF/hphp/runtime/server/http-request-handler.cpp:289
#24 HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits>::doJobImpl(std::shared_ptr<HPHP::FastCGIJob>, bool) at /usr/include/c++/4.8/bits/basic_string.h:539
#25 HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits>::doJob(std::shared_ptr<HPHP::FastCGIJob>) at /usr/include/c++/4.8/bits/shared_ptr_base.h:545
#26 HPHP::JobQueueWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::Server*, true, false, HPHP::JobQueueDropVMStack>::start() at /usr/include/c++/4.8/bits/shared_ptr_base.h:545
#27 HPHP::AsyncFunc<HPHP::ServerWorker<std::shared_ptr<HPHP::FastCGIJob>, HPHP::FastCGITransportTraits> >::run_(void*) at /tmp/tmp.NDtSUGa2KF/hphp/util/async-func.h:206
#28 HPHP::AsyncFuncImpl::threadFuncImpl() at /tmp/tmp.NDtSUGa2KF/hphp/util/async-func.cpp:140
#29 HPHP::AsyncFuncImpl::ThreadFunc(void*) at /tmp/tmp.NDtSUGa2KF/hphp/util/async-func.cpp:53
#30 start_thread at /build/buildd/eglibc-2.19/nptl/pthread_create.c:312
#31 clone at /build/buildd/eglibc-2.19/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:113
29909 getrusage(0x1 /* RUSAGE_??? */, {ru_utime={7, 897743}, ru_stime={4, 171152}, ...}) = 0
29909 write(15, "56e4c05 d5 PHP::/home/sites/choobasic/web/libraries/joomla/application/module/helper.php::JModuleHelper::_load\n", 111) = 111
29909 getrusage(0x1 /* RUSAGE_??? */, {ru_utime={7, 897793}, ru_stime={4, 171205}, ...}) = 0
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 mkdir("/home/sites/choobasic/web/administrator/cache/com_modules", 0777) = -1 ENOENT (No such file or directory)
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 mkdir("/home/sites/choobasic/web/administrator/cache/com_modules", 0777) = -1 ENOENT (No such file or directory)
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 mkdir("/home/sites/choobasic/web/administrator/cache/com_modules", 0777) = -1 ENOENT (No such file or directory)
29909 stat("/home/sites/choobasic/web/administrator/cache/com_modules", 0x7fc615ff5120) = -1 ENOENT (No such file or directory)
29909 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x8} ---
29909 rt_sigaction(SIGSEGV, {SIG_DFL, [SEGV], SA_RESTORER|SA_RESTART, 0x7fc627c90000}, {0xe93a80, [SEGV], SA_RESTORER|SA_RESTART, 0x7fc627c90000}, 8) = 0

/etc/hhvm/php.ini

; php options

; hhvm specific 
hhvm.log.level = Error | Warning | Info | Verbose
hhvm.log.no_silencer = true
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
; hhvm.mysql.typed_results = false
hhvm.log.use_log_file = true
hhvm.log.use_syslog = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.log.injected_stack_trace = true
hhvm.log.native_stack_trace = true
hhvm.log.header = false
hhvm.log.max_messages_per_request = 1

hhvm.debug.full_backtrace = true
hhvm.debug.server_stack_trace = true
hhvm.debug.server_error_message = true
hhvm.debug.translate_source = true

/etc/hhvm/server.ini

; php options

pid = /var/run/hhvm/pid

; hhvm specific 

hhvm.server.port = 9000
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
@vkopitsa vkopitsa changed the title Segmentation fault Segfault after the upgrade from 3.1 to 3.2. Aug 27, 2014
@paulbiss
Copy link
Contributor

paulbiss commented Sep 9, 2014

It would help if you could construct a small isolated test that reproduces your crash, there's not a lot to go on here with just the stacktrace.

@fredemmott
Copy link
Contributor

Do you still have this issue on 3.3.0 ? (released last Friday)

@paulbiss
Copy link
Contributor

@photodude
Copy link
Contributor

@vkopitsa Joomla staging now passes unit tests on HHVM 3.15.3 and the pre-release 3.7.0 Alpha 1 should be testable for developer site preview with HHVM 3.15.3+

facebook-github-bot pushed a commit that referenced this issue May 3, 2024
Summary:
NOTE: If your `hg bisect` brings you here & the error you are seeing looks like ` expected Result<&PyAny, PyErr>, found Result<Bound<'_, PyAny>, PyErr>` then see these  [migration notes](https://pyo3.rs/v0.21.0/migration.html#from-020-to-021) for the fix or click on `fbcode/security/ace/pyo3/authz.rs` or similar files from bellow to see what the fix is!

In order to upgrade `pyo3` to [`0.21.1`](https://github.com/PyO3/pyo3/releases/tag/v0.21.1), the following had to take place:

## [PyO3]
* Address [migration notes](https://pyo3.rs/v0.21.0/migration.html#from-020-to-021) for `Bound<'py, T>`
* Address [#3595](PyO3/pyo3#3595) - this is done in a crude way for now since there are many call sites depending on `fbcode/dba/rust/common/service_address/py/pyo3_conversion_helper.rs` which would require a more thorough review.
* Address [#3821](PyO3/pyo3#3821) - `pyo3-build-config` is now dependent on and used by PyO3 macros. Currently, the only thing that gets checked is `abi3` compatibility. To address that, we introduce a fixup for that automatically generate `pyo3-build-config*.txt` configuration files, given an `fbsource` Python version. We are tryin to stay as close to `pyo3-build-config*.txt` spec as possible even though only a single bool from that file is ever since there is validation for the other fields but also to future proof future changes. By also generating this file ourselves, we prevent PyO3 from attempting to locate a Python interpreter some other way which seems to start leaking into the PyO3 API as an implementation choice already.

## [PyPi + Rust]
* Upgrade `orjson` to [`3.10.1`](https://github.com/ijl/orjson/releases/tag/3.10.1)
  * Added `README.md` notes for future upgrades
* Upgrade `py-polars` to [`0.20.22`](https://github.com/pola-rs/polars/releases/tag/py-0.20.22)
  * Removed `py-polars` and `polars` from `target_os = "windows"`. The `third-party/pypi/polars` Python extension has only been supported for Mac and Linux for a while now so its only natural to do that on the Rust side as well. What is more, `polars-util` is bringing in `stacker = = "0.1.14"` which does not build on Windows mostly because its using a much more recent version of `libc` than we use in `third-party/rust` (see P1228807344)
* Upgrade `pydantic-core` to [`2.18.2`](https://github.com/pydantic/pydantic-core/releases/tag/v2.18.2)
  *  Removed old `third-party/pypi/pydantic-core` versions
* Upgrade `safetensors` to [`0.4.3`](https://github.com/huggingface/safetensors/releases/tag/v0.4.3)
* Patch `third-party/pypi/cryptography/41.0.7` to account for PyO3's [#2975](PyO3/pyo3#2975) (`0.19.0`) where `pyo3::once_cell` was renamed to `pyo3::sync` (see D56826865)
* Upgrade `tokenizers` and `tokenizers-python` to [`0.19.1`](https://github.com/huggingface/tokenizers/releases/tag/v0.19.1)
  * Removed old `third-party/pypi/tokenizers` versions
  * Fixed `third-party/pypi/tokenizers/BUCK`
  * Migrated `third-party/pypi/tokenizers/0.19.1/BUCK` to mirror other Python packages that bind to Rust crates e.g. `libcst`, `polars` etc.
  * Removed Windows support from `third-party/pypi/tokenizers`

## [Rust]
* Upgrade `indexmap` to [`2.2.6`](https://github.com/indexmap-rs/indexmap/releases/tag/2.2.6)
  * Both latest `pydantic-core` and `c2pa` depend on `serde_json > 1.0.112` which brings in `indexmap = 2.2.1`. The latter has deprecated `.take` and `.remove` on both `IndexMap` and `IndexSet` leading to a bunch of errors (see bellow), all addressed:

```bash
error: use of deprecated method `indexmap::set::IndexSet::<T, S>::take`: `take` disrupts the set order -- use `swap_take` or `shift_take` for explicit behavior.
  --> fbcode/hphp/hack/src/package/types.rs:76:16
   |
76 |         self.0.take(value)
   |                ^^^^
   |
   = note: `-D deprecated` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(deprecated)]`
```

Reviewed By: capickett

Differential Revision: D56671179

fbshipit-source-id: 3ae69c069b7f005570c1a06d37194cf056282a18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants