Lisp HUG Maillist Archive

fli:free-foreign-object

Hi all,

I have a problem with fli:free-foreign-object and can't see my error. The
error seems to appear randomly. 

I use the following definition:

(fli:define-c-typedef SQLINTEGER   (:long))

Here is my debug session when I run my app. I have no idea, what maybe
wrong?

Any hints appreciated.

Andreas

P.S. Using LWW 4.4.6.0

*** EXCEPTION DATA ***
code c0000005  flags 00000000 address 7c920c3f
EIP 7c920c3f  ESP 0012fbcc  EBP 0012fbd8

Error: ** Processor Fault #xC0000005 at #x7C920C3F.
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other
options

CL-USER 4 : 1 > :b

Call to IO::FAULT-HANDLER-AUX
Call to FLI::FOREIGN-CALLABLE-ENTRY-POINT-AUX-NESTED
Call to FLI::QUICK-FREE
Call to FLI:FREE-FOREIGN-OBJECT
Call to ODBC::CLEAN-COMMAND
Call to TRANSFER
Call to DO-TABLE
Call to RUN
Call to SPECIAL::%EVAL-NOHOOK
Call to IV:PROCESS-TOP-LEVEL
Call to COMMON-LISP::MAIN
Call to MEMORY-MANAGER::INIT-WORLD

CL-USER 5 : 1 > :n

Call to FLI::FOREIGN-CALLABLE-ENTRY-POINT-AUX-NESTED

CL-USER 6 : 1 > :n

Call to FLI::QUICK-FREE

CL-USER 7 : 1 > :n

Call to FLI:FREE-FOREIGN-OBJECT

CL-USER 8 : 1 > fli::pointer ;; I guess the argument to free-foreign-object

#<Pointer to type ODBC::SQLINTEGER = #x00327C60> ;; looks good, I'd think

CL-USER 9 : 1 > (fli:dereference fli::pointer) ;; inspection looks good
either

-3

CL-USER 10 : 1 > (fli:pointer-address fli::pointer)

3308640

CL-USER 11 : 1 > (setf my-p fli::pointer)

#<Pointer to type ODBC::SQLINTEGER = #x00327C60>

CL-USER 12 : 1 > :a


CL-USER 13 > my-p

#<Pointer to type ODBC::SQLINTEGER = #x00327C60>

CL-USER 14 > (fli:free my-p) ;; should be possible to free a long (or not ?)

*** EXCEPTION DATA ***
code c0000005  flags 00000000 address 7c920c3f
EIP 7c920c3f  ESP 0012f928  EBP 0012f934

Error: ** Processor Fault #xC0000005 at #x7C920C3F.
  1 (abort) Return to level 0.
  2 Return to top loop level 0.

Type :b for backtrace, :c <option number> to proceed,  or :? for other
options

CL-USER 15 : 1 >


Re: fli:free-foreign-object

On Tue, 3 Oct 2006 01:19:13 +0200, "Andreas Thiele" <andreas@atp-media.de> wrote:

> CL-USER 14 > (fli:free my-p) ;; should be possible to free a long (or not ?)

Just to double-check: This is something you yourself allocated with
ALLOCATE-FOREIGN-OBJECT, right?


AW: fli:free-foreign-object

 
> -----Ursprüngliche Nachricht-----
> Von: owner-lisp-hug@lispworks.com 
> [mailto:owner-lisp-hug@lispworks.com] Im Auftrag von Edi Weitz
> Gesendet: Dienstag, 3. Oktober 2006 02:13
> An: Andreas Thiele
> Cc: lisp-hug@lispworks.com
> Betreff: Re: fli:free-foreign-object
> 
> 
> On Tue, 3 Oct 2006 01:19:13 +0200, "Andreas Thiele" 
> <andreas@atp-media.de> wrote:
> 
> > CL-USER 14 > (fli:free my-p) ;; should be possible to free 
> a long (or 
> > not ?)
> 
> Just to double-check: This is something you yourself 
> allocated with ALLOCATE-FOREIGN-OBJECT, right?
> 

Hi Edi,

thanks for the very quick response. I guess I just tracked the error down.
It was my mistake. I did a

(fli:with-dynamic-foreign-objects ()
  (fli:replace-foreign-object 
    old-object         
    (fli:convert-to-foreign-string v :external-format :latin-1 :allocation
:dynamic) 
    :nelems (length v)))

without checking the length of the old-object and definitely wrote longer
strings into prior allocated shorter ones. Thus I guess, my programm
destroyed adjacent fli structures which had consequences - very bad and
difficult to find :))

It seems to run stable now (I will see in a few hours).


Andreas




Can text-input-range text be right justified?

Is there a way to right-justify the numbers in a text-input-range?

Mitch


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