linuxolator: fatal trap 12 when compiling libX11

Alexander Leidinger Alexander at Leidinger.net
Wed Jan 17 07:03:17 UTC 2007


Quoting Scot Hetzel <swhetzel at gmail.com> (from Tue, 16 Jan 2007  
22:00:21 -0600):

> On 1/16/07, Divacky Roman <xdivac02 at stud.fit.vutbr.cz> wrote:
>> please test this patch:
>>
>> Index: linux_emul.c
>> ===================================================================
>> RCS file: /home/ncvs/src/sys/compat/linux/linux_emul.c,v
>> retrieving revision 1.12
>> diff -u -r1.12 linux_emul.c
>> --- linux_emul.c        7 Jan 2007 19:09:20 -0000       1.12
>> +++ linux_emul.c        16 Jan 2007 22:11:06 -0000
>> @@ -170,7 +170,8 @@
>>        EMUL_UNLOCK(&emul_lock);
>>
>>        EMUL_SHARED_WLOCK(&emul_shared_lock);
>> -       LIST_REMOVE(em, threads);
>> +       if (!LIST_EMPTY(em->shared->threads)

I didn't had a look at the code, but my first impression about this  
was, that it is trying to hide the problem. Currently I think it is  
either memory corruption, a race (inappropriate locking), or keeping a  
pointer when it should be cleaned/removed, or some memory is not  
initialized before inserting/using it somewhere.

> Wouldn't compile as shown above (complained about '->' when
> compiling), changed it to:
>
>             if (!LIST_EMPTY(&em->shared->threads))
>
> but now I'm getting:

> #10 0xffffffffa2cb3b2c in linux_proc_init (td=0xffffff002d1d9290,
> child=0x4f5c, flags=0x0)
>    at /usr/src/7x/sys-orig/modules/linux/../../compat/linux/linux_emul.c:138
> 138                     LIST_INSERT_HEAD(&em->shared->threads, em, threads);
> (kgdb) p &em->shared->threads
> $1 = (struct {...} *) 0xdeadc0dedeadc0e6
> (kgdb) p *em
> $3 = {
>  pid = 0xdeadc0de,
>  child_set_tid = 0x0,
>  child_clear_tid = 0x0,
>  shared = 0xdeadc0dedeadc0de,
>  pdeath_signal = 0xdeadc0de,
>  threads = {
>    le_next = 0xdeadc0dedeadc0de,
>    le_prev = 0xdeadc0dedeadc0de
>  }
> }

deadc0de means that the memory was freed before use.

Bye,
Alexander.

-- 
Lord, what fools these mortals be!
		-- William Shakespeare, "A Midsummer-Night's Dream"

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137


More information about the freebsd-emulation mailing list