Artifacts Associated With Ticket 3579001fff
Ticket change [d590b1776a] (rid 123646) by anonymous on 2012-10-22 00:51:23:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This is similar to the feature request artifact id 3159088. It would be very useful to allow users to control the flags passed to dlopen() when calling Tcl's load command. One suggestion would be to add an optional -flags argument that accepts a list of values similar to the open command. Ex. load myextension.so -flags { RTLD_GLOBAL RTLD_LAZY } - foundin initialized to: "None"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- subsystem initialized to: "40. Dynamic Loading"
- title initialized to: "Allow user choice for RTLD_GLOBAL / RTLD_LOCAL"
- type initialized to: "RFE"
Ticket change [f6f10b70a7] (rid 130400) by nijtmans on 2012-10-22 13:56:40:
- assignee changed to: "nijtmans"
Ticket change [a931ce9dc5] (rid 99113) by dkf on 2012-10-22 19:26:23:
- icomment:
I'm not necessarily opposed to this, but I would note that this requires care because of the differences between different [load] implementations (if only it was always libdl…)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [7758d73dbf] (rid 89764) by nijtmans on 2012-10-22 19:28:32:
- closedate changed to: "2012-10-22T12:28:32"
- closer changed to: "nijtmans"
- icomment:
1) Those flags are only available on UNIX, how should it be implemented on Windows/AIX/HP/....?? 2) The Tcl "load" command is only meant to load Tcl extensions, which typically export only Xxx_Init and maybe one or two more. I don't see that advantage that RTLD_GLOBAL/RTLD_LAZY would provide there.
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Rejected"
- status changed to: "Pending"
- username: "nijtmans"
Ticket change [80108edc96] (rid 97668) by anonymous on 2012-10-23 07:41:48:
- icomment:
This feature is very important for extensions that provide Tcl bindings to C++ interfaces. The extension links with the underlying C++ shared libs, and can behave badly if it is loaded with local symbol scoping (two copies of the same static variable in two different extensions). Other multi-platform scripting languages provide users with a way to control the flags passed to dlopen() on Unix platforms. For example: python (ctypes module) perl (sub dl_load_flags) ruby (DL module) Since some extensions behave badly with local symbol scoping and some behave badly with global, it makes sense to give the programmer the opportunity to choose between the two, depending on the application. It's fine if this is a Unix-only feature, as long as the documentation describes it as such.
- login: ""
- mimetype: "text/plain"
- status changed to: "Open"
- username: ""
- icomment:
Ticket change [6a2eda6b6c] (rid 128098) by anonymous on 2012-10-23 07:43:01:
- resolution changed to: "Remind"
Ticket change [2ce8d2ba96] (rid 118992) by nijtmans on 2012-10-23 15:04:02:
- icomment:
Understood. So it's really a -global flag you are after.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [bccbe3247a] (rid 101816) by anonymous on 2012-10-24 00:15:00:
- icomment:
Thank you for your consideration. Yes, my primary concern is the ability to specify -global. However, RTLD_LAZY is also very useful for similar applications that provide C++ scripting bindings for Tcl. By being able to speciy lazy loadng, packages can work correctly with multiple versions of the underlying C++ shared libs. A user could use a newer build of the scripting API with an older version of the C++ shared libs, but would not run into missing symbol errors unless he or she actually tried invoking code belonging to the new API. Of course, this is also very application specific and would not be desirable in all situations. So, it makes sense to keep the default as-is now and provide an option for the programmer to select what is best for the application. Since these two features are closely related, I thought it would make sense to combine them into one request. But of course, my main concern is the ability to control global / local.
- login: ""
- mimetype: "text/plain"
- username: ""
- icomment:
Ticket change [5acf43805b] (rid 118210) by nijtmans on 2012-10-24 05:02:56:
- icomment:
I did some preparation for this on the Tcl trunk. See: http://core.tcl.tk/tcl/info/4d417791c9 This makes it trivial to implement this Feature request, on top of TIP #357: Export TclLoadFile. The only things that is left to do is define the meaning of the "flags" parameter, and translate that as needed in the various tclLoad*.c implementations. Still another TIP is needed to complete it, because it modifies the "load" command. It could be integrated with TIP #239: "Enhance the 'load' Command" <http://www.tcl.tk/cgi-bin/tct/tip/239.html> as well. I don't think this will make Tcl 8.6, it certainly should not delay the Tcl 8.6 release....... - login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [50d36b1174] (rid 126039) by nijtmans on 2012-10-24 20:11:40:
- icomment:
experimental implementation in branch "frq-3579001)". See: <http://core.tcl.tk/tcl/info/0895bccd51> test-cases are updated, but nothing has been done on documentation yet. New syntax: load fileName ?-global? ?-lazy? ?packageName? ?interp? - login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "None"
- username: "nijtmans"
- icomment:
Ticket change [02e259cf17] (rid 119727) by anonymous on 2012-10-24 20:43:05:
- icomment:
Thank you very much for your work here. Is there anything that I can do to help?
- login: ""
- mimetype: "text/plain"
- username: ""
- icomment:
Ticket change [9cb277f9d2] (rid 96186) by nijtmans on 2012-10-25 04:31:53:
- icomment:
Changed syntax in "frq-3579001" branch: It's more logical to expect the options before the filename. cdelbaere, what is your email address? Please mail it privately to me.
- login: "nijtmans"
- mimetype: "text/plain"
- username: "nijtmans"
- icomment:
Ticket change [fefef5a243] (rid 108683) by nijtmans on 2012-11-02 20:32:32:
- icomment:
Test report from Christian: Hi Jan, I performed some manual testing on the new implementation of the load command using a set of loadable modules in a software package that I am working on. I can tell by the behavior of some of my internal testcases which flags are passed to dlopen(). All of the following combinations work as expected: load module.so load -global module.so load -lazy module.so load -global -lazy module.so load -lazy -global module.so Also, load -- module.so load -global -- module.so load -lazy -- module.so load -lazy -global -- module.so The default is still local + now symbol loading (correct) The -global flag loads the libraries symbols with global scoping (correct) The -lazy flag correctly ignores missing symbols until the code is actually called (correct) Regards, Christian
- login: "nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- username: "nijtmans"
- icomment:
Ticket change [55c2c64b99] (rid 94204) by nijtmans on 2012-11-15 17:53:42:
- closedate changed to: "2012-11-15T10:53:42"
- closer changed to: "nijtmans"
- icomment:
allow_comments - 1 Implementation is on trunk now, to be released with Tcl 8.6.0
- login: "nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"
- username: "nijtmans"