Welcome to sigtrap_handler - please drive carefully

Welcome to sigtrap_handler - please drive carefully

Welcome to sigtrap_handler - please drive carefully. When I left you last time we'd got as far as genesis - the process that generates the initial core file. Since then

  1. rewrote bits of call_into_lisp (assembler thing that calls the first lisp function) to expect its arguments passed in registers and returned in other registers a la x86-64 calling convention. Then it jumped into lisp and executed 4 instructions or so

  2. before hitting a RIP-relative move instruction which I don't remember writing. Ah, so there are bits of the addressing mode that have been stolen for this and I need a SIB byte if I want the previous behahiour

  3. and, because I am thick, I was encoding the register number mod 8 instead of mod 16, so using rax when I wanted rbp (uh, really. The sbcl x86-64 assembler inherits the cmucl x86 assembler's decision to represent registers as 0,2,4,6... instead of 0,1,2,3... apparently because it makes the al+ah=ax overlap easier to deal with).

  4. observed that there were sequences of 0 bytes in random places. Eventually realised I was writing 64 bit immediate constants out for opcodes that only want 32 bit immediates (which is almost all the instructions that take immediates at all, in fact). So, restored the fixup vector to 32 bits in width

  5. which turned up a bunch of other places that I'd unthinkingly widened to 64 bits but which really shouldn't be: many VOPs with the /C (constant) modifier are using unsigned-num as an argument type, which causes the backend to attempt to use them for anything up to 64 bits even though the instructions they use can only cope with 32. So, fixed lots of those

  6. fixed up some of the iffier code for accessing ucontexts in the runtime
This is SBCL 0.8.7.25, an implementation of ANSI Common Lisp.

More information about SBCL is available at <http://www.sbcl.org/>. SBCL is free software, provided as is, with absolutely no warranty. It is mostly in the public domain; some portions are provided under BSD-style licenses. See the CREDITS and COPYING files in the distribution for more information. internal error #31 SC: 14, Offset: 22 0x7fbfffef60: even fixnum: 137170516952 fatal error encountered in SBCL pid 8253: internal error too early in init, can't recover

Internal error 31 is apparently "UNKNOWN_KEY_ARG_ERROR", which I must admit is not what I was expecting. Usually it's "object is not type foo".


Comments?

This blog has no comment-publishing facility: it's all done by hand. Feedback is welcome, though: if you would like to get in touch, email me on comment2010 @ telent . net and I will publish your thoughts (unless you tell me you don't want me to) as an addendum to the article, provided only that in my view they are interesting, amusing, relevant, accurate, or (best) some combination of the four. Relevant links are welcome in support of your argument: spam and untargeted requests for help are not.

telent netowrks

Geeky stuff about what I do. Many include Lisp, Android, Javascript, Linux and matters arising. For my other personality (less tech and more skating/cycling), see coruskate