malloc: bug or feature ?

James R. Van Artsalen james at jrv.org
Fri Apr 9 17:37:20 PDT 2004


Peter Wemm wrote:

>>I haven't checked for equivalent bugs in other functions.
>>    
>>
>
>OK, this is embarresing :-)  Thanks!
>  
>

No, embarrassing is when you make the lead story on the front page of PC 
Week...  :-)

In lib/libc/amd64/gen/sigsetjmp.S, a call to _sigprocmask is made by 
__siglongjmp with a misaligned stack.

In libexec/rtld-elf/amd64/rtld_start.S procedure .rtld_start has me 
unsure: in 5.2.1-release this routine seems to end in a "jmp *%eax" with 
same %rsp as on entry.  But in version 1.5 in the CVS repository that 
"jmp *%eax" is reached with 16 extra bytes on the stack.  Is it possible 
that the "addq $8,%rsp" from 5.2.1-release should have been changed to 
"addq $16,%rsp" instead of deleted?

It's not clear to me what happens at the "call *%rbx" in 
lib/libc/amd64/gen/rfork_thread.S.  I guess the kernel created a stack 
and passed tos-4 is %rsi?  Probably no bug, but deserves a comment as to 
what userland is relying on.

There are a number of files under sys/ for things like interrupt 
vectors, etc.  I haven't looked at these since I don't know if the 
kernel stack is aligned, or where the input stacks come from.


More information about the freebsd-amd64 mailing list