On Mon, 16 Jan 2006 00:58:59 +0000, "lisp" <lisp(a)spikeisland.com> wrote:
> I am happy to report that this works!
Great!
> If you run the function gc-test below in a LWW DLL image, you can
> see the delegate adapter for the Click event being reclaimed and
> releasing the closure from the callback hash table.
>
> If you open a process browser window *before* running this, you will
> see the process created by LWW to handle the callback from .NET's gc
> thread. Inspecting this process's arguments reveals
> (rdnzl:%foreign-callable/releasedelegateadapter). This process is
> used for all subsequent callbacks from the gc thread. If you kill
> it, a new one will be created for the next gc callback.
>
> If you run this code in a conventional .exe LWW image you do not get
> the callback from .NET's gc thread.
Thanks for the detailed info. I'll try this tomorrow.
> I have run into a further problem - with LWW this time I think. As
> far as I can tell, LWW will occasionally run a foreign callback on
> the wrong thread resulting in a stack overflow exception condition
> being raised. With a form running in a new process and generating
> event callbacks, the listener process occasionally reports a stack
> overflow and shows the callback happening in *its* backtrace -
> presumably confusing the stack check. I've not yet been able to
> verify this or reproduce it reliably.
>
> Any thoughts or suggestions would be welcome...
No idea. But it would be /very/ helpful if you could reproduce this
and submit a bug report to LispWorks support. As you'll know they're
currently working on the 5.0 release which will have some changes in
the threading code as well. It'd be nice if they could fix that
before they release the new version.
Thanks again,
Edi.
_______________________________________________
rdnzl-announce mailing list
rdnzl-announce(a)common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-announce
Hi Dominic!
On Fri, 13 Jan 2006 00:29:08 +0000, "lisp" <lisp(a)spikeisland.com> wrote:
> I've tracked down what looks to be a bug in the mechanism for
> releasing delegate adapters.
>
> The foreign callable ReleaseDelegateAdapter is declared with a
> return type of ffi-void-pointer but tries to return the result of
> remhash - a boolean. On LWW (at least) this results in:
>
> Condition: T cannot be converted to foreign type :POINTER. Call to
> SYSTEM::FOREIGN-CALLABLE-ENTRY-POINT-NEW-PROCESS-AUX (offset 21)
> SYSTEM::FUNC : RDNZL::%FOREIGN-CALLABLE/RELEASEDELEGATEADAPTER
>
> I would suggest changing it (and the corresponding initialisation
> and DLL code) to have a void return type:
>
> (ffi-define-callable (ReleaseDelegateAdapter ffi-void)
> ((index ffi-integer)) ;; remove entry from hash table if CLR is done with it
> (remhash index *callback-hash*))
>
> Also, in DelegateAdapter.cpp you have a comment on the destructor
> that it doesn't appear to be working:
>
> // the destructor notifies Lisp that this instance is no longer used -
> // at least in theory, this doesn't seem to work right now
> DelegateAdapter::~DelegateAdapter() { release(indexIntoLisp); }
>
> This may have beeen the caused by the callback/threading issues
> discussed recently. At least it has certainly worked for me here
> (hence this bug report) when using a DLL based LWW image (many
> thanks for your recent example of this). Perhaps the .NET GC is
> running in a different thread, so the callback was failing in a
> normal .EXE image?
Makes perfect sense to me. I've updated both the Lisp and the C++
code according to your recommendations - see ChangeLogs below.
However, I'm a bit in a hurry and I couldn't figure out an easy
example which shows that ReleaseDelegateAdapter is actually called -
at least not from a DLL-based LWW image. Could you please check if it
works and report back to the list if possible?
Thanks a lot,
Edi.
Lisp code:
----------
Version 0.8.0
2006-01-13
Fix mechanism which releases delegate adapters (thanks to Dominic Robinson)
Updated to DLL version 0.5.0
<http://weitz.de/files/RDNZL.tar.gz>
C++ code (optional):
--------------------
Version 0.5.0
2006-01-13
Fix mechanism which releases delegate adapters (thanks to Dominic Robinson)
<http://weitz.de/files/RDNZL_cpp.tar.gz>
_______________________________________________
rdnzl-announce mailing list
rdnzl-announce(a)common-lisp.net
http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-announce
ChangeLog TBNL:
Version 0.9.4
2006-01-03
Handle "Expect: 100-continue" for non-Apache front-ends
Re-introduced IGNORE-ERRORS in GET-REQUEST-DATA
ChangeLog Hunchentoot:
Version 0.1.2
2006-01-03
Mention TBNL version number in server name header
Download:
<http://weitz.de/files/tbnl.tar.gz>
<http://weitz.de/files/hunchentoot.tar.gz>
Have fun,
Edi.
_______________________________________________
tbnl-announce site list
tbnl-announce(a)common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-announce
Hunchentoot is yet another Common Lisp web server. It is implemented
atop TBNL and adds HTTP/1.1 chunking, persistent connections
(keep-alive), and SSL to the mix.
More info here:
<http://weitz.de/hunchentoot/>
Cheers,
Edi.
_______________________________________________
tbnl-announce site list
tbnl-announce(a)common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-announce
ChangeLog:
Version 0.9.2
2005-12-31
Protocol of reply is HTTP/1.1 now
Made HTTP/0.9 default protocol of request if none was provided
Some preparations for Hunchentoot
Various minor changes
Small fixes in docs
Download:
<http://weitz.de/files/tbnl.tar.gz>
Cheers,
Edi.
_______________________________________________
tbnl-announce site list
tbnl-announce(a)common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-announce
On Sun, 25 Dec 2005 02:17:31 -0800 (PST), Hilverd Reker <h_reker-lisp(a)yahoo.com> wrote:
> I just downloaded TBNL 0.9.0, and it seems like the file
> mime-types.lisp is missing (to which tbnl.asd refers). Could you
> please take a look?
Yeah, sorry, my bad. I just uploaded 0.9.1 which should have it.
Thanks,
Edi.
_______________________________________________
tbnl-announce site list
tbnl-announce(a)common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-announce
ChangeLog:
Version 0.9.0
2005-12-24
Experimental support for writing directly to the front-end (see SEND-HEADERS)
Added HANDLE-STATIC-FILE
Changed CREATE-STATIC-FILE-DISPATCHER-AND-HANDLER to use new facilities
Added CREATE-FOLDER-DISPATCHER-AND-HANDLER
Added link to Travis Cross' message w.r.t. SBCL
Download:
<http://weitz.de/files/tbnl.tar.gz>
Happy Holidays,
Edi.
_______________________________________________
tbnl-announce site list
tbnl-announce(a)common-lisp.net
http://common-lisp.net/mailman/listinfo/tbnl-announce