{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/hhvm/issues/4979","labels_url":"https://api.github.com/repos/facebook/hhvm/issues/4979/labels{/name}","comments_url":"https://api.github.com/repos/facebook/hhvm/issues/4979/comments","events_url":"https://api.github.com/repos/facebook/hhvm/issues/4979/events","html_url":"https://github.com/facebook/hhvm/issues/4979","id":60263110,"number":4979,"title":"assertion failure in IMPLEMENT_CNS_VAL","user":{"login":"rrh","id":1577878,"avatar_url":"https://avatars.githubusercontent.com/u/1577878?v=3","gravatar_id":"","url":"https://api.github.com/users/rrh","html_url":"https://github.com/rrh","followers_url":"https://api.github.com/users/rrh/followers","following_url":"https://api.github.com/users/rrh/following{/other_user}","gists_url":"https://api.github.com/users/rrh/gists{/gist_id}","starred_url":"https://api.github.com/users/rrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrh/subscriptions","organizations_url":"https://api.github.com/users/rrh/orgs","repos_url":"https://api.github.com/users/rrh/repos","events_url":"https://api.github.com/users/rrh/events{/privacy}","received_events_url":"https://api.github.com/users/rrh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/hhvm/labels/crash","name":"crash","color":"e63737"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-08T16:08:09Z","updated_at":"2015-03-09T03:06:35Z","closed_at":null,"body":"Compiling and then executing a supposedly identical debug build on some, but not all, of my Ubuntu 14.04 devel systems is now taking an assertion failure in IMPLEMENT_CNS_VAL in hphp/runtime/vm/jit/type-inl.h on every run of the program.  Here's the source code:\r\n  https://github.com/facebook/hhvm/blame/master/hphp/runtime/vm/jit/type-inl.h#L337 \r\nIt is the expansion of `IMPLEMENT_CNS_VAL(Cls, cls,  const Class*)`, and the second (right hand side) of the && is failing, eg `m_hasConstVal` is not true.\r\n```\r\n#define IMPLEMENT_CNS_VAL(TypeName, name, valtype)  \\\r\n  inline valtype Type::name##Val() const {          \\\r\n    assert(*this <= TypeName && m_hasConstVal);     \\\r\n    return m_##name##Val;                           \\\r\n  }\r\n```\r\nWhat's annoying is that this seems to have recently cropped up, and that only some of my Ubuntu dev machines have this problem, but not all.  This is even after removing all build products and rebuilding from scratch.\r\n\r\nIs this hunk of code somehow sensitive to the link order, constructor firing order, or ... that would in turn be sensitized by minor changes in the compiler?  Is it sensitive to the contents of the hhbc cache?\r\n\r\nHere's the top of the stack trace:\r\n```\r\n#4  0x0000000003b758a5 in HPHP::jit::Type::clsVal (this=0x7fffffffb370) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/type-inl.h:347\r\n#5  0x0000000003c93c94 in HPHP::jit::SSATmp::clsVal (this=0x7fffe144ca88) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ssa-tmp.h:57\r\n#6  0x0000000003d8895a in HPHP::jit::(anonymous namespace)::allocObjReturn (inst=0x7fffe144ce38) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ir-instruction.cpp:320\r\n#7  0x0000000003d89073 in HPHP::jit::outputType (inst=0x7fffe144ce38, dstId=0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ir-instruction.cpp:438\r\n#8  0x00000000041a575e in HPHP::jit::SSATmp::setInstruction (this=0x7fffe144cef8, inst=0x7fffe144ce38, dstId=0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ssa-tmp.cpp:31\r\n#9  0x00000000041a572c in HPHP::jit::SSATmp::SSATmp (this=0x7fffe144cef8, opndId=9, i=0x7fffe144ce38, dstId=0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ssa-tmp.cpp:26\r\n#10 0x0000000003bb57f4 in HPHP::jit::IRUnit::clone (this=0x7fffffffbff8, old=0x7fffffffb8a0, dst=0x0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ir-unit-inl.h:206\r\n#11 0x0000000004184285 in HPHP::jit::IRBuilder::__lambda80::operator() (__closure=0x7fffffffb640) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ir-builder.cpp:627\r\n#12 0x0000000004184739 in HPHP::jit::IRBuilder::optimizeInst (this=0x7fffe1abe600, inst=0x7fffffffb8a0, doClone=HPHP::jit::IRBuilder::Yes, srcBlock=0x0, idoms=...)\r\n    at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/ir-builder.cpp:686\r\n#13 0x0000000003c66e95 in HPHP::jit::irgen::detail::genInstruction (env=..., inst=0x7fffffffb8a0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/irgen.cpp:118\r\n#14 0x0000000003be02c6 in HPHP::jit::SSATmp* HPHP::jit::irgen::gen<HPHP::jit::SSATmp*&>(HPHP::jit::HTS&, HPHP::jit::Opcode, HPHP::jit::SSATmp*&)::{lambda(HPHP::jit::IRInstruction*)#1}::operator()(HPHP::jit::IRInstruction*) const (__closure=0x7fffffffb970, inst=0x7fffffffb8a0) at /home/rrh/dev/hhvm/hphp/runtime/vm/jit/irgen.h:63\r\n#15 0x0000000003bea55e in HPHP::jit::irunit_detail::InstructionBuilder<HPHP::jit::SSATmp*, HPHP::jit::SSATmp* HPHP::jit::irgen::gen<HPHP::jit::SSATmp*&>(HPHP::jit::HTS&, HPHP::jit::O---Type <return> to continue, or q <return> to quit---\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/hhvm/issues/comments/77793969","html_url":"https://github.com/facebook/hhvm/issues/4979#issuecomment-77793969","issue_url":"https://api.github.com/repos/facebook/hhvm/issues/4979","id":77793969,"user":{"login":"rrh","id":1577878,"avatar_url":"https://avatars.githubusercontent.com/u/1577878?v=3","gravatar_id":"","url":"https://api.github.com/users/rrh","html_url":"https://github.com/rrh","followers_url":"https://api.github.com/users/rrh/followers","following_url":"https://api.github.com/users/rrh/following{/other_user}","gists_url":"https://api.github.com/users/rrh/gists{/gist_id}","starred_url":"https://api.github.com/users/rrh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rrh/subscriptions","organizations_url":"https://api.github.com/users/rrh/orgs","repos_url":"https://api.github.com/users/rrh/repos","events_url":"https://api.github.com/users/rrh/events{/privacy}","received_events_url":"https://api.github.com/users/rrh/received_events","type":"User","site_admin":false},"created_at":"2015-03-09T03:06:35Z","updated_at":"2015-03-09T03:06:35Z","body":"Commit https://github.com/facebook/hhvm/commit/eb0acf6890bc3900e746ebcc89acf34eadb85c48 is implicated.\r\n\r\nI did a git bisect on ubuntu 14.04 system compiled with debugging (just -ggdb), and then a linear search of commits just before this was committed to end up at this commit.  Each step of the discovery process I used a private script to clean out all(?) build products and rebuild from scratch."}}