{"issue":{"user":{"id":147281,"login":"jckarter","url":"https://api.github.com/users/jckarter","gravatar_id":"b0dcaf0f709216492c505d3ec167003c","avatar_url":"https://secure.gravatar.com/avatar/b0dcaf0f709216492c505d3ec167003c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":null,"created_at":"2011-12-14T21:02:58Z","title":":c crash","state":"open","updated_at":"2011-12-20T20:19:26Z","labels":[],"id":2558387,"html_url":"https://github.com/slavapestov/factor/issues/457","closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"From http://builds.factorcode.org/report?os=linux&cpu=x86.64 :\r\n\r\n```\r\n==== resource:core/kernel/kernel-tests.factor\r\n\r\nresource:core/kernel/kernel-tests.factor: 75\r\n\r\nUnit Test: { [ ] [ :c ] }\r\n\r\nMemory protection fault at address 2986b\r\n[Traceback]\r\n```\r\n\r\nCan't reproduce locally, and I don't see it in the other build reports. Could be either sporadic or linux-x86-64-specific.","number":457,"url":"https://api.github.com/repos/slavapestov/factor/issues/457","comments":5,"assignee":null},"comment":{"user":{"id":147281,"login":"jckarter","url":"https://api.github.com/users/jckarter","gravatar_id":"b0dcaf0f709216492c505d3ec167003c","avatar_url":"https://secure.gravatar.com/avatar/b0dcaf0f709216492c505d3ec167003c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2011-12-20T20:19:26Z","updated_at":"2011-12-20T20:19:26Z","id":3224665,"body":"Found the problem. `call` gets jitted weird:\r\n\r\n```\r\n0x92be3c22 in mach_msg_trap ()\r\n0x6df5450: mov    %eax,0x6b99000\r\n0x6df5455: sub    $0x1c,%esp\r\n0x6df5458: mov    %eax,0x6b99000\r\n0x6df545d: add    $0x1c,%esp\r\n0x6df5460: mov    0x0(%esi),%ecx\r\n0x6df5463: mov    %ecx,%eax\r\n0x6df5465: and    $0xf,%ecx\r\n0x6df5468: shl    $0x4,%ecx\r\n0x6df546b: cmp    $0x70,%ecx\r\n0x6df546e: jne    0x6df5477\r\n0x6df5474: mov    -0x3(%eax),%ecx\r\n0x6df5477: mov    $0x610342,%eax\r\n0x6df547c: mov    %ecx,%ebx\r\n0x6df547e: shr    $0x1,%ebx\r\n0x6df5481: and    $0x7c,%ebx\r\n0x6df5484: add    $0x6,%eax\r\n0x6df5487: add    %ebx,%eax\r\n0x6df5489: cmp    %ecx,(%eax)\r\n0x6df548b: jne    0x6df549f\r\n0x6df5491: mov    $0x6a0c2e54,%ecx\r\n0x6df5496: addl   $0x1,(%ecx)\r\n0x6df5499: mov    0x4(%eax),%eax\r\n0x6df549c: jmp    *0x18(%eax)\r\n0x6df549f: sub    $0x1c,%esp\r\n0x6df54a2: mov    $0x610302,%eax\r\n0x6df54a7: add    $0x4,%esi\r\n0x6df54aa: mov    %eax,(%esi)\r\n0x6df54ac: mov    $0x0,%eax\r\n0x6df54b1: add    $0x4,%esi\r\n0x6df54b4: mov    %eax,(%esi)\r\n0x6df54b6: mov    $0x610342,%eax\r\n0x6df54bb: add    $0x4,%esi\r\n0x6df54be: mov    %eax,(%esi)\r\n0x6df54c0: call   0x6e015f0\r\n0x6df54c5: add    $0x1c,%esp\r\n0x6df54c8: mov    (%esi),%eax\r\n```\r\n\r\nIt looks like the epilog gets generated immediately after the prolog. If an error happens in the middle of `call`, such as in the `[ 1 [ call ] dip ]` test from the `kernel` tests, then the callstack walker gets corrupted because, although the return address still points into `call`, there's no stack frame set up for `call`. @slavapestov Do you know why `call` gets generated with the epilog immediately after the prolog like this?","url":"https://api.github.com/repos/slavapestov/factor/issues/comments/3224665"},"action":"created"}