Skip to content

Instantly share code, notes, and snippets.

@jmarrama
jmarrama / gist:6dd4f47edcef6b6ffc7e
Last active August 29, 2015 14:08
HHVM backtraces 7/11/2014
# 0 __restore_rt at sigaction.c:0
# 1 raise at /lib64/libc.so.6:0
# 2 abort at /lib64/libc.so.6:0
# 3 __assert_fail_base at interp.c:0
# 4 __assert_perror_fail at /lib64/libc.so.6:0
# 5 HPHP::Unit::offsetOf(unsigned char const*) const at /var/jenkins/workspace/Utility/Build-HHVM/hhvm_rpm/standalone_rpmbuild/BUILD/hhvm/hphp/runtime/vm/unit-inl.h:168
# 6 HPHP::createBacktrace(HPHP::BacktraceArgs const&) at /var/jenkins/workspace/Utility/Build-HHVM/hhvm_rpm/standalone_rpmbuild/BUILD/hhvm/hphp/runtime/base/backtrace.cpp:110
# 7 HPHP::debug_string_backtrace(bool, bool, long) at /var/jenkins/workspace/Utility/Build-HHVM/hhvm_rpm/standalone_rpmbuild/BUILD/hhvm/hphp/runtime/ext/std/ext_std_errorfunc.cpp:103
# 8 __restore_rt at sigaction.c:0
# 9 HPHP::jit::x64::CodeGenerator::cgInst(HPHP::jit::IRInstruction*) at /var/jenkins/workspace/Utility/Build-HHVM/hhvm_rpm/standalone_rpmbuild/BUILD/hhvm/hphp/runtime/vm/jit/code-gen-x64.cpp:274
@jmarrama
jmarrama / gist:0ceb50f656c8d476a6e4
Last active August 29, 2015 14:01
HHVM backtraces 5/6/14
(gdb) bt
#0 0x00007f3211a73925 in raise () from /lib/libc.so.6
#1 0x00007f3211a75105 in abort () from /lib/libc.so.6
#2 0x000000000341c5d0 in HPHP::assert_fail (e=0x412572d "false", file=0x4125688 "/home/jmarrama/hhvm/hphp/runtime/vm/jit/unwind-x64.cpp", line=108,
func=0x4128dc0 <HPHP::JIT::(anonymous namespace)::install_catch_trace(_Unwind_Context*, _Unwind_Exception*, HPHP::InvalidSetMException*)::__PRETTY_FUNCTION__> "bool HPHP::JIT::{anonymous}::install_catch_trace(_Unwind_Context*, _Unwind_Exception*, HPHP::InvalidSetMException*)")
at /home/jmarrama/hhvm/hphp/util/assertions.cpp:33
#3 0x00000000028ccdc1 in HPHP::JIT::(anonymous namespace)::install_catch_trace (ctx=0x7f31cdd72850, exn=0x7f31b544b4a0, ism=0x0)
at /home/jmarrama/hhvm/hphp/runtime/vm/jit/unwind-x64.cpp:103
#4 0x00000000028cd355 in HPHP::JIT::(anonymous namespace)::tc_unwind_personality (version=1, actions=2, exceptionClass=5138137972254386944,
exceptionObj=0x7f31b544b4a0, context=0x7f31cdd72850) at /home/jmarrama/hhvm/hp
@jmarrama
jmarrama / gist:11231638
Last active August 29, 2015 14:00
HHVM backtraces 4/23
(gdb) bt
#0 0x00007f1c228e5925 in raise () from /lib/libc.so.6
#1 0x00007f1c228e7105 in abort () from /lib/libc.so.6
#2 0x00000000015a80c7 in HPHP::impl_assert_fail(char const*, char const*, unsigned int, char const*) ()
#3 0x0000000000e263af in HPHP::JIT::(anonymous namespace)::tc_unwind_personality(int, int, unsigned long, _Unwind_Exception*, _Unwind_Context*) ()
#4 0x00007f1c22c57383 in ?? () from /lib64/libgcc_s.so.1
#5 0x00007f1c22c57457 in _Unwind_Resume () from /lib64/libgcc_s.so.1
#6 0x0000000000ce79bc in HPHP::ExecutionContext::invokeFuncFew(HPHP::TypedValue*, HPHP::Func const*, void*, HPHP::StringData*, int, HPHP::TypedValue const*) ()
#7 0x0000000000abce76 in HPHP::ObjectData::invokeToString() ()
#8 0x00000000009e99cb in HPHP::tvCoerceParamToStringInPlace(HPHP::TypedValue*) ()
<?php
class A {
use B;
}
class C extends A {}
trait B {
}
$c = new C();
$a = new A();
var_dump($c instanceof A);
@jmarrama
jmarrama / gist:9259792
Created February 27, 2014 21:19
Array/Object deletion bt
hhvm: /home/jmarrama/hhvm/hphp/runtime/base/countable.h:76: void HPHP::assert_refcount_realistic_nz(int32_t): Assertion `count <= StaticValue || (uint32_t)count - 1 < (uint32_t)RefCountMaxRealistic' failed.
Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe09ff700 (LWP 9764)]
0x00007ffff06a9925 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: debuginfo-install hhvm-2.5.1-2.el6.x86_64
(gdb) bt
#0 0x00007ffff06a9925 in raise () from /lib64/libc.so.6
#1 0x00007ffff06ab105 in abort () from /lib64/libc.so.6
#2 0x00007ffff06a2a4e in __assert_fail_base () from /lib64/libc.so.6
<?php
ob_start();
/*
* Prototype : string session_id([string $id])
* Description : Get and/or set the current session id
* Source code : ext/session/session.c
*/
@jmarrama
jmarrama / gist:8427281
Created January 14, 2014 22:34
HHVM fastcgi backtrace
(gdb) bt
#0 tcache_dalloc_small (binind=<optimized out>, ptr=0x7fffe5b9d800, tcache=0x7fffe4a10000) at include/jemalloc/internal/tcache.h:403
#1 arena_dalloc (try_tcache=true, ptr=0x7fffe5b9d800, chunk=<optimized out>, arena=0x7fffed0000c0) at include/jemalloc/internal/arena.h:956
#2 idalloc (ptr=0x7fffe5b9d800) at include/jemalloc/internal/jemalloc_internal.h:840
#3 iqalloc (ptr=0x7fffe5b9d800) at include/jemalloc/internal/jemalloc_internal.h:852
#4 free (ptr=0x7fffe5b9d800) at src/jemalloc.c:1212
#5 0x000000000350c29b in folly::IOBuf::operator delete (ptr=0x7fffe5b9d800) at /home/vagrant/hhvm/hphp/third_party/folly/folly/experimental/io/IOBuf.cpp:82
#6 0x0000000002b5c7d2 in std::default_delete<folly::IOBuf>::operator() (this=0x7fffe5b4f0e0, __ptr=0x7fffe5b9d800)
at /opt/rh/devtoolset-2/root/usr/lib/gcc/x86_64-redhat-linux/4.8.1/../../../../include/c++/4.8.1/bits/unique_ptr.h:67
#7 0x0000000002b5b07d in std::unique_ptr<folly::IOBuf, std::default_delete<folly::IOBuf> >::~unique_ptr (this=0x7fffe5b
@jmarrama
jmarrama / gist:8326637
Created January 8, 2014 23:23
fastcgi segfault
(gdb) bt
#0 0x00007ffff046395a in __strchr_sse2 () from /lib64/libc.so.6
#1 0x00007ffff11479f6 in strchr (site_flag=0x24f9800, site_default=0x2504b20,
fname=0x1dc3d08 "/home/vagrant/hhvm/hphp/third_party/thrift/lib/cpp/async/TEventBase.h", verbose_level=11) at /usr/include/string.h:230
#2 VLOG2Initializer (site_flag=0x24f9800, site_default=0x2504b20, fname=0x1dc3d08 "/home/vagrant/hhvm/hphp/third_party/thrift/lib/cpp/async/TEventBase.h",
verbose_level=11) at src/vlog_is_on.cc:137
#3 google::InitVLOG3__ (site_flag=0x24f9800, site_default=0x2504b20,
fname=0x1dc3d08 "/home/vagrant/hhvm/hphp/third_party/thrift/lib/cpp/async/TEventBase.h", verbose_level=11) at src/vlog_is_on.cc:200
#4 0x00000000013c1f49 in apache::thrift::async::TEventBase::TEventBase() ()
#5 0x00000000013cbec9 in facebook::proxygen::WorkerThread::WorkerThread(apache::thrift::async::TEventBaseManager*) ()
@jmarrama
jmarrama / getlectures.sh
Created January 21, 2012 00:58
140 script getter
#!/bin/bash
url_prefix="http://www.stanford.edu/~ouster/cgi-bin/cs140-winter12/";
wget http://www.stanford.edu/~ouster/cgi-bin/cs140-winter12/lectures.php
grep -o 'lecture.php?topic=[A-Za-z]*' lectures.php | uniq -u > uniqlecs
for lecfile in `cat uniqlecs`;
do
lec_url=$url_prefix$lecfile