: I think you may be mis-remembering the bug. IIRC the 32K bug was in
sys_brk()
: and was related to the type of the argument being signed instead of
unsigned.

I think you're right.  The original bug can be reproduced by having
a small ELKS program that malloc's memory.  We should be able
to malloc almost 64k.  The previous version would fail whenever
the DS offset > 32k.

Greg


: 
: Thanks for keeping a look out. I am glad someone reads the cvs commit
messages.
: 
: Al
: 
: int sys_brk(len)
: __pptr len;
: {
:         register __ptask currentp = current;
: 
:         if (len < currentp->t_enddata || 
:             (len > (currentp->t_endseg - HEAP_LIMIT))) {
:                 return -ENOMEM; 
:         }
: 
:         currentp->t_endbrk = len;
:         return 0;
: }
: 
: 
: > 
: > Regards,
: > 
: > Greg
: > 
: > :   +/*
: > :   + * We only need to do this as long as we support old format
binaries
: > :   + * that grow stack and heap towards each other
: > :   + */
: > :    void stack_check()
: > :    {
: > :    register __ptask currentp = current;
: > :   - if (currentp->t_regs.sp < currentp->t_endbrk)
: > :   - {
: > :   + if ((currentp->t_begstack > currentp->t_enddata) &&
: > :   +     (currentp->t_regs.sp < currentp->t_endbrk)) {
: > :    printk("STACK (%d) ENTERED BSS (%ld) - PROCESS TERMINATING\n",
: > currentp->t_regs.sp, currentp->t_endbrk);
: > :    do_exit(SIGSEGV);
: > :    }
: > :
: > :
: > :

Reply via email to