On Thu, May 01, 2014 at 08:47:49PM +0000, Peter J. Philipp wrote:
> Hi list,
>
> earlier I sent an email to the list complaining about SIGBUS's in a program
> of mine. With the generous help from Otto Moerbeek I was able to isolate the
> problem to the queue(3) SLIST_FOREACH() macros in my program that caused the
> SIGBUS's.
>
> Basically using SLIST_FOREACH() and removing a node in the linked list causes
> a use after free, which OpenBSD-current looks for and handles. The solution
> to this was replacing the SLIST_FOREACH with SLIST_FOREACH_SAFE() which takes
> an extra variable. Sample code that Otto pointed me to is in
> /usr/src/usr.sbin/slowcgi.
>
> After I fixed my program it ran smoothly again on -current and the SIGBUS is
> gone. I'm very grateful and thankful that my hardware indeed was not defect.
> Thanks Otto!
>
> Have a good remaining May 1st!
>
> -peter
I'd like to add that changes to malloc in -current triggered this.
More specifically, a "light" version of J is now enabled by default,
it really helps spotting bugs, as Peter experienced.
-Otto