Thank you Gustaf, I am using the ActiveState binary and XOTcl is version 1.6.6, not NX. I don't know where to get the source code for TCL 8.6.0.0b4, it is not available anywhere yet.
I think I have zeroed in where the crash happens. Here is the sample code that causes the crash for me:
tcl_patchLevel 8.6b1.2 tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.6.35-22-generic tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = root tcl_platform(wordSize) = 4
#################################### Object o Object o::o [o::o info parent] info children
Segmentation fault #####################################
I have also installed the 32bit version of the same ActiveState binary (the latest one, 8.6.0.0b4, tcl_patchLevel 8.6b1.2) and it will crash right at [package req XOTcl]
Hope that helps
----- Original Message ----- From: "Gustaf Neumann" neumann@wu-wien.ac.at To: xotcl@alice.wu-wien.ac.at Sent: Wednesday, October 13, 2010 6:56:00 PM GMT -08:00 US/Canada Pacific Subject: Re: [Xotcl] troubleshooting
Hi Victor,
our typical test setup is to run the regression test with 8.5.9, tcl 8.6b1, and with 8.6head version (where i have applied the SANE-NRE-patch from Miguel). i just double-checked, for me all three test settings work fine.
does the regression work on your installation with tcl 8.6b4 (run: make test)? If they run fine, and you experience a crash with your application, the following works probably best:
Strategy a: try to isolate and pinpoint the problem from the tcl layer by simplifying your script. if the problem can be reproduced with a few lines of code, send it to me.
Strategy b: mostly for c-literate developers: use gdb.
- compile tcl and nsf with -g enabled (e.g. add it to the compile flags in the Makefile and recompile with "make clean" and "make")
- start the tcl shell under gdb, like e.g. gdb /usr/local/src/tcl8.5.9/unix/tclsh
- start your application from gdb using run ..../yourapp.tcl
- when it crashes, type in where an you will get the backtrace. maybe what you see makes sense to you. if not, send it to me, i'll try me best on it.
all the best -gustaf
On 14.10.10 00:33, Victor Mayevski wrote:
I have just tried my application on latest TCL 8.6b4 and it crashes (Segmentation fault). The same application works just fine in TCL 8.5.9. Any idea how I can troubleshoot it? Tools, techniques etc?
Thank you _______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
_______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Dear Victor,
many thanks for the short example! i have compiled xotcl 1.6.6 with my three test releases, the script runs fine in every version, also valgrind did not report unusual happenings, but i tried so far only with mac os x with 64bit.
i am slightly confused about the activestate version number TCL 8.6.0.0b4. There was never a version of Tcl 8.6 b4 released (or tagged on sourceforge). As you wrote, the tcl_patchLevel is 8.6b1.2, which is the current HEAD release (and therefore a moving target). Apparently, activestate uses its own tags. Have you seen somewhere on activestate a source-release?
-gustaf neumann
On 14.10.10 08:21, Victor Mayevski wrote:
Thank you Gustaf, I am using the ActiveState binary and XOTcl is version 1.6.6, not NX. I don't know where to get the source code for TCL 8.6.0.0b4, it is not available anywhere yet.
I think I have zeroed in where the crash happens. Here is the sample code that causes the crash for me:
tcl_patchLevel 8.6b1.2 tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.6.35-22-generic tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = root tcl_platform(wordSize) = 4
#################################### Object o Object o::o [o::o info parent] info children
Segmentation fault #####################################
I have also installed the 32bit version of the same ActiveState binary (the latest one, 8.6.0.0b4, tcl_patchLevel 8.6b1.2) and it will crash right at [package req XOTcl]
Hope that helps
----- Original Message ----- From: "Gustaf Neumann"neumann@wu-wien.ac.at To: xotcl@alice.wu-wien.ac.at Sent: Wednesday, October 13, 2010 6:56:00 PM GMT -08:00 US/Canada Pacific Subject: Re: [Xotcl] troubleshooting
Hi Victor,
our typical test setup is to run the regression test with 8.5.9, tcl 8.6b1, and with 8.6head version (where i have applied the SANE-NRE-patch from Miguel). i just double-checked, for me all three test settings work fine.
does the regression work on your installation with tcl 8.6b4 (run: make test)? If they run fine, and you experience a crash with your application, the following works probably best:
Strategy a: try to isolate and pinpoint the problem from the tcl layer by simplifying your script. if the problem can be reproduced with a few lines of code, send it to me.
Strategy b: mostly for c-literate developers: use gdb.
- compile tcl and nsf with -g enabled (e.g. add it to the compile flags in the Makefile and recompile with "make clean" and "make") - start the tcl shell under gdb, like e.g. gdb /usr/local/src/tcl8.5.9/unix/tclsh - start your application from gdb using run ..../yourapp.tcl - when it crashes, type in where an you will get the backtrace. maybe what you see makes sense to you. if not, send it to me, i'll try me best on it.
all the best -gustaf
On 14.10.10 00:33, Victor Mayevski wrote:
I have just tried my application on latest TCL 8.6b4 and it crashes (Segmentation fault). The same application works just fine in TCL 8.5.9. Any idea how I can troubleshoot it? Tools, techniques etc?
Thank you _______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl _______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
The ActiveTcl release is straight from Tcl head of Oct 4 (just after IPv6 went in). The b4 designate just means we've had 4 releases since the first beta, the core version is what the core responds as.
Note that one major change with AT 8.6b4 is that it's x86-x64, not x86-ppc (aka "universal"), so you need the right matching libraries.
Jeff
On 2010-10-14, at 2:29 AM, Gustaf Neumann wrote:
Dear Victor,
many thanks for the short example! i have compiled xotcl 1.6.6 with my three test releases, the script runs fine in every version, also valgrind did not report unusual happenings, but i tried so far only with mac os x with 64bit.
i am slightly confused about the activestate version number TCL 8.6.0.0b4. There was never a version of Tcl 8.6 b4 released (or tagged on sourceforge). As you wrote, the tcl_patchLevel is 8.6b1.2, which is the current HEAD release (and therefore a moving target). Apparently, activestate uses its own tags. Have you seen somewhere on activestate a source-release?
-gustaf neumann
On 14.10.10 08:21, Victor Mayevski wrote:
Thank you Gustaf, I am using the ActiveState binary and XOTcl is version 1.6.6, not NX. I don't know where to get the source code for TCL 8.6.0.0b4, it is not available anywhere yet.
I think I have zeroed in where the crash happens. Here is the sample code that causes the crash for me:
tcl_patchLevel 8.6b1.2 tcl_platform(byteOrder) = littleEndian tcl_platform(machine) = x86_64 tcl_platform(os) = Linux tcl_platform(osVersion) = 2.6.35-22-generic tcl_platform(pathSeparator) = : tcl_platform(platform) = unix tcl_platform(pointerSize) = 4 tcl_platform(threaded) = 1 tcl_platform(user) = root tcl_platform(wordSize) = 4
#################################### Object o Object o::o [o::o info parent] info children
Segmentation fault #####################################
I have also installed the 32bit version of the same ActiveState binary (the latest one, 8.6.0.0b4, tcl_patchLevel 8.6b1.2) and it will crash right at [package req XOTcl]
Hope that helps
----- Original Message ----- From: "Gustaf Neumann"neumann@wu-wien.ac.at To: xotcl@alice.wu-wien.ac.at Sent: Wednesday, October 13, 2010 6:56:00 PM GMT -08:00 US/Canada Pacific Subject: Re: [Xotcl] troubleshooting
Hi Victor,
our typical test setup is to run the regression test with 8.5.9, tcl 8.6b1, and with 8.6head version (where i have applied the SANE-NRE-patch from Miguel). i just double-checked, for me all three test settings work fine.
does the regression work on your installation with tcl 8.6b4 (run: make test)? If they run fine, and you experience a crash with your application, the following works probably best:
Strategy a: try to isolate and pinpoint the problem from the tcl layer by simplifying your script. if the problem can be reproduced with a few lines of code, send it to me.
Strategy b: mostly for c-literate developers: use gdb.
compile tcl and nsf with -g enabled (e.g. add it to the compile flags in the Makefile and recompile with "make clean" and "make")
start the tcl shell under gdb, like e.g. gdb /usr/local/src/tcl8.5.9/unix/tclsh
start your application from gdb using run ..../yourapp.tcl
when it crashes, type in where an you will get the backtrace. maybe what you see makes sense to you. if not, send it to me, i'll try me best on it.
all the best -gustaf
On 14.10.10 00:33, Victor Mayevski wrote:
I have just tried my application on latest TCL 8.6b4 and it crashes (Segmentation fault). The same application works just fine in TCL 8.5.9. Any idea how I can troubleshoot it? Tools, techniques etc?
Thank you _______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl _______________________________________________ Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Xotcl mailing list Xotcl@alice.wu-wien.ac.at http://alice.wu-wien.ac.at/mailman/listinfo/xotcl
Hello Gustaf,
I have been playing with NX, so far I really like it, the speed, the clean interface, everything is very nice. One thing I miss though, which I have been using often in XOTcl, is invocation of methods during object creation. Example "MyClass create myobject -dowork1 -dowork2 -finalize -destroy". I know that you mentioned in the git log somewhere that this was security concern and NX will not have this capability. However, you did say that this can be scripted in. Can you give an example of how to do it? Is it really such a security issue?
Thanks
Hi victor,
also with nx, one can call methods during the object creation, very similar to "eval":
# create class nx::Class create Foo { :public method bar {} {return 1} :public method baz {} {return 2} }
# create object Foo create f1 { :bar; :baz; :destroy }
Calling methods during creation is very common, and happens as well in the example above during the creation of the class Foo.
The example above can be written as well more compact via
# create new class and object and cleanup everything nx::Class new { :public method bar {} {return 1} :public method baz {} {return 2} :create new { :bar; :baz; :destroy } :destroy }
In this example, the class is created with new, during initialization, the methods "bar" and "baz" are created, then an instance of the class is created (and calls "bar" and "baz", and destroys itself), and finally the class is deleted. If you want to run theses examples, please update from git).
The problem with the dash ("-") commands is that they support variable number of arguments. Unless one puts dash-commands into a list (which is not usually done), and e.g. a variable v has the content "-foo", an invocation "... create f1 -x $v -y 1" will try to call a method foo. The security problem comes in, when one has untrusted variable contents (e.g. provided via web). It is certainly possible (and recommended) to validate untrusted content, or to use the list notation "... create f1 [list -x $v] -y 1" but in practice, this is often not done (by oversight, non-awareness, laziness, ...)
Finally, the standard xotcl answer: eveything can be configured. Since nsf supports XOTcl 2.0 (and both, nx and xotcl2 are fully scripted), it is certainly possible to reconfigure nx to get the good old dash-processing again to your scripts.
-gustaf neumann
On 26.10.10 06:36, Victor Mayevski wrote:
Hello Gustaf,
I have been playing with NX, so far I really like it, the speed, the clean interface, everything is very nice. One thing I miss though, which I have been using often in XOTcl, is invocation of methods during object creation. Example "MyClass create myobject -dowork1 -dowork2 -finalize -destroy". I know that you mentioned in the git log somewhere that this was security concern and NX will not have this capability. However, you did say that this can be scripted in. Can you give an example of how to do it? Is it really such a security issue?
Thanks
Thank you Gustaf, that makes sense. I have also found that I can still do attribute settings the old - "dash" way, so, most of my code should be fine.
----- Original Message ----- From: "Gustaf Neumann" neumann@wu-wien.ac.at To: "Victor Mayevski" vitick@gmail.com Cc: xotcl@alice.wu-wien.ac.at Sent: Tuesday, October 26, 2010 4:20:48 AM GMT -08:00 US/Canada Pacific Subject: Re: NX question
Hi victor,
also with nx, one can call methods during the object creation, very similar to "eval":
# create class nx::Class create Foo { :public method bar {} {return 1} :public method baz {} {return 2} }
# create object Foo create f1 { :bar; :baz; :destroy }
Calling methods during creation is very common, and happens as well in the example above during the creation of the class Foo.
The example above can be written as well more compact via
# create new class and object and cleanup everything nx::Class new { :public method bar {} {return 1} :public method baz {} {return 2} :create new { :bar; :baz; :destroy } :destroy }
In this example, the class is created with new, during initialization, the methods "bar" and "baz" are created, then an instance of the class is created (and calls "bar" and "baz", and destroys itself), and finally the class is deleted. If you want to run theses examples, please update from git).
The problem with the dash ("-") commands is that they support variable number of arguments. Unless one puts dash-commands into a list (which is not usually done), and e.g. a variable v has the content "-foo", an invocation "... create f1 -x $v -y 1" will try to call a method foo. The security problem comes in, when one has untrusted variable contents (e.g. provided via web). It is certainly possible (and recommended) to validate untrusted content, or to use the list notation "... create f1 [list -x $v] -y 1" but in practice, this is often not done (by oversight, non-awareness, laziness, ...)
Finally, the standard xotcl answer: eveything can be configured. Since nsf supports XOTcl 2.0 (and both, nx and xotcl2 are fully scripted), it is certainly possible to reconfigure nx to get the good old dash-processing again to your scripts.
-gustaf neumann
On 26.10.10 06:36, Victor Mayevski wrote:
Hello Gustaf,
I have been playing with NX, so far I really like it, the speed, the clean interface, everything is very nice. One thing I miss though, which I have been using often in XOTcl, is invocation of methods during object creation. Example "MyClass create myobject -dowork1 -dowork2 -finalize -destroy". I know that you mentioned in the git log somewhere that this was security concern and NX will not have this capability. However, you did say that this can be scripted in. Can you give an example of how to do it? Is it really such a security issue?
Thanks
Certainly, all attributes can be set using the dash notation. The attributes do not have the variable arguments problem, for setting, always exactly one argument is required.
Although syntactically the same, there is a big difference between XOTcl 1.* and nx concerning attributes: in xotcl, calls like "-a 1" in "C new -a 1" were plain method calls; in nx, these are object parameters, which are set using the same mechanism as setting nonpositional arguments for a method (using the same value checker, default mechanisms, can be set optional or not etc.). With nx, it is possible to define e.g. protected setter functions, etc.
On 26.10.10 22:37, Victor Mayevski wrote:
Thank you Gustaf, that makes sense. I have also found that I can still do attribute settings the old - "dash" way, so, most of my code should be fine.
if you use XOTcl 2.0, practically everything is compatible. Since it is possible to use nx and XOTcl 2.0 in the same interpreter, migration does not mean to change everything on a certain date, but it can be done in a piecemeal manner.
-gustaf neumann