Artifacts Associated With Ticket 2059262fffffffffffffffffffffffffffffffff
Ticket change [f9118d31c3] (rid 91643) by nijtmans on 2008-08-19 08:23:53:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Some libraries, e.g. the Mbx library from the secs project, let Tcl crash when the library is unloaded. This is related to tip #239. There has been a private discusson about that, here are just some copies of the relevant parts: ================================================= The reason we need the Tcl-level extras is that it introduces at least one key feature - per-library opt-out of being closed/unloaded. This is very important for some libraries that have atexit handlers and similar weird issues (like Oracle's stuff). Jeff ================================================== Yes, I encountered a proprierary library as well which has problems with unloading in Tcl 8.5 but worked perfectly in Tcl 8.4 ;-(. Shouln't libraries report by itself if they support unloading or not, in stead of building it in in the load command? We could simply check if the library has an unloadproc, and only unload it if it has one. Something like the patch below. Then any library which wants the unload feature only has to define the symbol, that's it. This patch seems to fix my problem (but it is barely tested, so your comments are welcome....) Regards, Jan Nijtmans ================================================== The problem with that is that it then adds the burden of creating the unload proc for all the well-behaved libraries. It might be worth considering special values like Tcl_EventuallyFree does, whereby TCL_UNLOAD_OK could be specific as the unloadProc (meaning it should unload with the usual native stuff). Any way you cut it, that just adds some special casing for something I want to be generalized. If it means we need Tcl_Load* APIs, I think that's acceptable. Jeff ================================================== Thinking more about it, I think we are dealing with two different things here: 1) A regression in Tcl 8.5 compared to 8.4. The mbx package I wrote for the secs project uses a proprietary library libCw.a. This library crashes when Tcl 8.5 exits, but with Tcl 8.4 it works perfectly. 2) Extend the API in both Tcl and C to allow more control over the unloading of libraries. Both should be considered separately. I propose to submit a bug ticket for 1), which can be solved without a TIP, and backported to Tcl 8.4. This private discussion can then be continued there. It is indeed a burden to create an unload proc for well-behaved libraries, but that's small and easy and it restores the Tcl 8.4 behaviour for ill-behaved libraries. We only have to do that for a small number of libraries (the ones in the core), and only the extension writers who want to support unloading need to do it as well. I volunteer to do that, as soon as we reach agreement. A separate issue is 2), which needs a TIP and cannot be backported to Tcl 8.5. Personally, for the C api I would just use dlopen, so we don't have to do anything for Linux and friends. But I can live very well with the proposed Tcl_Load* API as well. Regards, Jan Nijtmans - foundin initialized to: "obsolete: 8.5.4"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nijtmans"
- subsystem initialized to: "None"
- title initialized to:
regression: crash after unloading proprietary library
- type initialized to: "Bug"
Add attachment "diff.txt" [ed6542ed57] (rid 103871) by nijtmans on 2008-08-19 15:23:53.
Ticket change [376ddd5d99] (rid 107275) by nijtmans on 2008-08-19 15:23:53:
- icomment:
File Added - 289319: diff.txt
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [b1cf0a0593] (rid 98222) by nijtmans on 2008-08-25 15:43:53:
- assignee changed to: "nijtmans"
Ticket change [983907dec1] (rid 110569) by dkf on 2008-08-25 17:35:09:
- icomment:
Logged In: YES user_id=79902 Originator: NO A library is only unloadable if it has a *_Unload function exported; if the function is absent, [unload] will refuse to do anything with it at all. Why is such a function being exported in this case?
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [4fda94a749] (rid 125888) by nijtmans on 2008-08-25 17:41:58:
- icomment:
Logged In: YES user_id=61031 Originator: YES Answer to previous question: The problem is not the "unload" command. The problem arises when the application ends. Then Tcl will call dlunload/shl_unload (or whatever the platform calls it) for the library. The crash occurs when the application is terminated through "exit", after everything else is cleaned up.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [f6feceabcf] (rid 130411) by nijtmans on 2008-10-04 19:55:19:
- icomment:
fixed in generic/tclLoad 1.18. To be backported, therefore leave open
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [de68f77c03] (rid 114847) by dgp on 2008-10-07 01:02:05:
- icomment:
I don't follow the bug or the fix, but is there any reason to withold the backport?
- login: "dgp"
- mimetype: "text/plain"
- priority changed to: "9 Immediate"
- username: "dgp"
- icomment:
Ticket change [807987612e] (rid 116875) by nijtmans on 2008-10-07 15:20:25:
- icomment:
There is only one minor reason to withold the backport: It gives some time to Jeff and others to see if it fixes the same problem with the Oracle library as well, before it is put in a public Tcl8.5.5 release. (I checked that the libCw problem is fixed by this, and yes it is). I plan to do this well before Tcl8.5.5. The advantage of it being in Tcl8.6a3 is that any feedback (however unlikely) can still be handled before it occurs in a public release. But if you prefer the backport now, I'll be glad to do it.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [8af3ea058a] (rid 127475) by dgp on 2008-10-07 21:29:21:
- icomment:
Normally I try to do an 8.5 patch release about the same time as an 8.6 alpha release. Which means I'm aiming to get 8.5.5 out Real Soon Now.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [34fffb7692] (rid 106841) by nijtmans on 2008-10-07 22:56:38:
- icomment:
OK, I'll do it tonight
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [ead39dc760] (rid 103432) by nijtmans on 2008-10-08 06:17:29:
- icomment:
Backported (tclLoad 1.16.4.1) for Tcl 8.5.5, so now can be closed
- login: "nijtmans"
- mimetype: "text/plain"
- subsystem changed to: "40. Dynamic Loading"
- username: "nijtmans"
- icomment:
Ticket change [636c003d4c] (rid 92572) by nijtmans on 2008-10-08 06:18:04:
- closedate changed to: "2008-10-07T23:18:04"
- closer changed to: "nijtmans"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [8be83645df] (rid 127658) by nijtmans on 2008-11-14 16:12:20:
- icomment:
This fix introduced an new bug: [ 2269431 ] load of shared objects leaves temporary files on windows This bug is fixed now, but it leaves one remaining minor issue. Therefore, a follow-up artifact is created: [ 2282547 ] load of ill-behaved shared library from VFS: core dump
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment: