Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Mar 2009 05:03:53 +0300
From:      Anonymous <swell.k@gmail.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-current@freebsd.org, dchagin@freebsd.org
Subject:   Re: lang/sbcl consumes all available memory and dies
Message-ID:  <86ab7koqgm.fsf@gmail.com>
References:  <864oxtuzct.fsf@gmail.com> <20090316194541.GO41617@deviant.kiev.zoral.com.ua> <86ljr5p3f0.fsf@gmail.com> <20090316215205.GS41617@deviant.kiev.zoral.com.ua> <868wn5qaca.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
(oops, vague wording)

Anonymous <swell.k@gmail.com> writes:
> Kostik Belousov <kostikbel@gmail.com> writes:
>> Please, try this patch.
>>
>> diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c
>> index f2bdcf5..5604ea5 100644
>> --- a/sys/kern/imgact_elf.c
>> +++ b/sys/kern/imgact_elf.c
>> @@ -1330,14 +1330,14 @@ __elfN(check_note)(struct image_params *imgp, Elf_Brandnote *checknote,
>>      int32_t *osrel)
>>  {
>>  	const Elf_Note *note, *note_end;
>> -	const Elf32_Phdr *phdr, *pnote;
>> -	const Elf32_Ehdr *hdr;
>> +	const Elf_Phdr *phdr, *pnote;
>> +	const Elf_Ehdr *hdr;
>>  	const char *note_name;
>>  	int i;
>>  
>>  	pnote = NULL;
>> -	hdr = (const Elf32_Ehdr *)imgp->image_header;
>> -	phdr = (const Elf32_Phdr *)(imgp->image_header + hdr->e_phoff);
>> +	hdr = (const Elf_Ehdr *)imgp->image_header;
>> +	phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
>>  
>>  	for (i = 0; i < hdr->e_phnum; i++) {
>>  		if (phdr[i].p_type == PT_NOTE) {
>
> Double-checked on more recent revision (r189900) under qemu-amd64
> with/without the patch. The problem disappears.
                                             ^^^^^^^
It disappears only *after* applying your patch.

>
> Don't know about i386, though.

Just tested under qemu-i386. Looks like it's not affected.
Anyway, *with* the patch sbcl works, too.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ab7koqgm.fsf>