Lisp HUG Maillist Archive

Error from within C function

I'm calling a C function using win32+Lispworks Pro 5.12 +CFFI. What seems to be 
happening is that the C function fails and Lispworks reports the following;

Error: Exception C0000005 [flags 0] at 5F4C4453 
eax     8010 ebx  154FDD0 ecx 5F4C4453 edx   962008
esp  154FDB8 ebp  154FDC4 esi 21AD9723 edi   928A10
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

A backtrace produces the following;

CL-USER 5 : 1 > :b
Call to (SUBFUNCTION SYSTEM::|%FOREIGN-CALLABLE/fault_handler_on_c_stack| 
(FLI:DEFINE-FOREIGN-CALLABLE "fault_handler_on_c_stack"))
Call to FLI::FOREIGN-CALLABLE-ENTRY-POINT-AUX-NESTED
Call to LISPBUILDER-SDL-CFFI::|%cffi-foreign-function/SDL-CONVERT-AUDIO|
Call to (METHOD LISPBUILDER-SDL-EXAMPLES::BUILD-AUDIO-CVT (LISPBUILDER-SDL-
EXAMPLES::AUDIO LISPBUILDER-SDL-EXAMPLES::MIXER))
Call to LISPBUILDER-SDL-EXAMPLES::MIXER-TEST
Call to EVAL
Call to CAPI::CAPI-TOP-LEVEL-FUNCTION
Call to CAPI::INTERACTIVE-PANE-TOP-LOOP
Call to (SUBFUNCTION MP::PROCESS-SG-FUNCTION MP::INITIALIZE-PROCESS-STACK)

I can't reproduce this error when I run the exact same code using SBCL/win32 or 
CLISP/win32.

Does the above trace or error mean anything to anyone?

Thanks,
- Luke


Re: Error from within C function

Appologies, please ignore. I was passing a C struct of the incorrect size  
into the C function, causing unallocated memory to be overwritten.

- Luke

On Mon, 05 Jan 2009 18:44:31 -0800, Luke Crook <luke@balooga.com> wrote:

>
> I'm calling a C function using win32+Lispworks Pro 5.12 +CFFI. What  
> seems to be
> happening is that the C function fails and Lispworks reports the  
> following;
>
> Error: Exception C0000005 [flags 0] at 5F4C4453
> eax     8010 ebx  154FDD0 ecx 5F4C4453 edx   962008
> esp  154FDB8 ebp  154FDC4 esi 21AD9723 edi   928A10
>   1 (abort) Return to level 0.
>   2 Return to top loop level 0.
>
> A backtrace produces the following;
>
> CL-USER 5 : 1 > :b
> Call to (SUBFUNCTION SYSTEM::|%FOREIGN-CALLABLE/fault_handler_on_c_stack|
> (FLI:DEFINE-FOREIGN-CALLABLE "fault_handler_on_c_stack"))
> Call to FLI::FOREIGN-CALLABLE-ENTRY-POINT-AUX-NESTED
> Call to LISPBUILDER-SDL-CFFI::|%cffi-foreign-function/SDL-CONVERT-AUDIO|
> Call to (METHOD LISPBUILDER-SDL-EXAMPLES::BUILD-AUDIO-CVT  
> (LISPBUILDER-SDL-
> EXAMPLES::AUDIO LISPBUILDER-SDL-EXAMPLES::MIXER))
> Call to LISPBUILDER-SDL-EXAMPLES::MIXER-TEST
> Call to EVAL
> Call to CAPI::CAPI-TOP-LEVEL-FUNCTION
> Call to CAPI::INTERACTIVE-PANE-TOP-LOOP
> Call to (SUBFUNCTION MP::PROCESS-SG-FUNCTION  
> MP::INITIALIZE-PROCESS-STACK)
>
> I can't reproduce this error when I run the exact same code using  
> SBCL/win32 or
> CLISP/win32.
>
> Does the above trace or error mean anything to anyone?
>
> Thanks,
> - Luke
>



Updated at: 2020-12-10 08:41 UTC