[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug in stackchk.h
From: |
Neil Jerram |
Subject: |
Re: bug in stackchk.h |
Date: |
Sun, 17 Jan 2010 21:44:52 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Ivan Shcherbakov <address@hidden> writes:
> Hi, All,
>
> There is a bug in libguile/stackchk.h file. In some cases, when
> integer value of the stack pointer is less than stack checking limit,
> false positives are produced.
>
> The following code is responsible for the problem:
> # define SCM_STACK_OVERFLOW_P(s)\
> (SCM_STACK_PTR (s) \
> < (SCM_I_CURRENT_THREAD->base - SCM_STACK_LIMIT))
>
> When SCM_I_CURRENT_THREAD->base < SCM_STACK_LIMIT holds,
> the last part of the exception produces an overflow and the entire
> expression holds even when no stack overflow occurs.
>
> To fix the problem, the SCM_STACK_OVERFLOW() should be replaced by the
> following one:
>
> # define SCM_STACK_OVERFLOW_P(s)\
> ((SCM_I_CURRENT_THREAD->base - SCM_STACK_PTR (s)) \
> > SCM_STACK_LIMIT)
>
> This ensures that the difference between the stack base and the
> examined local variable address is always computed correctly
> regardless the integer value of the stack pointer.
That all makes sense, but are you seeing this problem in practice?
Thanks,
Neil
- bug in stackchk.h, Ivan Shcherbakov, 2010/01/06
- Re: bug in stackchk.h,
Neil Jerram <=