On Mon, Aug 22, 2016 at 04:15:16PM +0200, Gregor Best wrote:
> Hi,
>
> On Mon, Aug 22, 2016 at 08:21:08AM +0200, Otto Moerbeek wrote:
> > [...]
> > New diff posted in http://www.drijf.net/openbsd/malloc.
> >
> > The intention is that this is close to commitable. But while a
> > straight merge of most recent diff with the current src, a bug
> > might have crept in. So beware etc.
> > [...]
>
> After applying this to a clean /usr/src/lib/libc, I get
>
> cc -O2 -pipe -g -Wall -g -Werror -Wshadow
> -Werror-implicit-function-declaration -Wsign-compare
> -I/usr/src/lib/librthread -include namespace.h
> -I/usr/src/lib/librthread/../libc/arch/amd64
> -I/usr/src/lib/librthread/../libc/include -c rthread.c -o rthread.o
> cc1: warnings being treated as errors
> rthread.c: In function '_rthread_init':
> rthread.c:212: warning: assignment from incompatible pointer type
> rthread.c:213: warning: assignment from incompatible pointer type
>
> when building librthread. libc builds fine but stuff like firefox and
> chrome die with
>
> chrome(97224) in unknown error: free() called before allocation
> Abort trap (core dumped)
>
> and stack traces that look like this:
>
> (gdb) bt
> #0 0x00000c27475c9aaa in thrkill () at <stdin>:2
> #1 0x00000c27475e6589 in *_libc_abort () at
> /usr/src/lib/libc/stdlib/abort.c:52
> #2 0x00000c27475b8239 in wrterror (d=0x0, msg=0xc274773b2d8 "free() called
> before allocation", p=0x0)
> at /usr/src/lib/libc/stdlib/malloc.c:307
> #3 0x00000c27475b9746 in free (ptr=Variable "ptr" is not available.) at
> /usr/src/lib/libc/stdlib/malloc.c:1390
> #4 0x00000c2760446c70 in pthread_attr_destroy (attrp=0x7f7ffffc3850) at
> /usr/src/lib/librthread/rthread_attr.c:64
> [... other stuff omitted from here on ...]
>
> Is the diff (I chose malloc-20160822.dif) missing a librthread change?
Hmm, indeed, looking into it.
-Otto
>
> --
> Gregor
> --
>
> For those who like this sort of thing, this is the sort of thing they like.
> -- Abraham Lincoln