(last updated on Jun 2005)
Finally had some time to get back from the OpenBSD hackathon and take stock of what I worked on. It was pretty interesting one this year, as I went without having much idea of what to work on (unlike last year, when I had a mad backlog to catch up on). Some stuff I did during the week included:
-1on error, which means a signed
ssize_tis returned. However, they accept an unsigned value as the size of the buffer to process, which means they could potentially return a value outside the range of the return value. This means you have to check if the return is
-1, which indicates an error, and otherwise cast to a
size_tto correctly get the buffer size back. With the new atomicio, it always returns a
size_t, and returns
0to signal an error (with
errnocontaining the error, and
EPIPEbeing set for an
netbtsocket interface (much like
netinet6) to Bluetooth.
kerneltracejust accepts a regular expression and inserts a
printfin the function prologue which outputs the function name and any arguments passed into it. Had this idea when chatting with Marius, and it turned out to be very useful when trying to figure out dataflow in the Bluetooth stack (just compile with
make CC="/usr/local/bin/cilly --dokerneltrace --trace-regexp='ubt|ng_blue'"). The second one was even simpler;
randomvarsassigns a non-zero value to every local variable in a function call to help track down uninitialized-local-variable bugs. Heres one Chad Loder found in mg(1).
All in all, the hackathon re-motivated me to continue work on the OCaml-based daemons that David Scott and I have been hacking on. I don't want to be fixing random buffer or integer overflows in an OpenBSD hackathon 5 years from now; we need to move on to more high-level issues.