Correction to crash inside RtlCaptureStackBackTrace() + test case

Vitaliy Margolen wine-devel at
Sun Jan 23 12:26:08 CST 2011

On 01/23/2011 10:54 AM, André Hentschel wrote:
> further you should consider using IsBadReadPtr instead of try...except, but i'm not sure if that would work.
No, one should never ever use those functions. Even MS says they ave evil. 
Try .. except is the right thing to use here.

On 01/23/2011 10:20 AM, Janne Hakonen wrote:
> I created a new signal.c file for the test case under ntdll/tests since I couldn’t find more fitting place.
Not a good idea. Please put the test into rtl.c

> +static void test_pRtlCaptureStackBackTrace(void)
> +{
> +    ok(TRUE == get_back_trace_with_invalid_frame_pointer(),"get_back_trace_with_invalid_frame_pointer() failed\n" );
> +}
Please put ok() check inside get_back_trace_with_invalid_frame_pointer().

> +static void capture_stack_back_trace(void)
> +{
> +    void** callers = (void**) calloc(maxCallers, sizeof(void*));
> +    free(callers);
> +}
Please use HeapAlloc/HeapFree. Don't cast void pointers. Here you don't need 
to allocate anything, just use a stack variable.

Also you not checking the return value from RtlCaptureStackBackTrace(). 
Please do.


More information about the wine-devel mailing list