Re: [Oorexx-devel] BSF4Rexx and ooRexx 4.0 : (tiny) adjustments needed - and a bug in rxapi.exe ?
Bonjour Jean-Louis, I uploaded the changes to the patches tracker for BSF4Rexx. Great, thank you very much! There is a new target oorexx4 in the makefile (for Window only). It defines the variable USE_OOREXX4 which is used for conditional compilation (I leave you decide if that's the good way) I use Visual C++ 2008 Express Edition, and I had to remove INITINSTANCE from BSF4Rexx.def (syntax error). Yes, that stems from the OS/2 days. No longer needed to modify the call RxFuncLoad, thanks to Rick. It's really impressive to see BSF4Rexx working like a breeze with ooRexx 4, without no change at all ! Tested with jre1.6.0_11 Great, again thank you very much for your work and information/feedback! --- Did you by any chance try a BSF4Rexx.dll which was compiled against ooRexx 3.2, i.e. the one from the distribution that can be found at http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/current/? (Just curious, whether it would work with the latest drop of ooRexx 4.0 too.) Regards, ---rony -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] BSF4Rexx and ooRexx 4.0 : (tiny) adjustments needed - and a bug in rxapi.exe ?
Bonjour Jean-Louis, I confirm that the current distribution built with ooRexx 3.2 works well with ooRexx 4, after the changes made by Rick today. All the scripts in samples run without problem, from rexx or from java. That's really great news! Only Snippet108.rex is not running, I suppose I don't have SWT. Yes, you would need to get it from http://www.eclipse.org/swt/. After that, all of Eclipse's swt-gadgets are available to you (and transcribing the Java snippets to ooRexx using BSF4Rexx is quite straight-forward) ... Even not a little bug to shake out :-) :-) Nevertheless, your work on making BSF4Rexx compile with ooRexx 4.0 is highly appreciated as it will get incorporated (after the ski-seminar which starts this week, our winter term goes on until the end of January over here), before starting one long-outstanding/planned enhancement to BSF4Rexx which is only possible with ooRexx 4.0, which will allow for call backs. [For that I will have to study the addressing of specific running ooRexx interpreter instances as well as ooRexx threads and addressing ooRexx objects therein.] Regards, ---rony -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question about calling an external routine
rob...@garrettfamily.us wrote: (Apologies in advance if I've sent this to an inappropriate list) Is it possible to pass an instance of an object from an externally called routine back to the parent routine? If so, how? Example: Assume two separate REXX routines (separate files): MAIN.rex and LOGGER.rex. I'd like to be able to, from MAIN, call LOGGER (passing it a file name), and have LOGGER create an instance of a stream object, open the file, and then pass the stream object back to MAIN at which point MAIN would be able to use the stream object to write to the file (or perhaps pass it to other external routines that would also be able to use it). I'm already doing this with LOGGER being a routine that is part of MAIN (both located in the same file), but I want to be able to break LOGGER out into a separate file. Is this possible? Sure. Break out the routines add the keyword PUBLIC to each routine in LOGGER.rex. Then, before using the public routines which now reside in LOGGER.rex you need to CALL LOGGER, which will cause its public routines (and public classes) to become visible. 'Thereafter you can access all those routines as if they were defined in MAIN.rex. I've been writing and using REXX for many years in the mainframe environment so I'm quite familiar with the core language, but the facilities of ooREXX are still somewhat new to me. If you are developing a logging facility for Rexx you might want to learn about an ooRexx implementation of the log-framework that originates from the Java world. Here's an article to that ooRexx framework, demonstrating how to use it: http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/2007_orx18_log4rexx-20070517-article.pdf. The ooRexx code of the log4rexx framework can be downloaded from: http://wi.wu-wien.ac.at/rgf/rexx/orx18/log4r/log4rexx_20070521.zip, in case it is of interest for you. HTH, ---rony -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Runtime-infos about caller ? (Re: Question about calling an external routine
Hi Robert, rob...@garrettfamily.us wrote: Thanks for the push in the right direction, I actually have it working now. Great! One more quick question just because I'm being lazy at the moment: in LOGGER, is there a function/method I can call that will tell me 1) that it is being invoked from a 'parent' calling routine (as opposed to being started from a command prompt) and 2) what the name of that parent routine is? In 3.x this seems to not be possible. Not sure about 4.x which introduces a context object that may allow for that (also not sure whether it would be possible to get at the call stack and the respective context objects). Probably only Rick may be able to answer this. ---rony P.S.: Because of your new question I changed the subject line. -- This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] [DISCUSS] What should be the default numeric digits setting for 64-bit.
and external functions dealing with those sizes NUMERIC DIGITS 39 and so on) wherever this becomes a necessity (no one would voluntarily change deployed, tested and running code). Rexx should insulate the coder from such environmental changes as much as possible. --- The legibility argument is one that I would understand, but one that would not really seem to be as important as the problem that a certain category of Rexx programs start to fail running all of a sudden. If numbers become too large, format() is your friend, hence programmers who really need to be able to read (probably the intermediate) results of operations could achieve that easily. Also, if format() was more capable in its formatting features, then any number of any size could be made legible. Just look at Lee Peedin's decimalFormat.cls - in the incubator -, which to me indicates a desperate need for that particular functionality in commercial applications. I thought that that class was going to become part of the next release of ooRexx due to its importance. Probably the problem here is that there are plentyful of Rexx programs that rely on 9 digits (based on assumptions about the environment they got created years ago) and have the formatting of reports and results dependent on that environmental setting, which may break (at least visually) when numeric digits is increased. (But at least they should have a choice, and if existing programs break due to external functions needing larger numbers for today's hardware, then I am sure that they will tolerate older reports breaking the text-based formatting, relying on the numeric 9 digits.) If short: if the argument is that the 9-digit choice was wrong in the first place (which is a valid point of view) then the proposal should be to change the _language_ to use a larger default (18, 20, whatever) -- and that would then apply to all implementations, whether they run on 16-bit, 32-bit, or 64-bit platforms. +1 I really do not like the idea that say 1/7 Might give 0.142857143 on one machine and 0.142857142857142857 on another, just because one user installed the 32-bit version and another the 64-bit. This would lead to all kinds of subtle problems of this nature (a toy example): if x/3 = 0.3 then say 'X is one' which would work differently depending on which version one had installed. +1 However, I do like the idea of a directive like ::numeric digits 18 that would apply to a complete program/class. That would be useful anyway (as would similar for other 'global defaults', such as Trace setting). :-) +1 Also, having an option to set the interpreter (via a class) independently to an arbitrarily value of numeric digits would help tremendeously in such situations, IMHO. ---rony P.S: Simple Rexx program, written under OS/2 which about 14 (!) years after its inception started to break due to a change in the hardware environment it was running (file sizes going beyond 2 GB, and actually, only with ooRexx 4.0 *and* setting explicitly NUMERIC DIGITS would it run again reliably; having a solution on 32- and 64-Bit and any other bitness that would allow this program to start to run again *unchanged* would be the most welcomed solution) ! -- cut here -- /* lsplit.cmd (c) 1991, Rony G. Flatscher, donated to the public domain OS/2-REXX 1991-08-02 E-mail: r...@awiwuw11.bitnet flatsc...@wu-wien.ac.at - split any file into given chunks - show exception handling for CTL-C - produce a CMD-file to recreate original file */ PARSE ARG infile chunks CMD_file /* get filename, chunks in KB, optional CMD-file */ IF infile = '' | infile = '?' | , chunks = '' | \DATATYPE(chunks, 'N') | chunks 1 THEN SIGNAL usage SIGNAL ON HALT /* jump to label HALT: if user presses CTL-C */ chunks = TRUNC(chunks) /* get integer portion of chunks */ /* open input-file */ IF STREAM(infile,C,OPEN READ) 'READY:' THEN DO SAY problem opening 'infile', aborting ... EXIT END /* calculate number of files needed */ tmp = STREAM(infile, C, QUERY SIZE) / (chunks * 1024) IF tmp // 1 0 THEN tmp = tmp + 1 /* if more than (chunks*1024) bytes add another file */ IF LENGTH(TRUNC(tmp)) 3 THEN DO SAY Sorry, cannot produce more than 999 chunk-files, aborting ... SAY (TRUNC(tmp) chunk-files would be needed) EXIT END /* define chunk-file's stem name */ tmp = FILESPEC('NAME',infile) IF LASTPOS('.', tmp) 0 THEN tmp = SUBSTR(tmp, 1, LASTPOS('.', tmp)-1) /* get letters up to but without last point */ outfile_stem = FILESPEC('DRIVE', infile) || FILESPEC('PATH', infile) || tmp || '.' outfile_nr = 0 /* produce the chunk-files */ DO FOREVER CALL OPEN_OUTFILE /* open next chunk-file */ /* get integer portion multiplied by 1024 */ total_to_read = chunks * 1024 to_read = 16 * 1024 /* read 16KB-blocks for speed reasons */ DO WHILE CHARS(infile) 0
Re: [Oorexx-devel] Request for nutshell API examples ... (Re: BSF4Rexx and ooRexx 4.0 : (tiny) adjustments needed - and a bug in rxapi.exe ?
Rick McGuire wrote: Well, it your expectation is a complete running program, then this will have to wait a while until I finish up some other things (many of which happen to be different sample programs). If all you want is answers to some of these questions, then I probably give you a reply with the code snippets involved later this evening. It would not be urgent at the moment (being tied down with University matters, start of semester, classes, meetings), if you can come up with complete running programs eventually, that would be fine enough. But maybe one question, not addressed by the suggested nutshell examples: would it be possible to have different sets of external APIs loaded, depending on the use-case (e.g. for BSF4Rexx the external functions BSFLoadJava() and BSFUnloadJava() should not be available, if invoked via Java). This seems to be implied via the RexxPackageLoader loader; // the package loader entry in the RexxPackageEntry structure; however, it would be very helpful to learn what would be necessary to implement a RexxPackageLoader on the own, and what responsibilities one would have to fulfill. But maybe there is an alternative means of indicating which routines should be made available and which ones should not at runtime. Again, there is no urgent need for this, just curiosity (and a need once starting to adapt BSF4Rexx to the new APIs, before extending it). ---rony -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Request for nutshell API examples ... (Re: BSF4Rexx and ooRexx 4.0 : (tiny) adjustments needed - and a bug in rxapi.exe ?
Rick McGuire wrote: A package is self-contained and completely defined by the table within the package. There's no way to dynamically change those tables, so the best solution for that level of control is to use a different dll stub for ones you don't wish to have loaded for an environment. The loader entry you refer to is just an initialization routine that Rexx will call when your package is loaded. It doesn't control the registration of any of the package entries. Thanks! ---rony -- Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Ad 4.0.0 and RexxStart() ...
Ah, sorry forgot the second observation: Rony G. Flatscher wrote: just reporting two observations: executing a complex Rexx script that repeatedly interacts via Java with OpenOffice, at the end of successfully running it, the RexxStart() function returns the return value 1. This is waht the docs for 4.0.0 say (rexxpg.pdf, rev. 4251): 10.3.3.2. Return Codes The possible RexxStart return codes are: negative Interpreter errors. See the Appendix in the Open Object Rexx: Reference for the list of Rexx errors. 0 No errors occurred. The Rexx procedure ran normally. positive A system return code that indicates problems finding or loading the interpreter. When a macrospace Rexx procedure (see Macrospace Interface) is not loaded in the macrospace, the return code is -3 (Program is unreadable). It is not clear for me what a system return code of 1 would indicate. ---rony -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Ad 4.0.0 and RexxStart() ...
Hi there, just reporting two observations: while testing the current BSF4Rexx and the latest ooRexx 4.0.0 against OpenOffice.org it seems that executing Rexx programs with RexxStart() repeatedly from the same process, does not start out each time in a fresh environment. It seems that required packages from previous runs via RexxStart() have an effect on subsequent RexxStart() invocations (all running always in the same process/thread); the required package UNO.CLS requires BSF.CLS itself and on subsequent RexxStart() runs it behaves as if some entries in .local (set up by the prologue codes in those packages) are not available at later invocations of RexxStart(). [However, sometimes, but not reproducable, some RexxStart()-invocations succeed, but mostly the second and later attempts cause runtime errors when accessing Java proxy objects stored in .local.] Sorry, not able to produce a small program to demonstrate, hence not reported via the bugtracker. However, if one installs OpenOffice.org from http://www.ooRexx.org and BSF4Rexx from http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/archive/2009/20090222/, installing also the OOo support, then one could probably reproduce it by: starting the OOo writer, going to Tools - Macors - ooRexx, then creating a library and a macro (there will be a default ooRexx macro created); just save that macro (it will insert text into the writer document) and run it more than once and you get a runtime error on the subsequent run; repeating running the macro may sometimes yield success, most of the time it will fail. Each macro invocation will invoke the Rexx interpreter via the BSF infrastructure using RexxStart() currently. ---rony -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Build machine is donw?
David Ashley wrote: All - Unfortunately, the problem you are seeing with access to the build machine is not a problem I have direct control over. It turns out the the build machine is up and runiing just fine, but the ATT network is timing out when you try to access it. I have opened up a bug report with ATT on this and they have made me aware that this is a recent known problem. It seems to come and go. At times the build machine answers and at others it does not. Sorry about this but I am at the mercy of the ATT network :-( Unfortunately, http://build.ooRexx.org is still not working. :( Are there any news/updates to this? Is there a time-span ATT is promising to fix this at all? ---rony -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Build machine is donw?
David Ashley wrote: Rony G. Flatscher wrote: David Ashley wrote: All - Unfortunately, the problem you are seeing with access to the build machine is not a problem I have direct control over. It turns out the the build machine is up and runiing just fine, but the ATT network is timing out when you try to access it. I have opened up a bug report with ATT on this and they have made me aware that this is a recent known problem. It seems to come and go. At times the build machine answers and at others it does not. Sorry about this but I am at the mercy of the ATT network :-( Unfortunately, http://build.ooRexx.org is still not working. :( Are there any news/updates to this? Is there a time-span ATT is promising to fix this at all? ---rony Unfortunately, ATT is not being very helpful. In my experimentation it seems that distance is a primary factor in whether or not the request to the machine times out. I have tried several wifi spots in Austin and it works just fine. But once you get out of Texas it is very spotty and inconsistent. All this is really too bad because I have made some upgrades to the machine which make at least some of the builds much faster. Hmm, very strange indeed for an Internet provider! Here a traceroute from overseas to the machine: D:\Dokumente und Einstellungen\Administratortracert build.oorexx.org Routenverfolgung zu build.oorexx.org [69.150.206.90] über maximal 30 Abschnitte: 1 * 1 ms * gw-1-254.wu-wien.ac.at [137.208.254.253] 2 1 ms1 ms * box-1-19.wu-wien.ac.at [137.208.19.135] 3 *1 ms * ex-2-9.wu-wien.ac.at [137.208.9.22] 4 *1 ms * vlan748.wien21.aco.net [193.171.13.129] 5 *2 ms * 212.73.203.17 613 ms ** ae-6-6.ebr1.Frankfurt1.Level3.net [4.69.135.34] 723 ms17 ms17 ms ae-91-91.csw4.Frankfurt1.Level3.net [4.69.140.14] 8 ** 13 ms ae-92-92.ebr2.Frankfurt1.Level3.net [4.69.140.29] 9 *** Zeitüberschreitung der Anforderung. 10 114 ms ** ae-4-4.ebr2.Newark1.Level3.net [4.69.132.102] 11 * 108 ms 107 ms ae-24-52.car4.Newark1.Level3.net [4.68.99.40] 12 108 ms ** ex1-g8-0-1.pxatga.sbcglobal.net [151.164.248.181] 13 ** 151 ms bb1-10g14-0.aus2tx.sbcglobal.net [151.164.243.245] 14 230 ms * 152 ms dist1-t1-3.aus2tx.sbcglobal.net [151.164.188.144] 15 152 ms 154 ms * rback2-g1-0.aus2tx.sbcglobal.net [99.171.168.40] 16 *** Zeitüberschreitung der Anforderung. 17 *** Zeitüberschreitung der Anforderung. 18 *** Zeitüberschreitung der Anforderung. 19 *** Zeitüberschreitung der Anforderung. 20 *** Zeitüberschreitung der Anforderung. 21 *** Zeitüberschreitung der Anforderung. 22 *** Zeitüberschreitung der Anforderung. 23 *** Zeitüberschreitung der Anforderung. 24 *** Zeitüberschreitung der Anforderung. 25 *** Zeitüberschreitung der Anforderung. 26 *** Zeitüberschreitung der Anforderung. 27 *** Zeitüberschreitung der Anforderung. 28 *** Zeitüberschreitung der Anforderung. 29 *** Zeitüberschreitung der Anforderung. 30 *** Zeitüberschreitung der Anforderung. Zeitüberschreitung means timeout. ATT should be able to telnet to a remote machine (one outside of Texas :) ) and doing the same. HTH, ---rony -- Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Problem with OpenOffice/BSF4Rexx using the latest ooRexx 4.0.0 (rev. 4323)
Hi there, when running multiple BSF4Rexx programs from Java, then the very first Rexx program will work, but any subsequent Rexx program that gets dispatched via Java in the same process will cause a runtime error. The reason is, that in the second run the .local directory does not have the BSF4Rexx needed entries. Hence references to e.g. .java.lang.System will not retrieve the Java proxy object for the Java system class (rather its string value .JAVA.LANG.SYSTEM gets returned which does not understand messages like getProperty and the like). It seems that the second invocation of a BSF4Rexx program via Java (using RexxStart and hence running each Rexx program in a separate interpreter instance) is somehow not fully isolated from the previous Rexx interpreter instance. At least it seems that the current implementation would not load the requited BSF.CLS and/or run its initialization code (the code before the first directive), which among other things sets the Rexx engine's behaviour at the Java-side (to use a certain encoding) and saves important Java proxy objects and BSF-related information into .local. Hence this initializatin code is vital for setting up the environment under which BSF4Rexx programs execute. The effect can be seen in the OpenOffice.org (OOo) support which is realized via UNO.CLS which will initialize its environment and save runtime information in .local, but depends on entries in .local that stem from the required BSF.CLS which initializes the BSF4Rexx bridge and puts needed runtime information into .local. Running Rexx macros under OOo works the very first time, but bombs on the next invocation of a Rexx macro. The OOo-support for ooRexx (the part implemented in Java) will dispatch any Rexx macro using RexxStart (the executed ooRexx macro/program must always contain the ::requires OOo.CLS, which itself requires BSF.CLS and relies on the .local entries of BSF.CLS). In the OOo macro environment it may be very well the case that multiple ooRexx macros are executing concurrently/overlapping in the same process. So if the interpreter instances are not isolated from each other, then unpredictable/non-deterministic behaviours would occur. The same ooRexx OOo macros work flawlessly under ooRexx 3.2.0. Regards, ---rony P.S.: Other than this particular RexxStart runtime problem in rev. 4323, everything seems to work fine with BSF4Rexx under ooRexx 4.0.0! This is very remarkable and great (I ran successfully all my BSF4Rexx tests against 4.0.0)! -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Two questions ad exit-handlers on 3.2 and 4.0
Hi there, in news:comp.lang.rexx Erik Duijs posted a problem that relates to an RXSIO exit. Use-case: Using BSF4Rexx a Java program dispatches a Rexx script, which in turn uses Java to dispatch another Rexx program in the same thread. Each dispatch of a Rexx program from the Java side has currently the following logic: * RexxRegisterExitExe(..) is used to register an RXSIO exit handler for the UserArea argument a local character array is used which gets data stuffed into it in a FIFO-fashion, * RexxStart(...) gets a RXSYSEXIT list supplied that denotes that RXSIO exit handler, * RexxDeregisterExit() is used to deregister the RXSIO exit handler. Running under ooRexx 3.2 the invocation of another Rexx script via Java from the first Rexx script fails upon returning to the first Rexx script and writing something to stdout. However, running the same program under the latest build of ooRexx 4.0 will correctly run the program. It seems that ooRexx 4.0 is able to distinguish the RexxDerigsterExit() from each other (whereas in the ooRexx 3.2 case it seems that deregistering affects both interpreter instances and causes the exit failure by ooRexx). The question would be: can one rely on ooRexx 4.0 to deregister the matching (nested) exit handler? A second question: removing the RexxDerigsterExit(...) from the code allows the programs to run correctly under both, 3.2 and 4.0. Are there any side-effects one should consider if not deregistering the (continuously) registered exit handlers? ---rony -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Two questions ad exit-handlers on 3.2 and 4.0
Rick McGuire wrote: 2009/4/2 Rony G. Flatscher rony.flatsc...@wu-wien.ac.at: Hi there, in news:comp.lang.rexx Erik Duijs posted a problem that relates to an RXSIO exit. Use-case: Using BSF4Rexx a Java program dispatches a Rexx script, which in turn uses Java to dispatch another Rexx program in the same thread. Each dispatch of a Rexx program from the Java side has currently the following logic: RexxRegisterExitExe(..) is used to register an RXSIO exit handler for the UserArea argument a local character array is used which gets data stuffed into it in a FIFO-fashion, RexxStart(...) gets a RXSYSEXIT list supplied that denotes that RXSIO exit handler, RexxDeregisterExit() is used to deregister the RXSIO exit handler. Running under ooRexx 3.2 the invocation of another Rexx script via Java from the first Rexx script fails upon returning to the first Rexx script and writing something to stdout. However, running the same program under the latest build of ooRexx 4.0 will correctly run the program. It seems that ooRexx 4.0 is able to distinguish the RexxDerigsterExit() from each other (whereas in the ooRexx 3.2 case it seems that deregistering affects both interpreter instances and causes the exit failure by ooRexx). The different in 4.0 is how Rexx is using the registered exit information. In 3.2.0, the exit handler was queried on each call to the handler, so deregistering the handler will cause an error, as you observed. In 4.0, the information about the handlers is resolved once at the RexxStart initial startup, and that entry point information is used for all calls. Deregistering the handler has no effect. The question would be: can one rely on ooRexx 4.0 to deregister the matching (nested) exit handler? No, the interpreter never deregisters a handler. A second question: removing the RexxDerigsterExit(...) from the code allows the programs to run correctly under both, 3.2 and 4.0. Are there any side-effects one should consider if not deregistering the (continuously) registered exit handlers? It depends on the type of hander being registered. If you are using RexxRegisterExitExe() (which you seem to be), then all of those exits will be deregistered when the process that registeres them terminates. If you're using the DLL form, then they are persistent. Thank you very much, indeed! ---rony -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Another possible problem and maybe a possible solution ... (Re: Problem with prologue of ::requires file not executing
Hi there, Rick McGuire wrote: You have misunderstood what this thread was about. Mike's programs were unaffected, oodialog has already been reworked to remove an old hacky way to get around the old behavior. This really only becomes an issue for programs that stuffed things into .local to get around how ::requires used to work AND those programs are relying on the information in .local persisting between RexxStart() invocations. In addition to the .local-problem there is one more possible problem: if the external function library needs to be configured from the Rexx program for each RexxStart(), this is in the current drop not possible! E.g. in the case of BSF4Rexx the external function library gets configured by the initialization/prologue code in BSF.CLS. If the initialization/prologue code is not executed, then the Rexx programs cannot function correctly anymore! (The same is true for UNO.CLS which adds the support to script the OpenOffice.org applications, sitting on top of BSF.CLS.) --- It is impossible to say how many applications are deployed in companies which invoke Rexx via RexxStart() because they use Rexx as a scripting language for their applications. If they dispatch ooRexx programs that deploy the requires-directive, then they may depend on the current behaviour of GA-ooRexx (the behaviour has been there since the IBM Object REXX days), in that after following all directives the initialization/prologue code gets run, which indeed does also carry out all sort of initializations. In such use-cases it may not be possible to replace the requires-directive with a call being the very first statement in the initialization/prologue code, because it may be the case that the directives refer to public classes and public routines in the required programs ! Now, the current (pre 4.0) behaviour of files/programs/packages being required via the requires-directive has been a constant cause of confusion (each requires causes in the scope of that program that required public classes are scoped class object instances that are not equal to the class object instances of other programs having required the same package!), hence coming up with a solution that truly allows a required program/package to be required globally, i.e. any other requires would refer to the already globally (cached) required file/package. Skimming over the current source code of ooRexx 4.0 one can tell that a lot of effort has been invested in this desired (and very appreciated!) behaviour available only in ooRexx 4.0. --- Thinking about this particular problem from a distance of a few days, weeks, it seems that the real problem currently is that the new global behaviour is currently set out to be the default behaviour for ooRexx 4.0! This therefore may jeopardize all ooRexx programs, that have exploited the classic requires-behaviour, needing the initialization/prologue part to be run for each RexxStart(). Hence, how about the following idea? * Let the requires-directive behave as in all previous versions of ooRexx (semantics of context-CallProgram()?), e.g. ::requires someRexxPackage.rex /* executes as in all previous versions of ooRexx */ * allow /a new keyword on the requires directive/ that tells ooRexx 4.0 to use the new behaviour (semantics of PackageManager::loadRequires(...)), e.g. if the new keyword is named global (maybe there are more meaningful keywords like cache, loadonce, singleton, etc.) ::requires someRexxPackage.rex *global */* global keyword causes the package to be globally cached */ This would allow all pre-ooRexx 4.0 programs with requires-directives to execute as in the past, hence backward compatibility in this regard is ensured. It also would allow to start to use the new (preferable) behaviour if the ooRexx programmer wishes to do so (and I think, if ooRexx programmers realize how great the new behaviour is, that they will eventually adopt their programs to do so; there may be - probably rare - cases where this would not be possible, but then that would not be a problem either as the old behaviour is available as well). In addition, having seen the new C++ APIs new libraries and packages can be devised that would easily be able to exploit globally cached packages. HTH, ---rony -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Another possible problem and maybe a possible solution ... (Re: Problem with prologue of ::requires file not executing
Rick McGuire wrote: Sorry, I am adamantly opposed to any effort to preserve that old behavior. It was the cause of no end of problems, including most of the hacks you're now citing as instances of the problems. At this point in the project, what you're proposing will be an incredibly disruptive change to the code base that I'm not willing to make. If you are willing to put in the time and effort to come up with a patch that demonstrates this change, we might consider it. It, however, needs to be done quickly, as I'm also not willing to delay the release of 4.0 to wait for it. O.K., I'll do my best, but it'll take some time for me to come even close to be able to do that. ---rony On Sun, Apr 5, 2009 at 8:55 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Hi there, Rick McGuire wrote: You have misunderstood what this thread was about. Mike's programs were unaffected, oodialog has already been reworked to remove an old hacky way to get around the old behavior. This really only becomes an issue for programs that stuffed things into .local to get around how ::requires used to work AND those programs are relying on the information in .local persisting between RexxStart() invocations. In addition to the .local-problem there is one more possible problem: if the external function library needs to be configured from the Rexx program for each RexxStart(), this is in the current drop not possible! E.g. in the case of BSF4Rexx the external function library gets configured by the initialization/prologue code in BSF.CLS. If the initialization/prologue code is not executed, then the Rexx programs cannot function correctly anymore! (The same is true for UNO.CLS which adds the support to script the OpenOffice.org applications, sitting on top of BSF.CLS.) --- It is impossible to say how many applications are deployed in companies which invoke Rexx via RexxStart() because they use Rexx as a scripting language for their applications. If they dispatch ooRexx programs that deploy the requires-directive, then they may depend on the current behaviour of GA-ooRexx (the behaviour has been there since the IBM Object REXX days), in that after following all directives the initialization/prologue code gets run, which indeed does also carry out all sort of initializations. In such use-cases it may not be possible to replace the requires-directive with a call being the very first statement in the initialization/prologue code, because it may be the case that the directives refer to public classes and public routines in the required programs ! Now, the current (pre 4.0) behaviour of files/programs/packages being required via the requires-directive has been a constant cause of confusion (each requires causes in the scope of that program that required public classes are scoped class object instances that are not equal to the class object instances of other programs having required the same package!), hence coming up with a solution that truly allows a required program/package to be required globally, i.e. any other requires would refer to the already globally (cached) required file/package. Skimming over the current source code of ooRexx 4.0 one can tell that a lot of effort has been invested in this desired (and very appreciated!) behaviour available only in ooRexx 4.0. --- Thinking about this particular problem from a distance of a few days, weeks, it seems that the real problem currently is that the new global behaviour is currently set out to be the default behaviour for ooRexx 4.0! This therefore may jeopardize all ooRexx programs, that have exploited the classic requires-behaviour, needing the initialization/prologue part to be run for each RexxStart(). Hence, how about the following idea? Let the requires-directive behave as in all previous versions of ooRexx (semantics of context-CallProgram()?), e.g. ::requires someRexxPackage.rex /* executes as in all previous versions of ooRexx */ allow a new keyword on the requires directive that tells ooRexx 4.0 to use the new behaviour (semantics of PackageManager::loadRequires(...)), e.g. if the new keyword is named global (maybe there are more meaningful keywords like cache, loadonce, singleton, etc.) ::requires someRexxPackage.rex global /* global keyword causes the package to be globally cached */ This would allow all pre-ooRexx 4.0 programs with requires-directives to execute as in the past, hence backward compatibility in this regard is ensured. It also would allow to start to use the new (preferable) behaviour if the ooRexx programmer wishes to do so (and I think, if ooRexx programmers realize how great the new behaviour is, that they will eventually adopt their programs to do so; there may be - probably rare - cases where this would not be possible, but then that would not be a problem either as the old behaviour is available as well). In addition, having seen
Re: [Oorexx-devel] Another possible problem and maybe a possible solution ... (Re: Problem with prologue of ::requires file not executing
Rick McGuire wrote: Ok, I've come up with a compromise. Packages are still loaded and maintained on a process basis, but each interpreter instance will maintain a list of packages that is used by code running in the instance and will ensure that the prologue code gets run when the package is first requested by the instance. Since .local is also maintained on an instance basis, this should fix the behavioral problems you're seeing. And the code refactoring required to implement this fixed a couple of things I was not happy about in the package manager code, so this is definitely a win-win. That's just great, thank you very much, indeed! ---rony P.S.: Looking through the svn diff, there would be no way I could have come up with a solution like that any time soon! -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Problem with ::requires 'BSF4Rexx' library
Reworking the BSF4Rexx dynamic library, and in a first step defining a RexxPackEntry using a RexxRoutineEntry with 13 entries of type REXX_CLASSIC_ROUTINE only can be compiled and be used with the RxFuncAdd() function. (There are no new type routines defined in the source file yet.) However, using ::requires BSF4Rexx library causes an exception in the Open Object Rexx Interface. I tried to isolate the problem and create a simple stand-alone testcase, but unfortunately I cannot re-create that problem there. One solution would be to upload the current set of files with a bug report via the tracker, if deemed necessary. Otherwise, this is what I can excerpt that relates to the definitions in case that is sufficient already: // External functions if loaded via Rexx // Build the list of entry points for the routines: RexxRoutineEntry bsf_external_functions[] = { REXX_CLASSIC_ROUTINE( BSF , BSF ), REXX_CLASSIC_ROUTINE( BsfAttachToTID , BsfAttachToTID ), REXX_CLASSIC_ROUTINE( BsfDetach , BsfDetach ), REXX_CLASSIC_ROUTINE( BsfDropFuncs, BsfDropFuncs ), REXX_CLASSIC_ROUTINE( BsfGetTID , BsfGetTID ), REXX_CLASSIC_ROUTINE( BsfInvokedBy, BsfInvokedBy ), REXX_CLASSIC_ROUTINE( BsfLoadFuncs, BsfLoadFuncs ), REXX_CLASSIC_ROUTINE( BsfLoadJava , BsfLoadJava ), REXX_CLASSIC_ROUTINE( BsfQueryAllFunctions, BsfQueryAllFunctions), REXX_CLASSIC_ROUTINE( BsfQueryRegisteredFunctions , BsfQueryRegisteredFunctions ), REXX_CLASSIC_ROUTINE( BsfShowErrorMessage , BsfShowErrorMessage ), REXX_CLASSIC_ROUTINE( BsfUnloadJava , BsfUnloadJava ), REXX_CLASSIC_ROUTINE( BsfVersion , BsfVersion ), REXX_LAST_ROUTINE() }; RexxPackageEntry bsf_package_entry = { STANDARD_PACKAGE_HEADER REXX_INTERPRETER_4_0_0, // anything including and after 4.0.0 will work BSFLIB,// name of the package 4.0, // package information NULL,// no load function NULL,// no unload function bsf_external_functions, // the exported functions NULL // no exported methods }; // The package loading stub. OOREXX_GET_PACKAGE() is a macro that, basically, // defines a function whose name is RexxGetPackage(). On Windows, this // function, RexxGetPackage(), must be in the exports list of the .def file used // when linking this library. OOREXX_GET_PACKAGE(BSFLIB); Would this information be already sufficient or shall I upload the files with a bug report ? ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Problem with ::requires 'BSF4Rexx' library
Rick McGuire wrote: I don't spot anything obviously wrong here, so you'll probably need to upload everything. Alternatively, since I know you occasionally build from source, try running this in the debugger and attach a stack trace to the bug report. O.K., am on the run home. Will try do that either later in the night or sometimes tomorrow evening, when I get a chance to run with a debugger (haven't done that in ages, so it may take some time, although VA should be of great help here). ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Problem with ::requires 'BSF4Rexx' library
Rick McGuire wrote: Good catch! I wonder what this actually ended up pointing to. Rick On Thu, Apr 23, 2009 at 5:39 PM, Mark Miesfeld miesf...@gmail.com wrote: On Thu, Apr 23, 2009 at 1:49 PM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: I don't know about the crash, but this isn't right: RexxPackageEntry bsf_package_entry = { ... OOREXX_GET_PACKAGE(BSFLIB); That should be: OOREXX_GET_PACKAGE(bsf); The exception still occurs. Thanks a lot for the hint of how to use Visual Studio to debug, which I obviously will need (will have to continue tomorrow evening, though, already too late and have to get up very early). ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Questions ad an object being used by a different RexxInstance ...
Given two different RexxInstances R1 and R2 running in the same process. In R1 an object O1 is created and saved in .environment. Two questions ad RexxInterpreter context: 1. If from R2 an interaction occurs with O1 (addressed via .environment), in which context does O1 execute, in R1 (the creator RexxInterpreterInstance) or in R2 (the invoker RexxInterpreterInstance)? 2. If R1 is terminated, but R2 interacts with O1 (addressed via .environment), in which context does O1 execute, in R1 (the creating RexxInterpreterInstance, but terminated) or in R2 (the invoking RexxInterpreterInstance)? ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Questions ad an object being used by a different RexxInstance ...
Rick McGuire wrote: I'm not sure this question makes any sense. An interaction on an object occurrs in the context of where the interaction is triggered. Objects are just data, and have no knowledge of where they have been created. If one instance stores an object in .environment (generally a bad practice), then it is just an object that's available for any instance. It will remain alive until the global Rexx environment is terminated. The reason for asking is this: if having multiple RexxInterpreterInstances running for different Java objects, and if one wishes to allow Java to interact with proxy Rexx objects (in the JNI layer), do I have to use the cached RexxInterpreterInstance (in the JNI layer) from which the proxied Rexx objects come from originally, or is it o.k. to use any present RexxInterpreterInstance to attach to and then forwarding the Rexx proxy object messages from Java. This is about contemplating of allowing Java to interact with Rexx objects in a general way (not only for event handlers) and sending them messages. If I understood your answer correctly, then it does not matter which RexxInterpreterInstance I would use to send messages to cached (in the JNI layer) Rexx objects. (Also assuming, that once all RexxInterpreterInstances got terminated, no such invocation should be allowed anymore, but throw an exception.) ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] I/O again
Pretty regularly I can get that problem too when opening a command line window, and first thing I would do is using rexxtry and immediately issuing a say statement (typing while rexxtry.rex starts up). Here's an example that works *quite reliably* for me: Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\Dokumente und Einstellungen\Administratorrexxtry say hallo HALLO ... rexxtry.rex on WindowsNT D:\Dokumente und Einstellungen\Administratorrexxtry REXX-ooRexx_4.0.0(MT) 6.03 24 Apr 2009 rexxtry.rex lets you interactively try REXX statements. Each string is executed when you hit Enter. Enter 'call tell' for a description of the features. Go on - try a few...Enter 'exit' to end. say sa Der Befehl RAY ist entweder falsch geschrieben oder konnte nicht gefunden werden. rc = 1 rexxtry.rex on WindowsNT Here is what maybe work for you: 1. First copy the following lines into the clipboard (note there is a trailing blank line): rexxtry say hallo rexxtry say sa exit 2. Make sure no Rexx program runs, and no command line window is open in which a Rexx program ran (not sure whether that is really necessary, but who knows) 3. Open a new command line window 4. Just paste the above lines into the window; if necessary repeat steps 2 through 4 Eventually (within ten attempts) the error comes up again (although I might have waited in between invocations, after having all command line windows closed). Here is another run, where this error occurs for the exit statement! Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. D:\Dokumente und Einstellungen\Administratorrexxtry say hallo HALLO ... rexxtry.rex on WindowsNT D:\Dokumente und Einstellungen\Administratorrexxtry REXX-ooRexx_4.0.0(MT) 6.03 24 Apr 2009 rexxtry.rex lets you interactively try REXX statements. Each string is executed when you hit Enter. Enter 'call tell' for a description of the features. Go on - try a few...Enter 'exit' to end. say sa SA ... rexxtry.rex on WindowsNT rexxtry.rex: Enter 'exit' to end. Or '?' for online REXX help. exit Der Befehl RXIT ist entweder falsch geschrieben oder konnte nicht gefunden werden. rc = 1 rexxtry.rex on WindowsNT HTH, ---rony -- Crystal Reports #45; New Free Runtime and 30 Day Trial Check out the new simplified licensign option that enables unlimited royalty#45;free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] How to halt all threads of a certain RexxInterpreter instance ?
One is able to use RexxSetHalt(tid) to halt/terminate a Rexx program running in the given tid (thread id). If supplying zero (0) as the tid, then all running Rexx threads will be halted. Now, running multiple RexxInterpreter instances, which may have multiple spawned Rexx threads. How could one halt all threads that belong to a given RexxInterpreter instance? ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] How to halt all threads of a certain RexxInterpreter instance ?
Rick McGuire wrote: Well, you might try using the Halt() API defined on the interpreter instance. That's great, thank you ! ---rony On Fri, May 1, 2009 at 3:00 PM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: One is able to use RexxSetHalt(tid) to halt/terminate a Rexx program running in the given tid (thread id). If supplying zero (0) as the tid, then all running Rexx threads will be halted. Now, running multiple RexxInterpreter instances, which may have multiple spawned Rexx threads. How could one halt all threads that belong to a given RexxInterpreter instance? ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Adding address mode information to parse version ?
With the advent of ooRexx 4.0 a new, important need arises: determining which addressing mode the running Rexx interpreter uses. This is a vital information, if e.g. one writes installation scripts in ooRexx installing native libraries that must match the bitness of the running (installed) ooRexx interpreter. Therefore I would like to open an RFE for supplying this information via Rexx, but before doing so, I would like to ask for feedback. --- A natural place to supply this fundamental information seems to be the PARSE VERSION keyword statement, which exists for supplying Rexx interpreter related version information. Going back to the ANSI REXX J18 standard and studying its information about the formatting of PARSE VERSION string this is what I have found (version string related text put into bold): * 5.10.1 Config_Constants Syntax: Config_Constants() Semantics: Set the values of the following state variables: – If there are any built-in functions which do not operate at NUMERIC DIGITS 9, then set variables #Bif_Digits. (with various tails which are the names of those built-in functions) to the values to be used. – Set variables #Limit_Digits, #Limit_EnvironmentName, #Limit_ExponentDigits, #Limit_Literal, Limit_MessageInsert, #Limit_Name, #Limit_String, Limit_TraceData to the relevant limits. A configuration shall allow a #Limit_MessageInsert value of 50 to be specified. A configuration shall allow a #Limit_TraceData value of 250 to be specified. - Set #Configuration to a string identifying the configuration. *- Set #Version to a string identifying the language processor. It shall have five words. Successive words shall be separated by a blank character. /The first four letters of the first word shall be 'REXX'./ The second word shall be the four characters '5.00'. The last three words shall be in the format which is the default for the DATE() built-in function. * * A.5.10.1 Config_Constants Existing practice is usually to implement the built-in functions using NUMERIC DIGITS 9 for the checks on the arguments. That may be inadequate for some purposes, such as the character position within a very large stream, so the configuration is allowed to indicate different values of NUMERIC DIGITS for different built-in functions. *It is intended that the right part of the first word of #Version should identify the language processor in use. It is intended that the date in the last three words should be the release date of the language processor. The base document specifies that the first word of #Version should not contain a period, so as to simplify parsing #Version. Existing practice has not honored that rule, and the rule is not part of this standard. * Therefore I would like to suggest to extend the information encoded into the first word of the #Version string, which currently is formed as: REXX-ooRexx_3.2.0(MT) 6.02 5 Dec 2007 If the first word gets extended with the address mode information in such a way that it is easy to parse, then maybe one possible encoding may be: REXX-ooRexx_4.0.0(MT*_32_bit*) 6.03 31 May 2009 REXX-ooRexx_4.0.0(MT*_64_bit*) 6.03 31 May 2009 REXX-ooRexx_4.5.0(MT*_128_bit*) 6.05 15 Dec 2015 ... Such an encoding would allow for the following keyword statement to extract the address mode: parse version (MT_ addressmode _bit However, it may be the case that there are programs which already use a pattern like ( threadMode ) to get the thread mode information, which as a result may break, if they just expect two alphabetical characters to be parsed. (IMHO quite unlikely, but still conceivable, hence looking for an alternative encoding that would not break any existing programs.) An alternative encoding, which should not affect any existing programs, parsing the version information might be: REXX-ooRexx_4.0.0(MT)*_32_bit* 6.03 31 May 2009 REXX-ooRexx_4.0.0(MT)*_64_bit* 6.03 31 May 2009 REXX-ooRexx_4.0.0(MT)*_128_bit* 6.05 15 Dec 2015 ... Such an encoding would allow for the following keyword statement to extract the address mode: parse version )_ addressmode _bit Any thoughts? Would the encoding/suggestion be sensible ? ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3.
Re: [Oorexx-devel] Starting to think about WSC
Rick McGuire wrote: Ok, since I wasn't tied down with new bug reports this morning, I thought I'd start looking at the orxscript stuff again and start putting together a plan for what we're going to do with this. This is just sort of a random collection of thoughts right now, but I thought I'd put some of these things down in writing to kickstart the discussion. 1) State of the code. The 3.2.0 was a serious hack, based on a bunch of really strange private APIs into the interpreter that broke a lot of rules for how APIs needed to be written. All of the private APIs have been removed from 4.0, and I have no intention of adding anything resembling what they did back into the API set. In the 4.0 trunk, there are the results of my original attempt at making the conversion to using the new API set, but I'm now of the opinion that this really needs to be junked and really started over from scratch. Structurally, I'd like to see this implemented by defining an ooRexx ScriptContext class that would be capable handling the different scripting interactions. Done correctly, one should be able to create and manage a scripting environment entirely from ooRexx (not the Windows one, obviously, but you could write an app in ooRexx that coule be able to embed scripts in the same sense.). Such a class, for example, would be real handy in mod_rexx. +1 The initial requirements for this script class will be driven by the requirements of the Windows scripting host, which I have not found any good documentation yet on how it works. The individual COM interface classes are documented, but I've not found any information on how things work, the order of events, how the different classes should interact, etc. I suspect that my best bet on figure this out would be to spend a bunch of time in the debugger tracing how the 3.2.0 works. Unfortunately, the scripting support requires an installed version which will seriously mess up my normal development machine, so I'll probably see if I can setup a second machine just for that purpose. Ad regsitry settings: yes, this is vital for the language to be usable as a WSH scripting language (WSE). I seem to remember that it was quite difficult for the Object REXX to figure out the necessary registry settings due to incomplete or outdated official documentation on MS side. 2) Compatibility. I'm not sure what to do here. I spent some time reading the 3.2.0 WSH docs this morning, and I found a few things quite appalling. The base scripting support just barely works because of how variables are managed between the different script fragments. We have a couple of bugs open against those characteristics already, and just fixing those bugs will result in come differences in behavior. The .wsc support is absolutely horrible. COM object equivalents are created using the same lame scripting support described above, with methods defined as ::ROUTINES rather than real methods. During the registration process, the exported object has to hand construct the typelib information using OLEObject. This is the area I'd most like to replace, and would do so by allowing any arbitrary ooRexx class to be exported as a com object and the properties mapped to the appropriate ooRexx ::attribute methods. I don't know yet if it would be possible to implement the ideal solution while maintaining the old style of definition. The Object REXX support was mostlikely modelled after Microsoft's implementations for VBScript and JScript (part of WSH which originally got introduced with the MSIE). AFAIK all methods of the objects the script host (MSIE, IIS/ASP, MS' Script) registered with the scripting engine are made available as routines as well. Hence, in ooRexx terms you can therefore do, e.g window~alert('this is an alert message') /* or instead */ call alert 'this is an alert message' I have no sense on how many people are actually using the WSH capabilities. Given the state of the code, I would have expected there to be a larger number of bug reports or RFEs against this component if people were using it for real things. Whoever uses MSIE as a GUI or IIS/ASP kind of apps will be affected. Also, whoever uses/employs WSF (Windows Script Files) and WSC (Windows Script Components). Maybe some of these slides may give a little bit of information and nutshell examples: * http://wi.wu-wien.ac.at/rgf/wu/lehre/autowin/material/foils/AutoWin_2.pdf * http://wi.wu-wien.ac.at/rgf/wu/lehre/autowin/material/foils/AutoWin_3.pdf 3) JSR-223. The Jave community process has a specification entitled Scripting for the Java Platform. This defines the Java APIs for two-way script interactions between Java and non-Java languages. I have an additional goal that the scripting class I wish to create to reimplement the WSH code will also be sufficient for implementing a JSR 223 scripting adapter. I've not had a chance to
[Oorexx-devel] Example of a rather complex WSH application implemented in ooRexx (Re: Starting to think about WSC
Just in case, backward compatibility is tested eventually with real-life WSH apps. Here is one that queries the OLE interfaces of a given COM class and renders them such that one can create nice printouts of them. If you check the compact mode than you get a reference card kind of rendering. Also, do not overlook the option to have all registry defined COM classes listed (and then just point to any, and if it's an OLE one, then the rendering of it takes place. The package contains a Rexx program that one may use to interrogate a COM object at runtime, in case one got an OLE object as a result of a method invocation and wishes to learn about its interfaces. Here's the URL: http://wi.wu-wien.ac.at/rgf/rexx/orx15/readme.html. There are two packages one needs to download: * http://wi.wu-wien.ac.at/rgf/rexx/orx08/orx8%5f200505%2ezip: contains some utilities rgf_ole_info needs * http://wi.wu-wien.ac.at/rgf/rexx/orx15/rgf_oleinfo.zip: the package, including the main application, named rgf_oleinfo.hta (hta means HTML application and is an MSIE apps running with the credentials of the user). It probably makes a good (and complex enough) test case for a real world WSH app. ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Some findings on how orxscript works
A maybe helpful URL, that contains other interesting links: http://en.wikipedia.org/wiki/Windows_Script_Host with a lot of interesting downloads Ah, was too quick, here a few more links, which you may know of already: * http://msdn.microsoft.com/en-us/library/ms950396.aspx: Scripting Main Entry point * http://msdn.microsoft.com/en-us/library/9bbdkx3k(VS.85).aspx Windows Script Host Main Entry * http://msdn.microsoft.com/en-us/library/fdee6589(VS.85).aspx Developer's Branch into Windows Script Host (look at all subnodes) These pointers should give quite a fair overview. Also, if you download the WSH package (don't have a URL handy) one gets an installable help-file that not only documents the WSH classes, but also the COM interfaces defined for Windows script host applications. (Have a zip-archive someplace.) ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] A few questions in the context of RexxCreateInterpreter, LIbraries and co-existence with the classic functions ...
While working on moving BSF4Rexx to the 4.0 APIs and at the same time keeping it backwardly compatible with Rexx scripts using it, I have been running into problems for which the cause is not clear to me (and debugging doesn't really help as the JVM takes over the debugging and I cannot get into rexx.exe or BSF4Rexx.dll when exceptions occur, just a log-file created by the JVM). For backward compatibilty it is important to have the functions RxFuncQuery(), RxFuncLoad() remaining operational (at least not causing runtime errors) such that the following code can get executed: if rxFuncQuery(BSF) = 1 then /* BSF() support not loaded yet ? */ do call rxFuncAdd BsfLoadFuncs, BSF4Rexx, BsfLoadFuncs call BsfLoadFuncs call BsfLoadJava end There is a list of thirteen such functions. Question 1: Is there a way to get to the RexxInterpreter instance pointer or RexxThreadContext pointer (which would allow for finding its RexxInterpreter instance) from within an external classic Rexx function? If there was such a function, then it would be possible to let BsfLoadFuncs be implemented in the classic style, but load from the code there the library containing the new typed REXX_ROUTINE functions. This would allow replacing the rest of the external functions by new REXX_TYPEDROUTINEs, which I would prefer over the classic style seeing how easy it is to use the new 4.0 APIs. --- Currently, the classic external functions are in place and the behaviour is the same as with the non-4.00 version, using RexxStart() to run the programs. Trying to take advantage of the new RexxCreateInterpreter() to later let scripts be executed by that instance, the following phenomenon occurs: Calling an external classic Rexx function BsfQueryRegisteredFunctions() will return a stem with the registered external functions. This external function uses RexxVariablePool() to create the stem entries, but has no effect anymore. Removing an unrelated RexxCreateInterpreter() call, fixes the behaviour, i.e. the stem values are created in the caller's context using the RexxVariablePool, as it did before. Question 2: Is this an expected behaviour or a bug? If a bug, is this information already sufficient to research the cause? --- While implementing the RexxCreateInterpreter() and using the options with either LOAD_REQUIRED_LIBRARY or REIGSTER_LIBRARY will cause a crash (again, unfortunately without being able to get there with the VS debugger). The context of this crash is as follows: Java loads BSF4Rexx (so the DLL is loaded already that contains the classic external functions), a Java engine uses a new jni function which calls into the DLL where RexxCreateInterpreter() is executed with either one of the above options in place. Question 3: Is this an expected behaviour or a bug? Question 4: If in one RexxInterpreter instance a library is loaded, are its routines visible to other RexxInstance instances as well ? --- Question 5: Is it possible to call a REXX_TYPED_ROUTINE from another REXX_TYPED_ROUTINE or from a REXX_TYPED_METHOD in native code? If so, how? ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] A few questions in the context of RexxCreateInterpreter, LIbraries and co-existence with the classic functions ...
Rick McGuire wrote: On Mon, May 4, 2009 at 11:43 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: While working on moving BSF4Rexx to the 4.0 APIs and at the same time keeping it backwardly compatible with Rexx scripts using it, I have been running into problems for which the cause is not clear to me (and debugging doesn't really help as the JVM takes over the debugging and I cannot get into rexx.exe or BSF4Rexx.dll when exceptions occur, just a log-file created by the JVM). For backward compatibilty it is important to have the functions RxFuncQuery(), RxFuncLoad() remaining operational (at least not causing runtime errors) such that the following code can get executed: if rxFuncQuery(BSF) = 1 then /* BSF() support not loaded yet ? */ do call rxFuncAdd BsfLoadFuncs, BSF4Rexx, BsfLoadFuncs call BsfLoadFuncs call BsfLoadJava end There is a list of thirteen such functions. Question 1: Is there a way to get to the RexxInterpreter instance pointer or RexxThreadContext pointer (which would allow for finding its RexxInterpreter instance) from within an external classic Rexx function? No there is not. However, if you just add BsfLoadFuncs() to the list of function defined in the BSF4Rexx() package and make it a NOP when called, then things will appear to behave the same way. This is the same approach that's been taken by packages in the interpreter itself that have been converted to the new package format. For example, see what the rxsock library is doing in the interpreter build. If there was such a function, then it would be possible to let BsfLoadFuncs be implemented in the classic style, but load from the code there the library containing the new typed REXX_ROUTINE functions. This would allow replacing the rest of the external functions by new REXX_TYPEDROUTINEs, which I would prefer over the classic style seeing how easy it is to use the new 4.0 APIs. If you implement the suggestion I made above, this will work just fine. The rxmath package is a good example. It still has a registration routine, but all the functions are defined using the typed format. There is no need to register special stubs. Great, thanks for this pointer, will look it up! --- Currently, the classic external functions are in place and the behaviour is the same as with the non-4.00 version, using RexxStart() to run the programs. Trying to take advantage of the new RexxCreateInterpreter() to later let scripts be executed by that instance, the following phenomenon occurs: Calling an external classic Rexx function BsfQueryRegisteredFunctions() will return a stem with the registered external functions. This external function uses RexxVariablePool() to create the stem entries, but has no effect anymore. Removing an unrelated RexxCreateInterpreter() call, fixes the behaviour, i.e. the stem values are created in the caller's context using the RexxVariablePool, as it did before. There can only be one interpreter instance in control of a thread at a given time. If you call RexxCreateInterpreter in the context of one of those callouts, then all API calls will be handled by the thread context you just created that pushed all of the other stuff down. This problem should go away when using the new typed routine. Question: How can one create/set a variable in the context of the caller? AFAIK one can only retrieve the existing variables in the caller's context, but not create/set a new one (in this case I would need to create a stem object and set it to the callers context variable pool using the supplied name for the stem). Question 2: Is this an expected behaviour or a bug? If a bug, is this information already sufficient to research the cause? This is the expected behavior. You're creating a new context associated with that thread. It is in control of all call-backs on that thread until the instance is terminated. To get the non-nested behavior you want, you'll probably need to spin off another thread to create the interpreter instance and keep it alive. Then, to access this instance in a nested fashion, you'll need to use AttachThread()/DetachThread() in pairs. Yes, this would be the planned exploitation. Knowing the difference in the mechanics this won't be a problem anymore, thanks again for the explanation! --- While implementing the RexxCreateInterpreter() and using the options with either LOAD_REQUIRED_LIBRARY or REIGSTER_LIBRARY will cause a crash (again, unfortunately without being able to get there with the VS debugger). The context of this crash is as follows: Java loads BSF4Rexx (so the DLL is loaded already that contains the classic external functions), a Java engine uses a new jni function which calls into the DLL where RexxCreateInterpreter() is executed with either one of the above options in place. Question 3: Is this an expected behaviour or a bug
[Oorexx-devel] How to add a new bug at Sourceforge ?
Hi there, probably a little bit overworked, combined with a new layout: how, for God's sake, does one add a new bug at https://sourceforge.net/tracker/?atid=684730group_id=119701func=browse? I would like to submit the RexxCreateInterpreter() crash before going to bed, but am stumped at not being able to find the Add new Bug/Artefact link/button. Any help highly appreciated! ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Bug: Crash RexxCreateInstance() ...
Short of being able to file a new bug in the SF tracker, I uploaded the zip-archive http://wi.wu-wien.ac.at/rgf/rexx/misc/bugs/CrashRexxCreateInterpreter%2d20090504rgf%2ezip with a nutshell version and the readme.txt http://wi.wu-wien.ac.at/rgf/rexx/misc/bugs/readme.txt describing how to re-create the bug. If tomorrow I am able to open a new bug at SF (assuming that they are reorganizing), I will do so and upload the archive as well. ---rony -- Register Now Save for Velocity, the Web Performance Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Compiled dlls uploaded (Re: Bug: Crash RexxCreateInstance() ...
Rick, Please include compiled dlls with this. I don't have the appropriate Java SDK to installed on my machine to compile this. O.K. here is the link to them: http://wi.wu-wien.ac.at/rgf/rexx/misc/bugs/. The CRASH-zip archives contain the respective versions of the DLL, compiled for debugging. ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Compiled dlls uploaded (Re: Bug: Crash RexxCreateInstance() ...
Rick McGuire wrote: I'm not seeing a crash with either version of this dll. That's strange! In the zip-archives I have enclosed also the hs_err_pid*.log files that the JVM creates. This is using: * Windows XP, SP 3 * Sun's Java 1.4 (but also occurred on later versions, will retest this with those versions later this evening) java version 1.4.2_12 Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_12-b03) Java HotSpot(TM) Client VM (build 1.4.2_12-b03, mixed mode) * ooRexx from trunk, revision 4594, debug version, compiled with the MS compiler: Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86 Those two archives cause the crash: * CrashRexxCreateInterpreter-CRASH1-20090505rgf.zip * CrashRexxCreateInterpreter-CRASH2-20090505rgf.zip This archive contains a running version (by not using any options): * CrashRexxCreateInterpreter-NO-CRASH-20090505rgf.zip ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Compiled dlls uploaded (Re: Bug: Crash RexxCreateInstance() ...
Rick McGuire wrote: Ok, I was able to reproduce this using the NODEBUG version and I think I have a fix. Just got a few minutes in between and updated to rev 4598, and yes, the problem is fixed, thank you very much! ---rony P.S.: Does it make any sense to file this as a bug with Sourceforge for documentation purposes? (Although there is no bug anymore, hence I would not see too much use in opening one.) -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad (automatic?) loading of external routines from a DLL (Re: A few questions in the context of RexxCreateInterpreter, LIbraries and co-existence with the classic functions .
Rick McGuire wrote: On Mon, May 4, 2009 at 11:43 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: ... cut ... Question 1: Is there a way to get to the RexxInterpreter instance pointer or RexxThreadContext pointer (which would allow for finding its RexxInterpreter instance) from within an external classic Rexx function? No there is not. However, if you just add BsfLoadFuncs() to the list of function defined in the BSF4Rexx() package and make it a NOP when called, then things will appear to behave the same way. This is the same approach that's been taken by packages in the interpreter itself that have been converted to the new package format. For example, see what the rxsock library is doing in the interpreter build. If there was such a function, then it would be possible to let BsfLoadFuncs be implemented in the classic style, but load from the code there the library containing the new typed REXX_ROUTINE functions. This would allow replacing the rest of the external functions by new REXX_TYPEDROUTINEs, which I would prefer over the classic style seeing how easy it is to use the new 4.0 APIs. If you implement the suggestion I made above, this will work just fine. The rxmath package is a good example. It still has a registration routine, but all the functions are defined using the typed format. There is no need to register special stubs. Just turned to the rxmath package (learned that even the loader function could be defined to be of new type) and saw no explicit library loading, hence two little questions: * does using RxFuncAdd(...) cause ooRexx to automatically load the given DLL at that time or when the added external function gets executed the first time? * Does ooRexx load all external routines defined in the RexxPackageEntry that is used with the OOREXX_GET_PACKAGE(pkgName) automatically at the time of loading the DLL? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Problem with an entry of RexxErrorCodes.h
The following code does not compile: context-RaiseException1(Error_Incorrect_call_user_defined, context-String(msg)); ... error mesage: BSF4Rexx.cc(2645) : error C2065: 'Error_Incorrect_call_user_defined' : undeclared identifier The identifier 'Error_Incorrect_call_user_defined' was located in and copied directly from interpreter/messages/RexxErrorCodes.h. This statement does compile and work: context-RaiseException1(40900, context-String(msg)); What may I be doing wrongly? --- BTW: this is a *great* way to tell the user more about errors, allowing them to locate and fix their wrong code much easier than was possible before (with the old APIs)! ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad RexxQueryFunction()
Can the RexxQueryFunction(some-function-name)-API determine whether REXX_TYPED_ROUTNEs are loaded or not? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad RexxQueryFunction()
Followup question: as RexxQueryFunction() belongs to the pre-4.0 APIs it is not aware of the REXX_TYPED_ROUTINEs that may have been registered (as per the bug tracker comment). Hence I came up with the following attempt to find out whether a routine is loaded or not, but unfortunately it does not work. Here is the attempted code (purpose: find out whether routines are available or not): RexxRoutine1(RexxStemObject, BsfQueryRegisteredFunctions, OPTIONAL_RexxStemObject, stem) // 20090505, ---rgf { #ifdef RGF_INFO fprintf(stderr, *** RGF_INFO: BsfQueryRegisteredFunctions() 1 ...\n); fflush(stderr); #endif if (stem==NULL) // argument not given { stem=context-NewStem(BsfQueryRegisteredFunctions); } int32_t entries=sizeof(ApiFncTableOrdered)/sizeof(PSZ), i=0, j=0; logical_t bExists=false; // get the package from the caller context: stolen from Mark's nutshell example my.data RexxPackageObject pkg=(RexxPackageObject) context-SendMessage0(context-GetCallerContext(),PACKAGE); // RexxDirectoryObject rdo=context-GetPackagePublicRoutines(pkg); // get all public routines RexxDirectoryObject rdo=context-GetPackageRoutines(pkg); // get all available routines RexxObjectPtr logicalVal; for (i=0; ientries; i++) // loop over all functions/routines { // query the directory whether it has the routine logicalVal=context-SendMessage1(rdo, HASENTRY, context-CString(ApiFncTableOrdered[i])); if (context-ObjectToLogical(logicalVal, bExists)) // convert to logical, save it in 'bExists' { fprintf(stderr, ... querying [%s], bExists=[%d]\n, ApiFncTableOrdered[i], bExists); fflush(stderr); if (bExists)// is the routine available at the moment, if so, save it in the stem { context-SetStemArrayElement(stem, ++j, context-String(ApiFncTableOrdered[i])); } } } context-SetStemArrayElement(stem, 0, context-Int32ToObject(j)); // set total numbers of entries return stem;// return the stem object } What am I doing wrong? How could one test whether REXX_TYPED_ROUTINES are registered or not? ---rony P.S.: Maybe API functions Has[Public]Routine(CNAME name) [and Has[Public]Class(CNAME className)] and versions for returning the respective routine/class objects may proof helpful for the API coders? -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] A few questions ad ...
Rick McGuire wrote: ... cut ... Libraries are NOT the same as ooRexx files loaded via ::requires. They don't have the concept of public_routines and public_classes Libraries don't even define classes, only the code backing methods that can be used in class definitions. A ::requires LIBRARY merely ensures that an external library is a vailable and is loaded befere the program starts executing. The routines in the library are GLOBAL, not PUBLIC, which is a concept that only applies to routines created using ::ROUTINE in another Rexx source package. O.K. so for using the same terms and to not mixing-up concepts I would use the term library for (global) routines loaded from native code, and package for Rexx source package for routines and classes defined in a Rexx program that gets called or required and which public routines and public classes are accessible thereafter. So there are two different sets of questions then. Questions ad libraries: * is it possible to learn which global routines are present (loaded) ? * is it possible to learn which libraries are present (loaded) ? Questions ad packages: * using one interpreter instance to execute one Rexx program D.rex that requires a package (e.g. named DEF.rex), that defines public routines and public classes, * after the program D.rex ended and using the same interpreter instance to execute another Rexx program G.rex: are the public routines and classes from the previously required DEF.rex visible available to G.rex, although the package DEF.rex was required by a different program D.rex that ran before invoking G.rex? If package would not be the right term for Rexx source package, what term should be used instead? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad callback (Re: A few questions ad ...
Thanks for clarifiying. In my current state of the code for BSF4Rexx for the new APIs it becomes possible to refer to ooRexx objects from Java. To do that a RexxProxy is defined at the Java side referring to a ooRexx object, which is registered (and locked) at the native layer. There are two fundamentally different modes of operation in BSF4Rexx: one is using external functions only, the other one (the preferred one, because it makes things much easier for the ooRexx coder) requires a package named BSF.CLS (this will also change a fundamental setting at the Java side of the respective BSF4Rexx engine and expects data from thereon to be encoded in a special way). Now, if the public routines and public classes of BSF.CLS were available at the time the ooRexx proxy was created, I would need to execute a public routine from that package before sending the Rexx object the message received from the Java side. So the question would be: how can I figure out for an ooRexx object what package definitions are available for it, if the call does not come from Rexx, but from JNI ? In this scenario neither GetMessagePackage() nor GetRoutinePackage() are available [in principle it should be possible that a RexxProxy on the Java side can be used for another RexxInterpreter instance spun off via a different engine instance there]. ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Conventioin for app-specific Rexx error reporting ?
Rony G. Flatscher wrote: In the process of turning BSF4Rexx to using the new APIs it becomes possible to raise conditions. Each numbered error category has a message number 900 which allows for supplying any text describing the concrete error. The question: what convention should be used to create that string such, that a Rexx coder could extract from the message the external Rexx function that caused it. E.g., if the convention would be: library_nameslashexternalRoutineOrExternalMethodKeywordslashnameOfExternalRoutineOrMethodspacelibrary_error_numbercolonspacelibrary_error_text, then the following could be achieved (provided, this is prominently documented) with any error message from a subcode error number 900: * a Rexx coder can parse the different parts of the error message, learning about the library, library routine or method, library error number and the error text, * such that if one uses multiple libraries, one could still determine exactly from which library and external routine or external method the error comes from, just by reading/analyzing/parsing the error message, if it is of subcode 900. In the following exmples using the BSF4Rexx library as an example, the externalRoutineOrExternalMethodKeyword values would be routine or method: BSF4Rexx/routine/BsfLoadJava 1: JVM is already loaded BSF4Rexx/routine/BsfLoadJava 2: JVM could not be created. BSF4Rexx/routine/BsfLoadJava 3: Initilization error: could not find javai/jvm-DLL/so BSF4Rexx/routine/BSF 1.123: Java exception thrown: [Java-related text explaining the error] ... In the meantime, having had some experiencing time with such error messages, I would like to suggest to append an opening and closing parenthesis to the names of routines to distinguish them easily from method invocations; insert also the word error between the routine/method name and the error number to make the number immediately identifiable as being an error number. Hence examples of such error messages would look like: BSF4Rexx/routine/BsfLoadJava() error 1: JVM is already loaded BSF4Rexx/routine/BsfLoadJava() error 2: JVM could not be created. BSF4Rexx/routine/BsfLoadJava() error 3: Initilization error: could not find javai/jvm-DLL/so BSF4Rexx/routine/BsfUnloadJava() error 4.999: JVM was not loaded by Rexx BSF4Rexx/routine/BSF() error 1.123: Java exception thrown: [Java-related text explaining the error] ... Would that be a sensible convention? Do you see any problems with such a convention? Do you have alternative ideas? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad retrieving package object after returning from a RexxThreadContext
Is it possible to retrieve the package object from a RexxThreadContext()? Currently it seems that package objects can only be retrieved via GetMethodPackage(), GetRoutinePackage(), or via a RexxCallContext() using the GetCallerContext() entry PACKAGE. ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Package unloader not run ?
It seems that the package unloader function does not run if there exists an interpreter instance that has not received a Terminate() request. In this use-case a RexxStart() is used to run a Rexx program, but independently, a RexxCreateInstance() instance got created and just hangs around. Is this to be expected or could that be a bug (if so, I would try to create a nutshell example)? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Package unloader not run ?
Rick McGuire wrote: Loaded packages are global to the processthey will only be unloaded once all active interpreter instances go away. Hmm. If one uses RexxCreateInterpreter(), which loads a library, but just keeps a pointer to that instance, without using it for anything (hence no code gets executed via it), does that qualify such an instance to be regarded to be active? If so, when would a Rexx interpreter instance turn to inactive? ---rony On Sun, May 10, 2009 at 1:28 PM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: It seems that the package unloader function does not run if there exists an interpreter instance that has not received a Terminate() request. In this use-case a RexxStart() is used to run a Rexx program, but independently, a RexxCreateInstance() instance got created and just hangs around. Is this to be expected or could that be a bug (if so, I would try to create a nutshell example)? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad retrieving package object after returning from a RexxThreadContext
What happens, if one uses a RexxThreadContext to send a message [i.e. SendMessage(), SendMessage0(), SendMessage1(), SendMessage2()] to an object that was retrieved from a registry in the native layer? What package is used for it? ---rony Rick McGuire wrote: Retrieving a package object from a RexxThreadContext has no meaning. There is no package associated with a thread context, only specific execution contexts such as a method invocation or a function call. Rick On Sun, May 10, 2009 at 1:21 PM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Is it possible to retrieve the package object from a RexxThreadContext()? Currently it seems that package objects can only be retrieved via GetMethodPackage(), GetRoutinePackage(), or via a RexxCallContext() using the GetCallerContext() entry PACKAGE. ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad retrieving package object after returning from a RexxThreadContext
Rick McGuire wrote: Again, there is NO SUCH CONCEPT. And I don't care how many times you ask the question, the answer will remain the same. There are not packages attached to object instances, regardless of where you obtained the object from. There is no concept of a package used for an object. However, an individual method, in the context of executing the message you send, will have a package that defines the scope of what that particular method sees. That package is the source file used to create the method, and includes entities defined in that source file plus whatever it imports via ::requires. This is exactly the same model that gets used if you're using just ooRexx code, and this model has existed since ooRexx was first created. This does not change just because you happen to be using a C++ API to invoke the method or a ~ from ooRexx code. And of course, each method that might be invoked out that method will also define its own package scope. So if I understand correctly what you are saying then the following can be stated? The current runtime does not allow ooRexx objects cached in native code to be activated from outside of ooRexx with a definable/settable context/environment, only from a running ooRexx routine/exit or a running method in which case the context of those running routines/exits/methods gets implicitly used? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad retrieving package object after returning from a RexxThreadContext
Rick McGuire wrote: Um, noand I have no idea where any of these words came from. There is no such concept as a defineable/settable context environment. So it that sense, yes this is true. It is also pure giberish. I have no idea what you think you're trying to do here. but you obviously don't understand what's going on as well as you seem to think you do. Please stop insulting! --- For the benefit of the ooRexx programmers I would like to be able to do the following: http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/current/docs/docs.apache.bsf/org/apache/bsf/BSFEngine.html#call(java.lang.Object,%20java.lang.String,%20java.lang.Object[]). This was defined more than ten years ago! And yes, I am one of the maintainers and committers of Apache BSF which BTW originated at IBM, if that helps you realize the knowledge that we talk about here. And, you know that, but others who read this list may not: I was one of those experts (http://jcp.org/en/jsr/detail?id=223) on the JCP JSR-223 group that defined the scripting framework for Java for more than three years. (JSR-223 got introduced into the Java language with version 6.0.) --- If the specifications of the language had been specified explicitly in the open, probably none of the many questions would have been necessary and a lot of time and resources could have been saved. ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Calling programs that are passed in a buffer?
To execute a program with an interpreter instance, one can get a thread context and then use -CallProgram(name, array), which expects the program to be stored in a file named name, supplying it with the arguments in array. However, if Rexx scripts are passed via a buffer (e.g. retrieved from storage locations like documents or databases) for execution with arguments, how could one have that program executed? Looking for something like CallProgramFromData(name, data, sz, array) (a Call counterpart to LoadPackageFromData(name,data,sz)). ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] (Re: Calling programs that are passed in a buffer?
Rick McGuire wrote: There is no CallProgramFromData(), but you can use NewRoutine() to create a routine object and call thatwhich is essentially the equivalent. Thank you! ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad condition object's traceback list
Analyzing the contents of the condition object in order to create the lines ooRexx creates, if run on the command line and hitting an error. (This is intended to be returned in form of a message string to Java, in case a syntax error occurs on the Rexx side.) It seems that the traceback list does not contain the starting line, and that line cannot be retrieved from the information in the condition object. Maybe an example illustrates what should be achieved: -- signal on any -- line # 1 call nested_level -- line # 2 exit-- line # 3 any:-- line # 5 o=condition(O) call dump2 o, condition object call dump2 o~traceback, traceback -- contains a routine dump2() for dumping collections ::requires rgf_util2-- line # 11 ::routine nested_level -- line # 13 say 1/0 -- line # 14 Running the above program on the command line yields the following output: 14 *-* say 1/0 -- line # 14 2 *-* call nested_level -- line # 2 Error 42 running E:\rony\dev\bsf\src\source_cc_40\tests\misc\testException.rex line 14: Arithmetic overflow/underflow Error 42.3: Arithmetic overflow; divisor must not be zero [Minor observation: it seems that the lines in the traceback do not contain leading whitespace. Is that intentional?] Running the same program, removing the line comment from the very beginning of the first line will cause the code at the any label to be executed. There the content of the condition object is dumped (public routine dump2() from rgf_util2, which I will be presenting at this year's Rexx symposium) and the traceback list, which is part of the condition object. This is the output: E:\rony\dev\bsf\src\source_cc_40\tests\misctestException.rex condition object: (13 items) # 1: index=[ADDITIONAL] - item=[an Array (0 items) id#_266380628] # 2: index=[CODE]- item=[42.3] # 3: index=[CONDITION] - item=[SYNTAX] # 4: index=[DESCRIPTION] - item=[] # 5: index=[ERRORTEXT] - item=[Arithmetic overflow/underflow] # 6: index=[INSTRUCTION] - item=[SIGNAL] # 7: index=[MESSAGE] - item=[Arithmetic overflow; divisor must not be zero] # 8: index=[PACKAGE] - item=[a Package id#_266380692] # 9: index=[POSITION]- item=[14] # 10: index=[PROGRAM] - item=[E:\rony\dev\bsf\src\source_cc_40\tests\misc\testException.rex] # 11: index=[PROPAGATED] - item=[1] # 12: index=[RC] - item=[42] # 13: index=[TRACEBACK] - item=[a List (1 items) id#_266380646] -- traceback: (1 items) # 1: index=[0] - item=[14 *-* say 1/0 -- line # 14] -- It seems that the traceback list in the condition object is incomplete as line # 2 is missing from it. Is this intentional or a bug? If intentional, how could one get at that line from the condition object? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad condition object's traceback list
Rick McGuire wrote: This is the correct result. The traceback only includes lines back to the point where the condition was trapped. Since your internal routine call inherits the signal on settings from the call, the error trap is triggered while still in the internal routine, so line 2 does not get added to the traceback. From native code the only piece of information that is available about conditions is the condition object retrieved by GetCondition(). If it is not possible to get at the line number where the signal occurred [and preferably the sourceline(sigl)], then the condition object is in some use cases unfortunately of no great help It seems that what is currently missing from the condition object then, is the value of SIGL and preferably the sourceline(SIGL). Shall I open a RFE to ask for them, or do you regard that to be useless? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] CMS/TSO Pipelines support for Rexx
James, please lookup rexxpg.pdf, chapter 9, Rexx C++ Application Programming Interfaces. There you will find the C++ APIs documented, and among the documentation you will find the new options and there the option named DIRECT_ENVIRONMENTS which supplies a context for the purpose you need. Chapter 9.13, Command Handler Interface, gives an example. Instead of RexxStart() you would use RexxCreateInterpreter() and from a thread context something like CallProgram(...). The new type handler then will have the variable context available to it. Therefore I think that no changes to the ooRexx 4.0 APIs are necessary to accomodate to your needs. HTH, ---rony James Johnson wrote: I have a library that implements CMS/TSO Piprlines support for the PC. I have interfaced this library to ooRexx 4.0. To accomplish this I had to make so changes to the 4.0 beta. 1) The interface is thru a SubCom environment. I had to modify the subcom CommandHandler to pass a CallContext to the library entry point. Like the following: __declspec(dllexport) RexxReturnCode REXXENTRY PipeSubCom( RexxCallContext *context, PCONSTRXSTRING Command, /* Command string passed from the caller */ unsigned short *Flags, /* pointer too short for return of flags */ PRXSTRING Retstr) /* pointer to RXSTRING for RC return */ This was necessary because the PipeLine library creates several threads to process the request. Thus the RexxVariablePool is not available to these new threads. The RexxCallContext provides the needed access via GetContextVariable() and SetContextVariable(). Although for my testing purposes I did not do this, I think the best way to handle this would be to add a fourth optional parameter to the RxSubCom Register request. This optional parameter would specify the context to passed on a call to the subcom entry point. IE rxsubcom register rxpipe rxpipe pipesubcom callcontext 2) The user is able to write their own pipeline stages in Rexx. The pipeline invokes these stages via a new Rexx function RexxStartSubCom. This routine is just RexxStart with an additional parameter. I had to add an additional parameter for a pointer to the pipeline context that the user stages is running under. I stored this pointer in the LocalEnvironment directory. The RexxCallContext has routines to access this directory. I am not particular where this pointer is stored as long as I have access to it. Also I am happy to use the new interface to invoke the user stages. This way just seemed easier for my testing purposes. This is my new RexxStartSubCom: int REXXENTRY RexxStartSubCom ( size_t, /* Num of args passed to rexx */ PCONSTRXSTRING, /* Array of args passed to rex */ const char *, /* [d:][path] filename[.ext] */ PRXSTRING,/* Loc of rexx proc in memory */ void *, /* SubCom context */ const char *, /* ASCIIZ initial environment.*/ int, /* type (command,subrtn,funct) */ PRXSYSEXIT, /* SysExit env. names codes */ short *, /* Ret code from if numeric */ PRXSTRING ); /* Retvalue from the rexx proc */ typedef RexxReturnCode (REXXENTRY *PFNREXXSTARTSUBCOM)(size_t, PCONSTRXSTRING, const char *, PRXSTRING, void *, const char *, int, PRXSYSEXIT, short *, PRXSTRING); #define REXXSTARTSUBCOM RexxStartSubCom In ActivityDispather.hpp I changed the definition of virtual void invoke(PRXSYSEXIT exits, const char *env); to the following: virtual void invoke(PRXSYSEXIT exits, const char *env, void *subComContext); Thus in my RexxStartSubCOm I have the following: arguments.invoke(exits, envname, subComContext); I also changed the other occurrences of arguments.invoke() to be: arguments.invoke(exits, envname, NULL); I modified the ActivityDispatcher::invoke() routine as follows: void ActivityDispatcher::invoke(PRXSYSEXIT exits, const char *env, void * subComContext) { // this creates a new instance to run under, with an active activity InstanceBlock instance(exits, env); if (subComContext) { RexxString *index = new_string(SubComContext); RexxPointer *ptr = new_pointer(subComContext); RexxDirectory *local = instance.instance-getLocal(); local-put(ptr, index); } // go run the instance on the current activity instance.activity-run(*this); }
[Oorexx-devel] Question ad context
When creating functions, procedures in native code, and expecting as an argument a context (one of ThreadContext, MethodContext, CallContext, ExitContext), then sometimes the same functionality is needed, but currently one must copy the entire body of the native function/procedure, because there seems to be no common context defined, which one could use instead. Or phrased differently: is it possible to define a function or a procedure in native code that expects as its first argument a context object, but one is allowed to pass any of the four ThreadContext, MethodContext, CallContext or ExitContext? Maybe some common context that would of course only have those functions that are available in all of these four contexts (somewhat a little inheritance hierarchy among the contexts)? ---rony -- The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Possible to supply an object to a raised condition ?
When raising a condition via native code, is it possible to supply an (additional) object with the condition to be raised, such that one is able to fetch it from a condition object? The intent is to supply a Java Throwable object with a Rexx condition that gets raised as a result of a thrown Java exception. ---rony -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Creating method objects from data may raise a syntax exception
When creating a method object with code supplied from a buffer the following error may appear, if the data contain LF or CRLF: F:\test\o4rx\tests\setmethodtest.rex 1 *-* ? 7 *-* m=.method~new(aha, code) Error 13 running aha line 1: Invalid character in program Error 13.1: Incorrect character in program ? ('0D'X) Is this intended? If so, is there a simple utility at the native layer to convert that (maybe into semi-colons or into a RexxArrayObject)? ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] A little question
Can anyone see why the following statement would not retrieve and show the same value from a stem variable? saybsf.methodName=pp(bsf.METHODNAME) pp(bsf.[METHODNAME]) The default value for stem is .nil, the output from the above statement is: bsf.methodName=[The NIL object] [windowClosing] The stem object is created in a caller's context from an external routine. Maybe there is a bug somewhere as all other entries in the stem can be retrieved using the usual stem notation, except for this one that has a tail value of METHODNAME. Maybe I am overlooking something obvious. ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Problem with SysStemSort, but ...
Got an exception with applying SysStemSort(), the debugger pointing to RexxLocalVariables.hpp, inline function: inline RexxVariable *get(size_t index) { return locals[index]; } with index=0. Unfortunately, I am not able to create an isolated test case. If I write the stem's values into a file, load it from there and carry out the SysStemSort() then it works. The runtime error only occurs, when being executed in the context of BSF4Rexx 4.0: here the System properties values are retrieved and then stored in a stem variable, where the key and its value are delimited by 010203x. [The current state of the BSF4Rexx.dll is such, that it would not make sense to hand it out, as it generates too much noise and spills too much debugging blood.] Is there anything I could provide at this moment to help pin this down, or is the above already sufficient? ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Problem with SysStemSort, but ...
Rick McGuire wrote: I just thought of one more thing that could cause the error you're seeing. If you do an AttachThread() at some point and neglect to do a corresponding DetachThread() before returning to your caller, you'll end up with a corrupted activaation stack that will result in problems with legacy callback APIs like RexxVariablePool or RexxStemSort. What;s showing up in this traceback very much appears to match what might happen in that sort of situation. In this particular program an external function BSF(), defined as RexxRoutine1(RexxObjectPtr, BSF, ARGLIST, argArray) {...} gets invoked to communicate to the Java side. There are no calls from Java into BSF4Rexx occurring, hence there AttachThread() and DetachThread() are not invoked in this case (at least not from BSF4Rexx). Also, BSF4Rexx in this case does not excercise any variable gets or sets. It just interacts with Java and returns a (string) value back, which gets stored in the stem. ---rony P.S.: Just for completeness, here is the Rexx program in question: /* classic Rexx version, ---rgf, 2003-02, 2003-05-10, 2003-09-04, 2005-12-28 */ /* this version works on Java 1.1 too (because using wrapEnumeration()) */ /* load the BSF4Rexx functions and start a JVM, if necessary */ if rxFuncQuery(BSF) = 1 then /* BSF() support not loaded yet ? */ do call rxFuncAdd BsfLoadFuncs, BSF4Rexx, BsfLoadFuncs call BsfLoadFuncs /* load all BSF*() functions */ call BsfLoadJava /* load Java */ end /* 'Class.class' is pre-registered for Rexx, cf. docs */ system=bsf('invoke', 'Class.class', 'forName', 'java.lang.System') properties=bsf('invoke', system, getProperties) /* get the System properties */ enum=bsf('invoke', properties, 'propertyNames')/* get an enumeration of the property names */ /* wrap the Enumeration object, so Java 1.1 can handle this too (overcome Java inner class access restriction) */ /* the following statement is *not* necessary for Java = 1.2 */ enum=bsf('wrapEnumeration', enum) say copies(=, 70) stem. = 0 deli = 010203x do i=1 to 5000 while bsf('invoke', enum, 'hasMoreElements') /* loop over enumeration */ key=bsf('invoke', enum, 'nextElement') stem.i= key || deli || bsf('invoke', properties, 'getProperty', key) stem.0=i /* remember total of elements */ end say stem.0 elements, now sorting... call sysStemSort stem. l=length(stem.0) do i=1 to stem.0 parse var stem.i key (deli) val say i~right(l): pp(key)~left(31)=pp(val) end exit pp: procedure return [ || arg(1) || ] -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Another observation (Re: Problem with SysStemSort, but ...
Rick, when invoking that program via Java, then it works without a problem! If invoked via Java then in the native layer an AttachThread() is invoked, a Routine object is created and invoked with CallRoutine(), followed by a matching DetachThread(). ---rony Rony G. Flatscher wrote: Rick McGuire wrote: I just thought of one more thing that could cause the error you're seeing. If you do an AttachThread() at some point and neglect to do a corresponding DetachThread() before returning to your caller, you'll end up with a corrupted activaation stack that will result in problems with legacy callback APIs like RexxVariablePool or RexxStemSort. What;s showing up in this traceback very much appears to match what might happen in that sort of situation. In this particular program an external function BSF(), defined as RexxRoutine1(RexxObjectPtr, BSF, ARGLIST, argArray) {...} gets invoked to communicate to the Java side. There are no calls from Java into BSF4Rexx occurring, hence there AttachThread() and DetachThread() are not invoked in this case (at least not from BSF4Rexx). Also, BSF4Rexx in this case does not excercise any variable gets or sets. It just interacts with Java and returns a (string) value back, which gets stored in the stem. ---rony P.S.: Just for completeness, here is the Rexx program in question: /* classic Rexx version, ---rgf, 2003-02, 2003-05-10, 2003-09-04, 2005-12-28 */ /* this version works on Java 1.1 too (because using wrapEnumeration()) */ /* load the BSF4Rexx functions and start a JVM, if necessary */ if rxFuncQuery(BSF) = 1 then /* BSF() support not loaded yet ? */ do call rxFuncAdd BsfLoadFuncs, BSF4Rexx, BsfLoadFuncs call BsfLoadFuncs /* load all BSF*() functions */ call BsfLoadJava /* load Java */ end /* 'Class.class' is pre-registered for Rexx, cf. docs */ system=bsf('invoke', 'Class.class', 'forName', 'java.lang.System') properties=bsf('invoke', system, getProperties) /* get the System properties */ enum=bsf('invoke', properties, 'propertyNames')/* get an enumeration of the property names */ /* wrap the Enumeration object, so Java 1.1 can handle this too (overcome Java inner class access restriction) */ /* the following statement is *not* necessary for Java = 1.2 */ enum=bsf('wrapEnumeration', enum) say copies(=, 70) stem. = 0 deli = 010203x do i=1 to 5000 while bsf('invoke', enum, 'hasMoreElements') /* loop over enumeration */ key=bsf('invoke', enum, 'nextElement') stem.i= key || deli || bsf('invoke', properties, 'getProperty', key) stem.0=i /* remember total of elements */ end say stem.0 elements, now sorting... call sysStemSort stem. l=length(stem.0) do i=1 to stem.0 parse var stem.i key (deli) val say i~right(l): pp(key)~left(31)=pp(val) end exit pp: procedure return [ || arg(1) || ] -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Questions ad Halt() and Terminate(), as well as RexxSetHalt()
Rick McGuire wrote: Terminate() does not terminate threads, it terminates the interpreter instance. The termination call can only be made on the original thread that created the interpreter instance and will wait for any other threads to terminate before shutting down the instance. O.K.: studying a use case from a BSF4Rexx user who uses Java multithreading to dispatch Rexx scripts: from debug output I can see that the Terminate() is called on another thread than the one that carried out the RexxCreateInterpreter(). Terminate() seems to return immediately. This is done twice in that Java program. The first thread with running a Rexx program is halted with RexxSetHalt(pid, 0) followed by a Terminate(), whereas the second thread is halted with Halt(), followed by a Terminate(). Then, when all Rexx programs started on different Java threads ended (judged by the output they produce with SAY), the Java side still seems to wait on Rexx to finish (after the last thread's Rexx program ran). Questions: * Shall I prevent calls to Terminate() if issued on the wrong thread? * Should the Rexx interpreter instance indicate success or failure of Terminate(), currently it is defined to return void ? * Could it be that given the above scenario, that the Rexx runtime gets into a state where it waits? If so, how could one prevent that to happen or, alternatively, how to forcefully end a Rexx instance? Halt() can be issued from any thread, and does not even require an AttachThread() call since it is a method of the instance context. There's no way to determine if there are any threads active on the instance, and I really doubt it is safely possible. The legacy APIs can be used, but I really don't recommend their usage. They really just map down into the appropriate Halt() calls. How could RexxSetHalt(pid, 0) (halt all running Rexx threads, assuming that all means of all interpreter instances) be expressed with the new APIs? ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Another observation (Re: Problem with SysStemSort, but ...
Rick McGuire wrote: The other possibility is you've called RexxCreateInterpreter() on a thread that was already owned by Rexx. In that case, the RexxThreadContext returned with the instance pushes down the active one and can create the same symptoms if you return without destroying the instance. In that situation, you should either create the instance on a separate thread or just inherit the instance of the program that called you in the first place. In the scenario that rexx.exe is used to run the program (which then fails), no RexxCreateInterpreter() is carried out by BSF4Rexx. ---rony On Mon, May 25, 2009 at 5:08 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Rick, when invoking that program via Java, then it works without a problem! If invoked via Java then in the native layer an AttachThread() is invoked, a Routine object is created and invoked with CallRoutine(), followed by a matching DetachThread(). ---rony Rony G. Flatscher wrote: Rick McGuire wrote: I just thought of one more thing that could cause the error you're seeing. If you do an AttachThread() at some point and neglect to do a corresponding DetachThread() before returning to your caller, you'll end up with a corrupted activaation stack that will result in problems with legacy callback APIs like RexxVariablePool or RexxStemSort. What;s showing up in this traceback very much appears to match what might happen in that sort of situation. In this particular program an external function BSF(), defined as RexxRoutine1(RexxObjectPtr, BSF, ARGLIST, argArray) {...} gets invoked to communicate to the Java side. There are no calls from Java into BSF4Rexx occurring, hence there AttachThread() and DetachThread() are not invoked in this case (at least not from BSF4Rexx). Also, BSF4Rexx in this case does not excercise any variable gets or sets. It just interacts with Java and returns a (string) value back, which gets stored in the stem. ---rony P.S.: Just for completeness, here is the Rexx program in question: /* classic Rexx version, ---rgf, 2003-02, 2003-05-10, 2003-09-04, 2005-12-28 */ /* this version works on Java 1.1 too (because using wrapEnumeration()) */ /* load the BSF4Rexx functions and start a JVM, if necessary */ if rxFuncQuery(BSF) = 1 then /* BSF() support not loaded yet ? */ do call rxFuncAdd BsfLoadFuncs, BSF4Rexx, BsfLoadFuncs call BsfLoadFuncs /* load all BSF*() functions */ call BsfLoadJava /* load Java */ end /* 'Class.class' is pre-registered for Rexx, cf. docs */ system=bsf('invoke', 'Class.class', 'forName', 'java.lang.System') properties=bsf('invoke', system, getProperties) /* get the System properties */ enum=bsf('invoke', properties, 'propertyNames')/* get an enumeration of the property names */ /* wrap the Enumeration object, so Java 1.1 can handle this too (overcome Java inner class access restriction) */ /* the following statement is *not* necessary for Java = 1.2 */ enum=bsf('wrapEnumeration', enum) say copies(=, 70) stem. = 0 deli = 010203x do i=1 to 5000 while bsf('invoke', enum, 'hasMoreElements') /* loop over enumeration */ key=bsf('invoke', enum, 'nextElement') stem.i= key || deli || bsf('invoke', properties, 'getProperty', key) stem.0=i /* remember total of elements */ end say stem.0 elements, now sorting... call sysStemSort stem. l=length(stem.0) do i=1 to stem.0 parse var stem.i key (deli) val say i~right(l): pp(key)~left(31)=pp(val) end exit pp: procedure return [ || arg(1) || ] -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad compiler output for debugging
Currently, whenever I run into an exception under the control of Java, the MSVS2008 Professional debugger does not get triggered, instead a file hs*.log gets created with all sort of interesting information. Eg. (this one is from pressing Ctl-c in a hanging ooRexx program, that got started via Java): # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x7c921766, pid=4808, tid=5280 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [ntdll.dll+0x11766] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # --- T H R E A D --- Current thread (0x02cc3400): JavaThread Thread-2 [_thread_in_native, id=5280, stack(0x0346,0x034b)] siginfo: ExceptionCode=0xc005, reading address 0x3536363d Registers: EAX=0x000c0190, EBX=0x000c, ECX=0x7fbaf000, EDX=0x000c0608 ESP=0x034ae594, EBP=0x034ae7b4, ESI=0x35363638, EDI=0x0003 EIP=0x7c921766, EFLAGS=0x00010212 Top of Stack: (sp=0x034ae594) 0x034ae594: 7c9200c4 0008 7eef3fc8 0x034ae5a4: 7eef3fc8 034ae5b8 7eef1e90 0x034ae5b4: 034ae5f8 031d61ec 7eef3fc8 7eef3fc8 0x034ae5c4: 4e7e8ca9 7eef1e40 7eef408c 034ae5e0 0x034ae5d4: 031610a6 0090 7eef4088 034ae620 0x034ae5e4: 031750aa 0090 4e7e8f71 7eef408c 0x034ae5f4: 7eef4118 0325a6ac 0325a6f8 034ae624 0x034ae604: 7eef4118 7eef4118 7eef408c 034ae61c Instructions: (pc=0x7c921766) 0x7c921756: 04 00 e9 e8 f2 ff ff 8b 70 04 83 ee 08 89 75 c8 0x7c921766: 8a 46 05 88 45 e3 8d 4e 08 8b 39 89 bd 48 fe ff Stack: [0x0346,0x034b], sp=0x034ae594, free space=313k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x11766] C [kernel32.dll+0x14c05] *C [rexx.dll+0xa4074] C [rexx.dll+0x4255f] C [rexx.dll+0x57307] C [rexx.dll+0x572aa] C [rexx.dll+0x1c8d9] C [rexx.dll+0x51438] C [rexx.dll+0x5ac96] C [rexx.dll+0x4cb23] C [rexx.dll+0x66b76] C [BSF4Rexx.dll+0xae5e] C [BSF4Rexx.dll+0x5422]* j org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxRunProgram(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;+0 j org.rexxla.bsf.engines.rexx.RexxEngine.apply(Ljava/lang/String;IILjava/lang/Object;Ljava/util/Vector;Ljava/util/Vector;)Ljava/lang/Object;+295 j org.apache.bsf.BSFManager$1.run()Ljava/lang/Object;+28 v ~StubRoutines::call_stub Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxRunProgram(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/Object;+0 j org.rexxla.bsf.engines.rexx.RexxEngine.apply(Ljava/lang/String;IILjava/lang/Object;Ljava/util/Vector;Ljava/util/Vector;)Ljava/lang/Object;+295 j org.apache.bsf.BSFManager$1.run()Ljava/lang/Object;+28 v ~StubRoutines::call_stub j java.security.AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;+0 j org.apache.bsf.BSFManager.apply(Ljava/lang/String;Ljava/lang/String;IILjava/lang/Object;Ljava/util/Vector;Ljava/util/Vector;)Ljava/lang/Object;+63 j Test.exec(Ljava/lang/String;)Ljava/lang/String;+33 j Test.run()V+26 j Test.access$000(LTest;)V+1 j Test$1.run()V+15 j java.lang.Thread.run()V+11 v ~StubRoutines::call_stub --- P R O C E S S --- Java Threads: ( = current thread ) 0x02fa0800 JavaThread Timer-1 [_thread_blocked, id=4432, stack(0x034b,0x0350)] 0x002b7000 JavaThread DestroyJavaVM [_thread_blocked, id=5336, stack(0x00a1,0x00a6)] =0x02cc3400 JavaThread Thread-2 [_thread_in_native, id=5280, stack(0x0346,0x034b)] 0x02ccb400 JavaThread Timer-0 [_thread_blocked, id=1596, stack(0x0340,0x0345)] 0x02c02000 JavaThread Low Memory Detector daemon [_thread_blocked, id=2504, stack(0x02eb,0x02f0)] 0x02bfbc00 JavaThread CompilerThread0 daemon [_thread_blocked, id=3864, stack(0x02e6,0x02eb)] 0x02bfa400 JavaThread Attach Listener daemon [_thread_blocked, id=3492, stack(0x02e1,0x02e6)] 0x02bf9000 JavaThread Signal Dispatcher daemon [_thread_blocked, id=3816, stack(0x02dc,0x02e1)] 0x02bf4000 JavaThread Finalizer daemon [_thread_blocked, id=688, stack(0x02d7,0x02dc)] 0x02bef800 JavaThread Reference Handler daemon [_thread_blocked, id=1428, stack(0x02d2,0x02d7)] Other Threads: 0x02bedc00 VMThread [stack:
Re: [Oorexx-devel] Question ad compiler output for debugging
Rick McGuire wrote: Have you tried building a a debug vsrsion of ooRexx to run with? If you're running from an installed version, build the debug version and drop the new .exes and dlls in the install location, along with the .pdb files containing the debug symbols. Yes, I always build both packages and install the debug version of ooRexx. Problem is, that in this use case java.exe takes over (invocation java Test, where Test.java will invoke twice a Rexx script in different threads, where the Rexx script calls another Rexx script) and the debugger never gets to step in, instead the hs*.log file is created giving those hexadeciaml offsets (?) in the respective dll's, including rexx.dll and BSF4Rexx.dll. Hence, if I could figure out from that information which statement in the respective dll this refers to, it would help me locate the area such that further debugging at that spot became possible. Am trying to set breakpoints in the BSF4Rexx.dll upfront in order to get the debugger to step in, but to no avail so far (am practically a rookie in using the MSVS debugger in this context :( ). ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad compiler output for debugging
Jean-Louis, Since you have EXCEPTION_ACCESS_VIOLATION (0xc005) you can try to select the Access violation in Debug / Exceptions, under Win32 exceptions. See http://msdn.microsoft.com/en-us/library/d14azbfh.aspx It's written : The debugger can break execution of your application immediately when an exception occurs, giving you a chance to debug the exception before a handler is invoked. Thank you very much indeed for this tip as well, which also looks very interesting! Regards, ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Problem with SysStemSort, but ...
Rick McGuire wrote: I just thought of one more thing that could cause the error you're seeing. If you do an AttachThread() at some point and neglect to do a corresponding DetachThread() before returning to your caller, you'll end up with a corrupted activaation stack that will result in problems with legacy callback APIs like RexxVariablePool or RexxStemSort. What;s showing up in this traceback very much appears to match what might happen in that sort of situation. Finally could trace this down and come by that problem. However, it has nothing to do with AttachThread() and DetachThread()! The following happens: rexx.exe runs a rexx script which loads BSF4Rexx and then Java. This will cause on the Java side the creation of another RexxInterpreterInstance in the same thread that does not get used at all, as upon return the current executing rexx scripts continues to run. Then, from this script calls to the external function BSF() occur, which means that that function has a callContext availble for further processing (hence no need in this case to execute an AttachThread() and DetachThread()). Not sure, whether this is a bug in the interpreter runtime. It seems that after creating a new Rexx interpreter instance that unused instance later interferes with the original Rexx interpreter instance? ---rony P.S.: This use case is not yet debugged in full, as I run into problems in the unloader, which may have to do with this. Will only be able to trace that further later in the afternoon, or if all goes foul only tomorrow. (And then going after the particular multithreading problem I have been chasing down, in the case of multithreaded executed Rexx scripts that get halted.) -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Problem with SysStemSort, but ...
Rick McGuire wrote: This is exactly the last scenario I described to you yesterday and you adamantly declared that RexxCreateInterpreter was not getting called. There is an association between a thread and the top-most thread context that is created on that thread. Once you call RexxCreateInterpreter on a given thread, you've created a new thread context and all legacy callbacks will map back to the the instance that is at the top of the call stack. Yes, I thought so. But after going through the code path I found that. I see you have two choices for calls that involve this sort of nesting: 1) Spin off a thread that creates an interpreter instance and holds it active, then use AttachThread()/DetatchThread() on that instance for all of your callbacks. O.K. Currently I am Terminate()-ing that instance again before returning from the Java initialization. But then, when running the unloader I get a problem in that sending messages to a directory object causes an exception. That directory object is created in the loader, globally locked and should be cleaned, unlocked and freed in the unloader. Have to look yet further into this corner. 2) Since the first usage is initiated by Rexx code, just use the interpreter instance from the initial call context as your active instance. Yes, that is what I do (will go through the code path once more, once I get a little bit more time). ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://www.creativitycat.com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Ad unloader
Under what conditions would a defined unloader function be run by the runtime? What could be reasons that it does not get invoked? Reason: when running a test-program via rexx.exe, the unloader runs at the end of the program. When running via Java, the unloader does not run (I seem to remember that a couple of weeks ago it did run nevertheless), even though all Rexx interpreter instances should be terminated at that point. ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Ad unloader
Rick McGuire wrote: The unloader gets called when all interpreter instances have been terminated and the global Rexx environment is going to be shut down. Any active instance, regardless of how it is created, is enough to keep these active. If the process terminates while there are still active instances, then these are not going to get called. O.K., I just *tried* to upload a zip-archive that exhibits the problem. Unfortunately, I got thrown out twice: * the first time, because the upload file limit must not exceed 256KB * then, after having created chunks of 256KB and a script to recreate the original file I was moved to an error page, because I forgot to log-in. This caused the loss of my description, such that I just will briefly wirte up another one. Can't Sourceforge be configured to check the login-state *before* one opens an artefact item to help loosing entered data? (I really wonder, whether people who experienced that usability problem with Sourceforge whether they gave in in reporting problems.) In this particular case the file-size is large, because I would like to supply the compiled versions and all files created in the compilation step to ease debugging for you, because then the example can be run right out of the box. This size-limit (seems to be new, maybe introduced the last time Sourceforge changed their appearance?) for these kinds of archives is definitely too small. --- O.K. added a readme.txt to the archive that briefly describes the problem and how to run the showcase. Will take a while before all chunks are uploaded. ---rony On Wed, May 27, 2009 at 8:38 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Under what conditions would a defined unloader function be run by the runtime? What could be reasons that it does not get invoked? Reason: when running a test-program via rexx.exe, the unloader runs at the end of the program. When running via Java, the unloader does not run (I seem to remember that a couple of weeks ago it did run nevertheless), even though all Rexx interpreter instances should be terminated at that point. ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad a possibility of shutdown hooks (Re: Problem with
Rick McGuire wrote: Note that you really have very limited ability to do anything in a package unloader. At this point, everything is shutting down. All of the instances have been cleaned up already and this is one of the very last steps in the process of cleaning thiings up. I doesn't surprise me that you might be having problems calling things in that state. Would it be possible/feasible to add a shutdown hook capability to ooRexx (e.g. like Java)? Some logic like: allow registering (unregistering) shutdown hooks (e.g. like Java), and right before the runtime starts to shutdown (maybe when all Rexx interpreter instances got terminated) - and well before the unloaders get invoked - all added shutdown hooks would get run? ---rony -- Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, iPhoneDevCamp as they present alongside digital heavyweights like Barbarian Group, R/GA, Big Spaceship. http://p.sf.net/sfu/creativitycat-com ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Ad loading libraries
Just for the record: currently, rev. 4751, debug version, when creating Rexx interpreter instances on different (Java) threads on Windows, the loader function of BSF4Rexx gets loaded for each thread. This behaviour may be fine (actually I would prefer it), however, I think that in the past a DLL was supposed to only be loaded once in a process, hence reporting it. ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Ad loading libraries
Rick McGuire wrote: I don't find any code path that would cause that to happen, so I'll need a test case that recreates the problem. O.K., but it will take some time. ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Ad loading libraries
Rick McGuire wrote: If sounds like you already have something that reproduces this. You can email this directly to me once you've opened a bug if it is too large to attach. O.K, thanks. One problem being, that I need to pack up all pieces of Java classes and test them stand-alone in order to make sure, that it runs. (Am working on it right now, but being dragged away because of meetings, one coming up in ten minutes.) The case won't be nice as the source code is spilled with fprintf()'s, but I will wirte a readme.txt which should pinpoint at the files and line-numbers. Maybe it is already sufficient that you can run and debug it. ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question on Halt() and possibility of interfering with Java's signal handling?
Having proceeded to a point in which I am confident that dispatching Rexx intepreter instances on separate Java threads is stable, I turned back to a use case from a BSF4Rexx user who tries to halt Rexx threads from Java. In the 4.0 API version the Halt() API of the interpreter instance is used The problem/phenomenon I am confronted with: after terminating the JVM I get access violations in code outside of rexx (or BSF4Rexx), e.g. a stack-trace may look like: # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x7c9204fa, pid=5604, tid=4908 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [ntdll.dll+0x104fa] # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # --- T H R E A D --- Current thread (0x02bedc00): VMThread [stack: 0x02cd,0x02d2] [id=4908] siginfo: ExceptionCode=0xc005, reading address 0xfffd Registers: EAX=0x, EBX=0x02d1efe0, ECX=0x0008, EDX=0x7c38b1d8 ESP=0x02d1eecc, EBP=0x02d1eed0, ESI=0x6dae35a4, EDI=0x002b EIP=0x7c9204fa, EFLAGS=0x00010246 Top of Stack: (sp=0x02d1eecc) 0x02d1eecc: 6daa34e4 02d1ef1c 7c3420d6 002b 0x02d1eedc: 6daa34e4 6dae35a4 0x02d1eeec: 02d1efe0 001a0018 7ffdbc00 0x02d1eefc: 000910a0 02d1eee4 02d1eaf0 0x02d1ef0c: 02d1ef48 7c34240d 7c37a368 0x02d1ef1c: 02d1ef58 7c34c0b4 6daa34e4 0x02d1ef2c: 0003 02d1efe0 0020 0x02d1ef3c: 02d1efdc 02d1ef28 02d1eaf0 02d1f054 Instructions: (pc=0x7c9204fa) 0x7c9204ea: 47 10 a9 00 00 02 69 0f 85 db a8 03 00 8b 45 10 0x7c9204fa: 8a 48 fd 83 c0 f8 f6 c1 01 56 0f 84 e2 a8 03 00 Stack: [0x02cd,0x02d2], sp=0x02d1eecc, free space=315k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [ntdll.dll+0x104fa] C [msvcr71.dll+0x20d6] C [msvcr71.dll+0xc0b4] V [jvm.dll+0x1c8ac4] VM_Operation (0x00a5fb38): Exit, mode: safepoint, requested by thread 0x002b7000 V [jvm.dll+0x1c8ac4] --- P R O C E S S --- VM_Operation (0x00a5fb38): Exit, mode: safepoint, requested by thread 0x002b7000 Java Threads: ( = current thread ) 0x02c02000 JavaThread Low Memory Detector daemon [_thread_blocked, id=5972, stack(0x02eb,0x02f0)] 0x02bff000 JavaThread CompilerThread0 daemon [_thread_blocked, id=2944, stack(0x02e6,0x02eb)] 0x02bfa400 JavaThread Attach Listener daemon [_thread_blocked, id=3100, stack(0x02e1,0x02e6)] 0x02bf9000 JavaThread Signal Dispatcher daemon [_thread_blocked, id=2088, stack(0x02dc,0x02e1)] 0x02bf0c00 JavaThread Finalizer daemon [_thread_blocked, id=4400, stack(0x02d7,0x02dc)]02f0)] 0x02bef400 JavaThread Reference Handler daemon [_thread_blocked, id=3076, stack(0x02d2,0x02d7)] 0x002b7000 JavaThread main [_thread_blocked, id=5464, stack(0x00a1,0x00a6)]1,0x02e6)] 0x02bf9000 JavaThread Signal Dispatcher daemon [_thread_blocked, id=2088, stack(0x02dc,0x02e1)] Other Threads:avaThread Finalizer daemon [_thread_blocked, id=4400, stack(0x02d7,0x02dc)] =0x02bedc00 VMThread [stack: 0x02cd,0x02d2] [id=4908]ocked, id=3076, stack(0x02d2,0x02d7)] 0x002b7000 JavaThread main [_thread_blocked, id=5464, stack(0x00a1,0x00a6)] VM state:at safepoint (shutting down) Other Threads: VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) [0x002b5e70] UNKNOWN - owner thread: 0x02bedc00 VM state:at safepoint (shutting down) Heap def new generation total 960K, used 448K [0x22af, 0x22bf, 0x22fd) eden space 896K, 42% used [0x22af, 0x22b502c0, 0x22bd) from space 64K, 100% used [0x22be, 0x22bf, 0x22bf) to space 64K, 0% used [0x22bd, 0x22bd, 0x22be) tenured generation total 4096K, used 97K [0x22fd, 0x233d, 0x26af) the space 4096K, 2% used [0x22fd, 0x22fe87d8, 0x22fe8800, 0x233d) compacting perm gen total 12288K, used 284K [0x26af, 0x276f, 0x2aaf) the space 12288K, 2% used [0x26af, 0x26b372f0, 0x26b37400, 0x276f) ro space 8192K, 67% used [0x2aaf, 0x2b052d98, 0x2b052e00, 0x2b2f) rw space 12288K, 53% used [0x2b2f, 0x2b960640, 0x2b960800, 0x2bef) Dynamic libraries: 0x0040 - 0x00424000 E:\jdk1.6.0_11\bin\java.exe 0x7c91 - 0x7c9c9000 D:\WINDOWS\system32\ntdll.dll ... cut ... As can be seen from the output above, rexx is not involved here anymore. This error occurs
Re: [Oorexx-devel] Question on Halt() and possibility of interfering with Java's signal handling?
Rick McGuire wrote: Halt() does not use any signalling mechanisms. It only iterates through the threads associated with each instance and sets a flag indicating that a halt condition needs to be raised. That flag is detected at instruction boundaries and the condition gets raised. That's all that this does. Thanks, that really helps a lot, because then I will concentrate to look over the code thoroughly to see what might cause this. ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question on Halt() and possibility of interfering with Java's signal handling?
Just wanted to report that the problem has gone away and it had nothing to do with ooRexx or Java, but with a coding error: in the code path there was a condition which caused the invocation of RexxFreeMemory() on the same pointer twice. This obviously caused the observed behaviour that I reported (much later though). Once found and fixed, everything now works in this area as it should. ---rony Rick McGuire wrote: I did spot a resource locking problem in the Halt() API that could create a race condition that might result in a memory overlay. I've fixed that, but there really is not much else involved with that API. Rick On Thu, Jun 4, 2009 at 5:34 PM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Rick McGuire wrote: Halt() does not use any signalling mechanisms. It only iterates through the threads associated with each instance and sets a flag indicating that a halt condition needs to be raised. That flag is detected at instruction boundaries and the condition gets raised. That's all that this does. Thanks, that really helps a lot, because then I will concentrate to look over the code thoroughly to see what might cause this. ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question ad unloader function
Currently, I have been trying to debug the following problem: unloader function does not run. Scenario #1: there is the BSF4Rexx.dll which contains a loader and an unloader function. If rexx.exe starts a Rexx program that then loads the BSF4Rexx.dll, the loader runs and when the Rexx program ends, the unloader runs. Scenario #2: there is the BSF4Rexx.dll which contains a loader and an unloader function. Java loads the BSF4Rexx.dll, not rexx.exe. Then Java creates a Rexx interpreter instance, which starts a Rexx program that then loads the BSF4Rexx.dll, the loader runs, *but* when the Rexx program ends, the unloader does not run! Looking at the different code paths to scenario #1, then the following can be observed: * a Rexx instnace is created using the following option (the package definition defines the loader and unloader function), the loader function executes: RexxLibraryPackage pkg; pkg.registeredName = BSF4Rexx; pkg.table= bsf_package_entry; options[0].optionName= REGISTER_LIBRARY; options[0].option= (void *) pkg; // bsf_external_functions; // options[1].optionName=NULL; No AttachThread() nor DetachTrhead() are invoked. * a Rexx script is sent from Java via JNI and the above Rexx interpreter instance is used to execute it using NewRoutine() and then CallRoutine(); here an AttachThread() and a matching DetachThread() is carried out. * Before the Java program ends, it will use JNI to Terminate() the Rexx interpreter instance that got created and employed above. No AttachThread() nor DetachTrhead() are invoked. Going over the code-path of scenario #2 to the best of my knowledge, no Rexx thread exists that would be executing, hence I would expect that the unloader function would run. Any ideas or hints what might be the cause in scenario #2 that the unloader function does not run? ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question ad unloader function
Rick McGuire wrote: The Terminate() call must be made on the same thread that called RexxCreateInterpreter originallythat's the only issue I can think of that might prevent things from shutting down. Just double-checked, Terminate() is issued on the same thread as RexxCreateInterpreter(). ---rony On Sun, Jun 7, 2009 at 10:06 AM, Rony G. Flatscher rony.flatsc...@wu-wien.ac.at wrote: Currently, I have been trying to debug the following problem: unloader function does not run. Scenario #1: there is the BSF4Rexx.dll which contains a loader and an unloader function. If rexx.exe starts a Rexx program that then loads the BSF4Rexx.dll, the loader runs and when the Rexx program ends, the unloader runs. Scenario #2: there is the BSF4Rexx.dll which contains a loader and an unloader function. Java loads the BSF4Rexx.dll, not rexx.exe. Then Java creates a Rexx interpreter instance, which starts a Rexx program that then loads the BSF4Rexx.dll, the loader runs, *but* when the Rexx program ends, the unloader does not run! Looking at the different code paths to scenario #1, then the following can be observed: a Rexx instnace is created using the following option (the package definition defines the loader and unloader function), the loader function executes: RexxLibraryPackage pkg; pkg.registeredName = BSF4Rexx; pkg.table= bsf_package_entry; options[0].optionName= REGISTER_LIBRARY; options[0].option= (void *) pkg; // bsf_external_functions; // options[1].optionName=NULL; No AttachThread() nor DetachTrhead() are invoked. a Rexx script is sent from Java via JNI and the above Rexx interpreter instance is used to execute it using NewRoutine() and then CallRoutine(); here an AttachThread() and a matching DetachThread() is carried out. Before the Java program ends, it will use JNI to Terminate() the Rexx interpreter instance that got created and employed above. No AttachThread() nor DetachTrhead() are invoked. Going over the code-path of scenario #2 to the best of my knowledge, no Rexx thread exists that would be executing, hence I would expect that the unloader function would run. Any ideas or hints what might be the cause in scenario #2 that the unloader function does not run? ---rony -- OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Uninits not running
Currently, the BSF4Rexx.dll works as intended, if Rexx scripts are started via rexx.exe, and the dll is loaded via rexx.exe. The loader function runs when BSF4Rexx gets loaded, the uninits and the unloader function run, upon termination of the Rexx script. In use case # 2, Java loads BSF4Rexx.dll, creates an interpreter instance (which causes the loader function for BSF4Rexx to run) and executes Rexx scripts via that instance. When the interpreter instance terminates, no uninits nor the unloader function runs. So far, I have not been able to figure out why use case # 2 would exhibit this deviating behaviour. Just wanted to add the info that the uninits are not run either upon termination of that Rexx instance. Again, any ideas of what might cause this or what I may do to corner that problem are highly appreciated! ---rony -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Uninits not running
Rick McGuire wrote: All of the symptoms you describe would suggest you are not terminating your interpreter instances correctly...but that's what I suggested earlier... Yes. Because of that I made sure (and will make sure with the planned nutshell example) that Terminate() is invoked in the same thread that created the Rexx interpreter instance, but this did not change the observed behaviour. An example which requires BSF.CLS (which requires BSF4Rexx.dll): say hello world. ::requires BSF.CLS where BSF.CLS has a directive ::requires BSF4Rexx library If rexx.exe runs this script, then the loader and the unloader runs, and the uninits of those supporting Rexx objects that get created in BSF.CLS (using the external functions of BSF4Rexx.dll). If this script is run via Java/JNI, then the loader runs, but no uninits nor the unloader function. It is made sure that the Terminate() is issued in the same thread that created the Rexx interpreter instance to terminate. To the best of my knowledge no other Rexx threads run for that Rexx interpreter instance, which is the only instance that gets created by the application. ---rony -- Crystal Reports - New Free Runtime and 30 Day Trial Check out the new simplified licensing option that enables unlimited royalty-free distribution of the report engine for externally facing server and web deployment. http://p.sf.net/sfu/businessobjects___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] ODBC/MySQL Bounty Question
David: David Ruggles wrote: This is an open question to the list and anyone else that might be interested. Is anyone available who would be interested in writing an ODBC or MySQL interface for ooRexx 4.0? Safe Data, Inc. is heavily dependant on ooRexx and MySQL, however as a company and individually we don't have the C expertise nor the time to implement this ourselves. On the other hand we should be able to front some bounty to see that it gets accomplished. What I would like to do is lay out our goals and see what kind of bounty might be needed and find anyone else in the community who would be willing to offer bounty as well. I'm going to list two sets of requirements, ideal and minimum. Anyone willing to add bounty please indicate which set of requirements (and/or add your own) and how much, anyone willing and able to do the work please indicate how much bounty would be needed for each set of requirements. Ideal Requirements: * Cross Platform * ODBC unixODBC (any ODBC/unixODBC driver) * Stored Functions * Stored Procedures * All Normal SQL Statements (COMMIT, ROLLBACK, SELECT, DELETE, etc.) Minimum Requirements: * Windows (strongly desire Linux also) * MySQL * ALL Normal SQL Statements You have all of this already available to you. Use Java instead of C, C++ and you are in business using BSF4Rexx. To evaluate with ooRexx 4.0 you could use the official version of BSF4Rexx at http://wi.wu-wien.ac.at/rgf/rexx/bsf4rexx/current/. [There is an experimental version (at beta level, but not yet announced) at http://wi.wu-wien.ac.at/rgf/tmp/20090614_b4r4beta/, which is rewritten for ooRexx 4.0. This version runs the BSF4Rexx testUnits of lately that a student wrote for the older, current version without a failure, so I am pretty confident that it is fully compatible and stable.] Give it a try and start to enjoy what cross-platform Java functionality is directly available to your Rexx programs! In the Java world interfacing with RDBMS is realized with JDBC. If you research a little bit, you will be surprised an overwhelmed what is available to you. HTH, ---rony -- __ Prof. Dr. Rony G. Flatscher Department Informationsverarbeitung und Prozessmanagement Institut für Betriebswirtschaftslehre und Wirtschaftsinformatik Wirtschaftsuniversität Wien Augasse 2-6 A-1090 Wien/Vienna, Austria/Europe http://www.wu-wien.ac.at (English: http://www.wu-wien.ac.at/english) __ -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Discussion: Remote ooRexx Classes
Remote invocation has always to deal with how to marshall and unmarshall argument and return values in order to transport the values insulated from operating system and hardware architecture dependencies. In their origins a lot of those infrastructures (including programming language representations of values) were influencing the kind of un/marshalling of values, including means that were proprietary, locking out others. Hence using a string-based encoding, that may be even self-documentary would assert that un/marshalling remained open. Using XML as such a format may make sense for that purpose and could probably also be used for serializing/deserializing ooRexx objects in general (ultimately, if enough information gets serialized, even full fledged classes with their methods could be serialized and deserialized in the end). ---rony P.S.: One nice application of XML encoded (serialized?) information in the context of ooRexx would be a rexxc kind of program that would encode the parse results of any ooRexx program in XML (tagging statements, variables, operations, directives etc.), opening up processing and analysis of ooRexx programs to any ooRexx programmer (who could create xrefs, transformations, analysis of code et.al) who is able to (conceptually) work with XML and/or XSLT. [Actually, even observer/visitor pattern kind of infrastructure in the parser would be cool and quite helpful for the purpose of analyzing and/or transforming ooRexx programs.] Rick McGuire wrote: Yes, but in those cases, XML is just the protocol used for serializing/deserializing the data. In most web services stacks, for example, the programmer just deals with real objects in the languages they're programming in and the fact that XML is used for the remote transport protocol is completely hidden from view. Done correctly, the transport protcols could be XML/Soap, REST, CORBA, RMIIIOP, and the programmer would need to know the difference. In none of those cases is the data being sent back and forth considered to be just strings. Rick On Wed, Jul 22, 2009 at 3:13 AM, Mike Cowlishawm...@uk.ibm.com wrote: Up until the point where you wish to pass an array as an argument or have a return value that is some sort of non-string type. Not everything maps well to just string data. Hmmm, try telling that to an XML fanatic :-)) Just about anything can be moved around using XML -- which is just strings... Mike -- ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Question 1 ad CString(): not leaving \n untouched?
If a some const *char string contains the LF character (\n, 0x0a, 0d10) and one uses CString(str) to create a Rexx string, then say'ing that Rexx string would not cause a line break at the \n-character, rather a question mark (?) is displayed instead. [At the same time a TAB char (\t, 0x09, 0d09) remains unchanged and will have the desired effect on a SAY statement, i.e. indenting the following characters.] Before filing a bug, I just wanted to make sure that this is not behaving as designed. ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question 2 ad CString(): not leaving UTF chars untouched ?
Hi Mark, first of all: thank you *very* much for your efforts and describing your findings! Just was able to come back to my problem and in the light of your findings explicitly testing the conversion from const char string to a RexxString and vice-versa, and indeed it seems that the round trip works, so indeed all chars remain untouched! ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question 1 ad CString(): not leaving \n untouched?
Hi Mark, This is surely due to whatever you are using to display your string. Using the same Rexx code as in my other post, here is what I get: ... cut ... Which is exactly correct. This is the C++ code: ... cut ... Again, thank you very much for looking into it. Went back into the native code and executing SAY-statements via it, and the newline worked! --- In order to figure out what I have been seeing ('?' for newline chars), I was able to trace this down to where the interpreter reports an error and the supplied error string contains a newline char. E.g. errorString=This is an error || 0ax || and this the second line of that error. raise syntax 98.900 array (errorString) Running the above Rexx program then yields: E:\testmakeError.rex 3 *-* raise syntax 98.900 array (errorString) Error 98 running E:\test\makeError.rex line 3: Execution error Error 98.900: This is an error?and this the second line of that error. As you can see the line reading Error 98.900 displays '?' instead of breaking the line at that position. The BSF4Rexx support will create rather well documented error messages, where lines need to be split up in order to be easily readable. (Therefore newline characters are part of the error message.) As far as I recall this was not the case with 3.2 or earlier versions of ooRexx, such that I will file a bug for it. Regards, ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Question 1 ad CString(): not leaving \n untouched?
As you can see the line reading Error 98.900 displays '?' instead of breaking the line at that position. The BSF4Rexx support will create rather well documented error messages, where lines need to be split up in order to be easily readable. (Therefore newline characters are part of the error message.) As far as I recall this was not the case with 3.2 or earlier versions of ooRexx, such that I will file a bug for it. You should try it on 3.2 or earlier. My recollection is that it has always been this way. Because I have tried in the past to put new lines in error messages. If it has always been this way, then you would need to open an enhancement instead of a bug. (My memory is not always the best however.) Hmm, already filed a bug. Will try it on 3.2 to be sure and may reclassify it to a RFE instead. ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Native API, call context, method context, ...
Mark Miesfeld wrote: Probably only Rick that can help on this, maybe someone else has some ideas. In ooDialog there are some documented external functions that need to stay, because well they were documented. grin So, I started out to convert them to typed routines as part of my effort to use .Pointer for things like window handles, etc. But, I have a whole lot of infrastructure code that is expecting RexxMethodContext *, instead of RexxCallContext *. AFAIK, both context have a field threadContext which you can therefore retrieve and use (directly or as an argument), such that your routines can be commonly used. HTH, ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Request for ideas ...
Hi there, for quite a few weeks I have been trying to trace down one particular nasty problem with the new BSF4Rexx 4.0, which occurred only under Linux so far (32- and 64-bit), but was able today to get it under Windows as well. It seems that this problem occurs under the following scenario: * there are RexxProxy Java objects that get finalized, o in the Java finalization method BSF4Rexx is informed about the Rexx object in form of a unique string value that can now be freed from BSF4Rexx as well o BSF4Rexx keeps a counter on proxied Rexx objects and maintains it; only if it drops to 0 will the proxied Rexx object be removed from a pinned down directory object, hence freeing a reference to it (and if it is the last reference it would be made elidgible for potential uninit processing) + it seems that at times, right in the middle of processing this logic within BSF4Rexx, rexx.dll and sometimes even kernel.dll causes an exception; if this happens it happens on the Java finalizer daemon thread; in theory it may be possible that the Java finalizer thread is still running, although Rexx may be terminated right in the middle of BSF4Rexx processing a request, expecting Rexx to be available + the code in which this happens (the very first statement that accesses a globally referred to/pinned ooRexx directory object that is used to keep a reference counter): obj=rtc-SendMessage1(OREXX_REGISTRY_REFCOUNTER, AT, obj_id); rtc got successfully used immediately before this, checking with another globally referred to ooRexx directory [rtc-SendMessage1(OREXX_REGISTRY, HASENTRY, obj_id)==rtc-True()]. Access to the BSF4Rexx Rexx registry directories are serialized using a mutex lock. . Here's the Java error log, giving some clues and pointing to the finalizer thread (the debug output of BSF4Rexx contains too much detail, but helped me to corner the problem, it also gives the TID which matches the Java's error log thread id for the finalizer daemon), running the release version of ooRexx 4.0.0: # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x00309c76, pid=5800, tid=4696 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rexx.dll+0x39c76] # --- T H R E A D --- Current thread (0x00f79db8): JavaThread Finalizer daemon [_thread_in_native, id=4696] siginfo: ExceptionCode=0xc005, reading address 0xce964b10 Registers: EAX=0x0001, EBX=0x7d807228, ECX=0xd4457633, EDX=0x46c1d211 ESP=0x0113f2e4, EBP=0x0113f444, ESI=0x46c1d211, EDI=0x7f5bfae8 EIP=0x00309c76, EFLAGS=0x00010246 Top of Stack: (sp=0x0113f2e4) 0x0113f2e4: 7f5bfae8 7f244e88 0113f444 0113f3f0 0x0113f2f4: 002e3605 0009 05d65586 7f244e88 0x0113f304: 7f5bfae8 0113f444 7f5bfae8 0113f400 0x0113f314: 7c839ad8 7c809680 0031c368 0x0113f324: 0113f3a4 0035d5a0 002e3791 0x0113f334: 7f5bfae8 0001 002e3740 0030f3d7 0x0113f344: 7f5bfae8 003698ac 7f244e88 7f6c89d8 0x0113f354: 0014 0001 Instructions: (pc=0x00309c76) 0x00309c66: 8b 42 38 8b cf ff d0 33 d2 f7 f6 8b f2 8d 0c 76 0x00309c76: 83 7c 8b 1c 00 74 2a 8d 49 00 8d 14 76 8b 4c 93 Stack: [0x010c,0x0114), sp=0x0113f2e4, free space=508k Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) C [rexx.dll+0x39c76] C [BSF4Rexx.dll+0x6742] C [BSF4Rexx.dll+0x86ad] C [BSF4Rexx.dll+0x84d0] C [BSF4Rexx.dll+0x4744] j org.rexxla.bsf.engines.rexx.RexxAndJava.jniUnregisterRexxObject(Ljava/lang/String;)I+0 j org.rexxla.bsf.engines.rexx.RexxProxy.finalize()V+47 v ~StubRoutines::call_stub V [jvm.dll+0x8757c] V [jvm.dll+0xde804] V [jvm.dll+0x8744d] V [jvm.dll+0x8c82a] C [java.dll+0x2006] j java.lang.ref.Finalizer.runFinalizer()V+45 j java.lang.ref.Finalizer.access$100(Ljava/lang/ref/Finalizer;)V+1 j java.lang.ref.Finalizer$FinalizerThread.run()V+11 v ~StubRoutines::call_stub V [jvm.dll+0x8757c] V [jvm.dll+0xde804] V [jvm.dll+0x8744d] V [jvm.dll+0x871aa] V [jvm.dll+0xa1de8] V [jvm.dll+0x10fad4] V [jvm.dll+0x10faa2] C [msvcrt.dll+0x2a3b0] C [kernel32.dll+0xb729] Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) j
Re: [Oorexx-devel] Request for ideas ...
Hi René, stack full? this is what the exception code hints at. Remember there is also a native code stack involved here. Thanks for the idea, I increased the stack size by 50% (from 40960 to 65636) to no avail. Here are the last lines of the debug output, indicating that we arrived at the end of the ooRexxUnit run (the brief statistics are shown), such that we are at the point where Rexx will be ended. However, the BSF4Rexx library at the time when the exception occurs has not been unloaded yet. Here the last lines of output (full text file attached, Rexx output in bold): ... cut ... *** -- arrived: .._jniRexxUnregisterRexxObject(...), thisTid=[1248] --- RgfRemoveProxyObject(), begin: c_obj_id=[267229929] (identityHash) -- ooRexx-AttachThread() - RgfRemoveProxyObject... done. rc=[1]-- --- RgfRemoveProxyObject2, begin: rtc=[7F6E0D0C], obj_id=[7DD84068] RgfRemoveProxyObject2, acquired REGISTRY_lock, before rtc-SendMessage1(...) ... RgfRemoveProxyObject2, before getting count: OREXX_REGISTRY_REFCOUNTER=[7F244F88], rtc-SendMessage1(OREXX_REGISTRY_REFCOUNTER, AT, obj_id)=[7D8CD988] RgfRemoveProxyObject2, retrieved 'refs'=[0] RgfRemoveProxyObject2, before removing from OREXX_REGISTRY=[7F244D08]... RgfRemoveProxyObject2, before removing from OREXX_REGISTRY_REFCOUNTER=[7F244F88]... --- RgfRemoveProxyObject2, end: refs=[0] -- ooRexx-DetachThread() - RgfRemoveProxyObject... done. -- --- RgfRemoveProxyObject(), end: c_obj_id=[267229929], remaining references=[0] *** -- returning from: .._jniRexxUnregisterRexxObject(...), thisTid=[1248] *Executing tests from ...\interfaceClasses\rexx_testInterfaceCallback1.testGroup ooTest Framework - Automated Test of the ooRexx Interpreter Interpreter: REXX-ooRexx_4.0.0(MT) 6.03 15 Aug 2009 Addressing Mode: 32 ooRexxUnit: 2.0.0_3.2.0ooTest: 1.0.0_4.0.0 Tests ran: 836 Assertions: 1147 Failures:0 Errors: 0 Skipped files: 0 File search:00:00:03.14 Suite construction: 00:00:00.047000 Test execution: 00:00:08.406000 Total time: 00:00:11.984000* *** -- arrived: .._jniRexxUnregisterRexxObject(...), thisTid=[1248] --- RgfRemoveProxyObject(), begin: c_obj_id=[263464514] (identityHash) -- ooRexx-AttachThread() - RgfRemoveProxyObject... done. rc=[1]-- --- RgfRemoveProxyObject2, begin: rtc=[7F6C8AFC], obj_id=[7F673C70] RgfRemoveProxyObject2, acquired REGISTRY_lock, before rtc-SendMessage1(...) ... RgfRemoveProxyObject2, before getting count: OREXX_REGISTRY_REFCOUNTER=[7F244F88], rtc-SendMessage1(OREXX_REGISTRY_REFCOUNTER, AT, obj_id)=[7DA13608] RgfRemoveProxyObject2, retrieved 'refs'=[0] RgfRemoveProxyObject2, before removing from OREXX_REGISTRY=[7F244D08]... RgfRemoveProxyObject2, before removing from OREXX_REGISTRY_REFCOUNTER=[7F244F88]... # # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x00303e4c, pid=924, tid=1248 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rexx.dll+0x33e4c] # # An error report file with more information is saved as hs_err_pid924.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The matching hs_error-logfile from Java (full text file attached): # # An unexpected error has been detected by HotSpot Virtual Machine: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x00303e4c, pid=924, tid=1248 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_10-b03 mixed mode) # Problematic frame: # C [rexx.dll+0x33e4c] # --- T H R E A D --- Current thread (0x00f79db8): JavaThread Finalizer daemon [_thread_in_native, id=1248] siginfo: ExceptionCode=0xc005, reading address 0x0015 Registers: EAX=0x0001, EBX=0x07335601, ECX=0x7f670eb0, EDX=0x0113f1e0 ESP=0x0113f1b0, EBP=0x0113f23c, ESI=0x7f245158, EDI=0x7f670eb0 EIP=0x00303e4c, EFLAGS=0x00010202 Top of Stack: (sp=0x0113f1b0) 0x0113f1b0: 7f670eb0 002f05ec 7f670eb0 00ca8ead 0x0113f1c0: 7f6c8ae8 002f2d17 7f670eb0 0113f1e0 0x0113f1d0: 0002 0113f1e8 41dadae8 7f6c8ae8 0x0113f1e0: 7f673c70 7f670fc8 0x0113f1f0: 7f6c8ae8 0113f230 0035ec78 0x0113f200: 00315d45 7f670eb0 7f673c70 7f670fc8 0x0113f210: 41dad908 00f79db8 7fcb0350 07335630 0x0113f220: 7f6c8ae8 7f431010 41dad901 0113f210 Instructions: (pc=0x00303e4c) 0x00303e3c: 08 00 cc cc 8b 41 18 85
[Oorexx-devel] Trying to create a new build from trunk ... (Re: Request for ideas ...
Mark, I would suggest that if you have found a scenario where you are pretty sure you always get the crash, you try that scenario using an interpreter built from trunk. thank you very much for this idea! Tried to create it, but got an error while building oodialog (using rev. 5135 from trunk): F:\work\svn\oorexx\main\trunkmakeorx BOTH PACKAGE rxapi.exe (process ID: 3576) killed successfully Building Rexxapi.. Building Interpreter Building OREXXOLE.. Building Rexxutil.. Building rxftp Building rexximage command launcher Building rexx command launcher Building rexxhide command launcher Building rexxpaws command launcher Building rexxc command launcher Building REXX.IMG ... Building RXSUBCOM and RXQUEUE.. Building rxwinsys.dll Building RxSock.. Building RxMath.. Building RXREGEXP... Building OODIALOG.. ***! Error occured !** : build halted ... cut (from Win32Rel.log) ... F:\work\svn\oorexx\main\trunk\extensions\platform\windows\oodialog\oodControl.cpp(50) : fatal error C1083: Cannot open include file: 'oodText.hpp': No such file or directory NMAKE : fatal error U1077: 'cl' : return code '0x2' Stop. Probably that missing include file needs to be added to svn. Regards, ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Trying to create a new build from trunk ... (Re: Request for ideas ...
Mark Miesfeld wrote: Pull in my last commit and see if it works. Thanks, that solved the problem, could compile a new version. Running it will exhibit the same behaviour (while cleaning up the Rexx proxy cache within BSF4Rexx; Rexx program output from ooRexxUnit in bold): ... cut ... *** -- returning from: .._jniRexxUnregisterRexxObject(...), thisTid=[4776] *** -- arrived: .._jniRexxUnregisterRexxObject(...), thisTid=[4776] --- RgfRemoveProxyObject(), begin: c_obj_id=[263139679] (identityHash) -- ooRexx-AttachThread() - RgfRemoveProxyObject... done. rc=[1]-- --- RgfRemoveProxyObject2, begin: rtc=[7DD0BF3C], obj_id=[7D788028] *File search:00:00:00.39* RgfRemoveProxyObject2, acquired REGISTRY_lock, before rtc-SendMessage1(...) ... RgfRemoveProxyObject2, before getting count: OREXX_REGISTRY_REFCOUNTER=[7F244DE0], rtc-SendMessage1(OREXX_REGISTRY _REFCOUNTER, AT, obj_id)=[7D77E428] RgfRemoveProxyObject2, retrieved 'refs'=[0] RgfRemoveProxyObject2, before removing from OREXX_REGISTRY=[7F244B60]... *Suite construction: 00:00:00.093000* RgfRemoveProxyObject2, before removing from OREXX_REGISTRY_REFCOUNTER=[7F244DE0] ... --- RgfRemoveProxyObject2, end: refs=[0] -- ooRexx-DetachThread() - RgfRemoveProxyObject... done. -- --- RgfRemoveProxyObject(), end: c_obj_id=[263139679], remaining references=[0] *** -- returning from: .._jniRexxUnregisterRexxObject(...), thisTid=[4776] *Test execution: 00:00:08.00* *** -- arrived: .._jniRexxUnregisterRexxObject(...), thisTid=[4776] --- RgfRemoveProxyObject(), begin: c_obj_id=[263139979] (identityHash) -- ooRexx-AttachThread() - RgfRemoveProxyObject... done. rc=[1]-- --- RgfRemoveProxyObject2, begin: rtc=[7DD0BF3C], obj_id=[7D78D1A0] *Total time: 00:00:08.593000* RgfRemoveProxyObject2, acquired REGISTRY_lock, before rtc-SendMessage1(...) ... RgfRemoveProxyObject2, before getting count: OREXX_REGISTRY_REFCOUNTER=[7F244DE0] , rtc-SendMessage1(OREXX_REGISTRY_REFCOUNTER, AT, obj_id)=[7D78B790] RgfRemoveProxyObject2, retrieved 'refs'=[0] RgfRemoveProxyObject2, before removing from OREXX_REGISTRY=[7F244B60]... # # An unexpected error has been detected by Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc005) at pc=0x004489ee, pid=1728, tid=4776 # # Java VM: Java HotSpot(TM) Client VM (11.0-b16 mixed mode, sharing windows-x86) # Problematic frame: # C [rexx.dll+0x189ee] # # An error report file with more information is saved as: # F:\work\svn\oorexx\test\releases\4.0.0\hs_err_pid1728.log # # If you would like to submit a bug report, please visit: # http://java.sun.com/webapps/bugreport/crash.jsp # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug. # :-(( Notabene: the error is intermittent, though if it occurs it occurs right in the above sequence (after the Rexx code has finished, while still Java objects get finalized, causing a callback to Rexx via BSF4Rexx). ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Possible (future) solution ? (Re: Trying to create a new build from trunk ... (Re: Request for ideas ...
Hi there, if the cause of the problem is really the overlapping of a callback from Java into BSF4Rexx employing ooRexx, and ooRexx having started to shutdown and removing/reclaiming objects, then one possible solution may be: * allow to be notified, when ooRexx is about to shutdown, such that one can set a flag in the DLL which will allow to control when employing ooRexx interfaces becomes unstable. The RFE http://sourceforge.net/tracker/?func=detailaid=2798050group_id=119701atid=684733 would probably allow for implementing such a logic. ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Questions, RFI on multithreading
Hi there, trying to get BSF4Rexx 4.0 into beta-test shape (32-bit and 64-bit Windows and Linux versions). Using developed test units I have been able to assert that it runs stable, with the exception of employing multithreading heavily. 32-bit means: operating system is 32-bit, hence ooRexx and BSF4Rexx. Windows is XP SP3, Linux is Ubuntu. 64-bit means: operating system is 64-bit, ooRexx is 64-bit and BSF4Rexx is 64-bit Windows is Vista Business, Linux is Ubuntu. Multithreading in this context means: * using multiple Rexx threads, each interfacing with Java using BSF4Rexx (e.g. 100 Rexx threads per test, in each thread two invocations of BSF4Rexx), * using multiple Java threads, which each uses the same Rexx interpreter instance to run off Rexx scripts that themselves dispatch multiple Rexx threads, all (Java and Rexx code) interfacing with each other using BSF4Rexx (e.g. 23 Java threads, each running a Rexx script that creates 29 Rexx threads; summing up all threads gives 712 threads, a heavy version may use a total of 2,601 threads), * there are individual Java objects that Rexx interacts with via BSF4Rexx, * there are individual Rexx objects that Java interacts with via BSF4Rexx; access to these Rexx objects may be concurrently from Rexx threads and Java threads, where the latter get routed via BSF4Rexx. Here are three issues where I would to ask for advice, ideas: * Scenario 1: 32-bit Windows (not tested on 64-bit Windows), exception in rexx.exe: o Here I may get the following exception o rexx.dll!00337328() [Frames below may be incorrect and/or missing, no symbols loaded for rexx.dll] rexx.dll!002ff218() rexx.dll!002e9490() rexx.dll!00303462() rexx.dll!003473c9() kernel32.dll!7c80b729() Unhandled exception at 0x00337328 in rexx.exe: 0xC005: Access violation reading location 0x000c. or: rexx.dll!002e86f8() [Frames below may be incorrect and/or missing, no symbols loaded for rexx.dll] rexx.dll!002e880b() rexx.dll!002e9438() rexx.dll!0030d2ae() rexx.dll!00318639() BSF4Rexx.dll!00c44269() Unhandled exception at 0x002e86f8 in rexx.exe: 0xC005: Access violation reading location 0x028fd522. * Scneario 2: 64-bit Linux, *buffer overflow*: ran the same tests as above and in the multithreaded test unit I get a non-redirectable output in the shell reading: o r...@ronylinux:/mnt/root_e/rony/dev/bsf/src/source_cc_40/testUnits$ rexx testOORexx -R bsf4rexx -s 21 | gvim - Vim: Reading from stdin... buffer overflow detected ***: rexx terminated* === Backtrace: = /lib/libc.so.6(__fortify_fail+0x37)[0x7fb7374ee2c7] /lib/libc.so.6[0x7fb7374ec170] /lib/libc.so.6[0x7fb7374eb519] /lib/libc.so.6(_IO_default_xsputn+0x96)[0x7fb737465426] /lib/libc.so.6(_IO_vfprintf+0x348d)[0x7fb737437e2d] /lib/libc.so.6(__vsprintf_chk+0x99)[0x7fb7374eb5b9] /lib/libc.so.6(__sprintf_chk+0x80)[0x7fb7374eb500] /mnt/root_e/rony/dev/bsf/src/bsf4rexx/libBSF4Rexx.so(BSF_impl+0x348)[0x7fb734d90fb8] /mnt/root_e/rony/dev/bsf/src/bsf4rexx/libBSF4Rexx.so(BSF+0x21)[0x7fb734d914e1] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN20RexxNativeActivation17callNativeRoutineEP12RoutineClassP17RexxNativeRoutineP10RexxStringPP10RexxObjectmR15ProtectedObject+0xc2)[0x7fb738634e12] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN12RoutineClass4callEP12RexxActivityP10RexxStringPP10RexxObjectmR15ProtectedObject+0x55)[0x7fb738607495] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN14PackageManager17callNativeRoutineEP12RexxActivityP10RexxStringPP10RexxObjectmR15ProtectedObject+0x62)[0x7fb73864bca2] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN17SystemInterpreter22invokeExternalFunctionEP14RexxActivationP12RexxActivityP10RexxStringPP10RexxObjectmS5_R15ProtectedObject+0x9e)[0x7fb73867e4fe] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN14RexxActivation12externalCallEP10RexxStringmP19RexxExpressionStackS1_R15ProtectedObject+0x13a)[0x7fb738629aba] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN22RexxExpressionFunction8evaluateEP14RexxActivationP19RexxExpressionStack+0x243)[0x7fb73865a003] /opt/ooRexx/lib/ooRexx/librexx.so.4(_ZN21RexxExpressionMessage8evaluateEP14RexxActivationP19RexxExpressionStack+0x59)[0x7fb73865ac29] ... cut ... === Memory map: 0040-00401000 r-xp 08:01 24936487
Re: [Oorexx-devel] Questions, RFI on multithreading
Mark, thanks. You should be able to chase the buffer overflow down fairly easily. *** buffer overflow detected ***: rexx terminated === Backtrace: = /lib/libc.so.6(__fortify_fail+0x37)[0x7fb7374ee2c7] /lib/libc.so.6[0x7fb7374ec170] /lib/libc.so.6[0x7fb7374eb519] /lib/libc.so.6(_IO_default_xsputn+0x96)[0x7fb737465426] /lib/libc.so.6(_IO_vfprintf+0x348d)[0x7fb737437e2d] /lib/libc.so.6(__vsprintf_chk+0x99)[0x7fb7374eb5b9] /lib/libc.so.6(__sprintf_chk+0x80)[0x7fb7374eb500] /mnt/root_e/rony/dev/bsf/src/bsf4rexx/libBSF4Rexx.so(BSF_impl+0x348)[0x7fb734d90fb8] So it looks like in your BSF() function you are using sprintf() to format something into a buffer that is too small. Double your buffer size and see if it goes away. Or, better, look carefully and what you are formatting and figure out what is bigger than you are anticipating. Yes, after having posted it and coming back from lunch I started to go after that (it may be caused by debug output only). For this one: Scenario 1: 32-bit Windows (not tested on 64-bit Windows), exception in rexx.exe: Here I may get the following exception rexx.dll!00337328() [Frames below may be incorrect and/or missing, no symbols loaded for rexx.dll] rexx.dll!002ff218() rexx.dll!002e9490() rexx.dll!00303462() rexx.dll!003473c9() kernel32.dll!7c80b729() You're not going to get anywhere with this, you need to use a debug version of the interpreter and BSF so you can see what functions these are. If, you have a scenario that produces the exception 100% of the time with a non-debug build, and then never produces the exception with a debug version - well that's going to be hard. It also is very rare. But, if it is the case, you'll need to at least track the addresses down in the map file and use the *.asm files to see exactly where this sequence is. That means you'll need to build the intepreter yourself using the release code. The map files will be in Win32Rel and the *.asm files are in Win32Rel\ASM. Thanks for this advice! If I were tackling this, I'd fix those 2 bugs first, in the order I listed, before even thinking about the third one. Again, thanks! ---rony -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
[Oorexx-devel] Exception in rexx.exe, please advise ... (Re: Questions, RFI on multithreading
Hi there, For this one: Scenario 1: 32-bit Windows (not tested on 64-bit Windows), exception in rexx.exe: Here I may get the following exception rexx.dll!00337328() [Frames below may be incorrect and/or missing, no symbols loaded for rexx.dll] rexx.dll!002ff218() rexx.dll!002e9490() rexx.dll!00303462() rexx.dll!003473c9() kernel32.dll!7c80b729() You're not going to get anywhere with this, you need to use a debug version of the interpreter and BSF so you can see what functions these are. If, you have a scenario that produces the exception 100% of the time with a non-debug build, and then never produces the exception with a debug version - well that's going to be hard. It also is very rare. But, if it is the case, you'll need to at least track the addresses down in the map file and use the *.asm files to see exactly where this sequence is. O.K. done that, created and installed ooRexx400_5165-x86_32-debug.exe. Running the tests eventually (the 7th time running the BSF4Rexx suite) will cause the following stack trace: * rexx.dll!SourceLocation::getLineNumber() Line 51 + 0xa bytes C++ rexx.dll!RexxInstruction::getLineNumber() Line 79 + 0x12 bytes C++ rexx.dll!RexxActivation::getContextLineNumber() Line 2511 C++ rexx.dll!RexxActivation::createStackFrame() Line 4272 + 0x22 bytes C++ rexx.dll!RexxActivationFrame::createStackFrame() Line 58 C++ rexx.dll!RexxActivity::createExceptionObject(long errcode=40900, RexxString * description=0x, RexxArray * additional=0x7d3eeb50, RexxObject * result=0x) Line 906 + 0xd bytes C++ rexx.dll!RexxActivity::raiseException(long errcode=40900, RexxString * description=0x, RexxArray * additional=0x7d3eeb50, RexxObject * result=0x) Line 753 + 0x18 bytesC++ rexx.dll!RexxActivity::reportAnException(long errcode=40900, RexxObject * substitution1=0x7dc112c8) Line 505 C++ rexx.dll!reportException(long error=40900, RexxObject * a1=0x7dc112c8) Line 159C++ rexx.dll!RaiseException1(RexxThreadContext_ * c=0x7f3e5ca4, unsigned int n=40900, _RexxObjectPtr * o1=0x7dc112c8) Line 1715C++ BSF4Rexx.dll!RexxThreadContext_::RaiseException1(unsigned int n=40900, _RexxObjectPtr * o=0x7dc112c8) Line 1284C++ BSF4Rexx.dll!RexxCallContext_::RaiseException1(unsigned int n=40900, _RexxObjectPtr * o=0x7dc112c8) Line 2629 C++ BSF4Rexx.dll!BSF_impl(RexxCallContext_ * context=0x07f6f870, _RexxArrayObject * argArray=0x7f0e17d8) Line 5199 C++ BSF4Rexx.dll!BSF(RexxCallContext_ * context=0x07f6f870, ValueDescriptor * arguments=0x07f6f88c) Line 5146 + 0x17 bytes C++ rexx.dll!RexxNativeActivation::callNativeRoutine(RoutineClass * _routine=0x7f224268, RexxNativeRoutine * _code=0x7f224248, RexxString * functionName=0x7f196a28, RexxObject * * list=0x7e2a38cc, unsigned int count=2, ProtectedObject resultObj={...}) Line 1319C++ rexx.dll!RexxNativeRoutine::call(RexxActivity * activity=0x7f3e5c90, RoutineClass * routine=0x7f224268, RexxString * functionName=0x7f196a28, RexxObject * * argPtr=0x7e2a38cc, unsigned int count=2, ProtectedObject result={...}) Line 316 C++ rexx.dll!RoutineClass::call(RexxActivity * activity=0x7f3e5c90, RexxString * msgname=0x7f196a28, RexxObject * * argPtr=0x7e2a38cc, unsigned int argcount=2, ProtectedObject result={...}) Line 234 C++ rexx.dll!PackageManager::callNativeRoutine(RexxActivity * activity=0x7f3e5c90, RexxString * name=0x7f196a28, RexxObject * * arguments=0x7e2a38cc, unsigned int argcount=2, ProtectedObject result={...}) Line 658C++ rexx.dll!SystemInterpreter::invokeExternalFunction(RexxActivation * activation=0x7d539800, RexxActivity * activity=0x7f3e5c90, RexxString * target=0x7f196a28, RexxObject * * arguments=0x7e2a38cc, unsigned int argcount=2, RexxString * calltype=0x7fd5cb00, ProtectedObject result={...}) Line 272 + 0x17 bytes C++ rexx.dll!RexxActivation::externalCall(RexxString * target=0x7f196a28, unsigned int _argcount=2, RexxExpressionStack * _stack=0x7d5398c0, RexxString * calltype=0x7fd5cb00, ProtectedObject resultObj={...}) Line 2626 + 0x25 bytes C++ rexx.dll!RexxExpressionFunction::evaluate(RexxActivation * context=0x7d539800, RexxExpressionStack * stack=0x7d5398c0) Line 225C++ rexx.dll!RexxExpressionMessage::evaluate(RexxActivation * context=0x7d539800, RexxExpressionStack * stack=0x7d5398c0) Line 97 + 0x1b bytes C++ rexx.dll!RexxInstructionReturn::execute(RexxActivation * context=0x7d539800, RexxExpressionStack * stack=0x7d5398c0) Line 70 + 0x1b bytes C++ rexx.dll!RexxActivation::run(RexxObject * _receiver=0x7dd904a8, RexxString * msgname=0x7fcc4c20, RexxObject * * _arglist=0x, unsigned int
[Oorexx-devel] Now with the debug-version in the release branch (Re: Exception in rexx.exe, please advise ... (Re: Questions, RFI on multithreading
Rick McGuire wrote: Well, the first thing you should do is use the release build, not the trunk build. That version would be considered under construction at this point, since the exception stack handling is being redone. O.K., created it, and ran it a couple of times until an exception occurred (see below). After that I kept running it and the third time later another exception occurred (see second report) in a different place. Then running the test suite 10, 15 times did not yield any exception. --- All those exceptions only occur with the Rexx test unit test that will spin off 23 Java threads dispatching another Rexx script that spins off 29 Rexx threads. In all those threads there is interaction going on with Rexx objects directly or via BSF4Rexx in form of Java RexxProxy objects that dispatch messages on the Rexx side. {The multithreaded test unit where only Rexx threads are created which each attach to Java and interact with it, run alwayssuccessfully.) --- Here exception # 1 (after running the tests a couple of times without a problem): * stack trace rexx.dll!SysSemaphore::post() Line 100 + 0xa bytes C++ rexx.dll!RexxActivity::guardPost() Line 1743 C++ rexx.dll!RexxVariable::notify() Line 138 C++ rexx.dll!RexxVariable::set(RexxObject * value=0x7fd4af50) Line 68 + 0x8 bytes C++ rexx.dll!RexxActivation::setLocalVariable(RexxString * name=0x7fcb06d8, unsigned int index=3, RexxObject * value=0x7fd4af50) Line 515 C++ rexx.dll!RexxInstructionMessage::execute(RexxActivation * context=0x7f66a818, RexxExpressionStack * stack=0x7f66a8d8) Line 246 C++ rexx.dll!RexxActivation::run(RexxObject * _receiver=0x7d7b8110, RexxString * msgname=0x7f0932f0, RexxObject * * _arglist=0x7e2eccac, unsigned int _argcount=7, RexxInstruction * start=0x, ProtectedObject resultObj={...}) Line 516 C++ rexx.dll!RexxActivation::dispatch() Line 375 + 0x33 bytes C++ rexx.dll!RexxActivity::runThread() Line 123C++ rexx.dll!call_thread_function(void * arguments=0x7f204260) Line 63 C++ kernel32.dll!7c80b729() [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] rexx.dll!SysMutex::release() Line 134 C++ * Here's the end of the Output window: The thread 'Win32 Thread' (0x1784) has exited with code 0 (0x0). Unhandled exception at 0x0031d68a (rexx.dll) in rexx.exe: 0xC005: Access violation reading location 0x64f445e9. * The break occured in SysSemaphore.hpp in the public method: void post() { SetEvent(sem); }; Here exception # 2 (after running immediately two sets successfuly): * call stack trace rexx.dll!RexxList::getFree() Line 148 + 0x14 bytes C++ rexx.dll!RexxList::insert(RexxObject * _value=0x7d84ad98, RexxObject * _index=0x) Line 556 + 0x8 bytes C++ rexx.dll!RexxList::append(RexxObject * _value=0x7d84ad98) Line 542 C++ rexx.dll!RexxNativeActivation::createLocalReference(RexxObject * objr=0x7d84ad98) Line 1148C++ rexx.dll!ApiContext::ret(RexxObject * o=0x7d84ad98) Line 171 C++ rexx.dll!ObjectToString(RexxThreadContext_ * c=0x7d7d2c04, _RexxObjectPtr * o=0x7d84ad98) Line 958 + 0x17 bytesC++ BSF4Rexx.dll!RexxThreadContext_::ObjectToString(_RexxObjectPtr * o=0x7d84ad98) Line 1022 C++ BSF4Rexx.dll!RexxCallContext_::ObjectToString(_RexxObjectPtr * o=0x7d84ad98) Line 2366 C++ BSF4Rexx.dll!BSF_impl(RexxCallContext_ * context=0x03c5f9d4, _RexxArrayObject * argArray=0x7d84afb0) Line 5319 + 0x12 bytesC++ BSF4Rexx.dll!BSF(RexxCallContext_ * context=0x03c5f9d4, ValueDescriptor * arguments=0x03c5f9f0) Line 5146 + 0x17 bytes C++ rexx.dll!RexxNativeActivation::callNativeRoutine(RoutineClass * _routine=0x7f2242f0, RexxNativeRoutine * _code=0x7f2242d0, RexxString * functionName=0x7d84ace8, RexxObject * * list=0x7e356954, unsigned int count=5, ProtectedObject resultObj={...}) Line 1312C++ rexx.dll!RexxNativeRoutine::call(RexxActivity * activity=0x7d7d2bf0, RoutineClass * routine=0x7f2242f0, RexxString * functionName=0x7d84ace8, RexxObject * * argPtr=0x7e356954, unsigned int count=5, ProtectedObject result={...}) Line 316 C++ rexx.dll!RoutineClass::call(RexxActivity * activity=0x7d7d2bf0, RexxString * msgname=0x7d84ace8, RexxObject * * argPtr=0x7e356954, unsigned int argcount=5, ProtectedObject result={...}) Line 234 C++ rexx.dll!PackageManager::callNativeRoutine(RexxActivity * activity=0x7d7d2bf0, RexxString * name=0x7d84ace8, RexxObject * * arguments=0x7e356954, unsigned int argcount=5, ProtectedObject result={...}) Line 658C++ rexx.dll!SystemInterpreter::invokeExternalFunction(RexxActivation * activation=0x7de55918, RexxActivity *
[Oorexx-devel] [Fwd: Re: ooRexx Logo]
Hi there, Gray Wilson has come up with a set of new ooRexx logos on the oorexx-users list, which he offers for free use to the Rexx community (cf. enclosed e-mails)! Enclosed please find his announcement e-mail and a link to an impressive set of renderings of mime-type icons following the target platform designs. He certainly has invested a lot of time and seems to be a very talented person in that way too! [Personally, I will take advantage of the BSF4Rexx and OpenOffice.org-Rexx logos for the upcoming version of BSF4Rexx 4.0.] Whether the community and/or RexxLA would take on these new logos in lieu of the existing ones will probably need some discussions in the respective groups. As Gray continues to add new platforms for the ooRexx logos, you may want to check out the website he points to in his e-mail. Also, if you want to give him feedback, you may want to use the user mailing list on Sourceforge: http://sourceforge.net/mailarchive/forum.php?forum_name=oorexx-users. ---rony Original Message Subject: Re: ooRexx Logo Date: Mon, 14 Sep 2009 03:19:04 +0100 From: Gray Wilson gdwz-z02xgkufpwys+fvcfc7...@public.gmane.org Reply-To: Open Object Rexx Users oorexx-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org To: Open Object Rexx Users oorexx-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org Newsgroups: gmane.comp.lang.rexx.oorexx.user Thanks, Rony and Peter for your encouragement. I've updated the set with another XP style filetype icon, giving a total of 72 pngs. http://graywz.deviantart.com/art/Open-Object-Rexx-Icons-136889466 I will work on an OSX style icon and upload it later this week. Thanks again Gray Original Message Subject: Re: ooRexx Logo Date: Sun, 13 Sep 2009 16:59:33 +0100 From: Gray Wilson gdwz-z02xgkufpwys+fvcfc7...@public.gmane.org Reply-To: Open Object Rexx Users oorexx-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org To: Open Object Rexx Users oorexx-users-5nwgofrqmnerv+lv9mx5uipxlwaov...@public.gmane.org Newsgroups: gmane.comp.lang.rexx.oorexx.user Hi Rony (and everyone) I've uploaded a complete ooRexx application-and-filetype set of icons for Linux and Windows. http://graywz.deviantart.com/art/Open-Object-Rexx-Icons-136889466 I took the liberty of using a code stub (written by you in Resurrecting REXX, Introducing Object Rexx) in some of the icons. I hope you don't mind. The images are in ICO and PNG formats, and I've included the full Photoshop PSD source files for freedom and flexibility. But please let me know if you'd like me to change or add anything. Best wishes Gray Wilson -- Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july ___ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel
Re: [Oorexx-devel] Additional information (Re: Now with the debug-version in the release branch (Re: Exception in rexx.exe, please advise ... (Re: Questions, RFI on multithreading
One more observation: changing the Java code for the Java threads to not use the same Rexx interpreter instance (RII) as the previously posted example, but rather create their own RII that then is used to run the submitted Rexx program (which then will spin off Rexx threads), then I get reliably exceptions (all Java threads got created at that point, but no Rexx script has generated any debug output yet), with a stack trace that goes into rexx. Unfortunately, because of the beginning winter semester, I have barely time to analyze this further, as my planner is now full with University meetings and preparation for classes and the like. So further information from my side may take a couple of days. [The *totally unsubstantiated* gut feeling - from weeks of looking at all sort of debug outputs - would be at the moment, that something goes wrong in the AttachThread() or DetachThread() in a heavily multithreaded run-set. Once I debug this new test case, which looks promising just because it reliably fails, I would know more. One test case I plan to create on the weekend is to write a small C++ program that creates 23 threads in which individual RIIs get created, which are then used from the threads to run an adapted Rexx proram, that spins off 27 Rexx threads. With a little luck that may exhibit the same behaviour, although the context switches between the Java and Rexx environments would not take place in this case.] Just posted this for the record, as it may be the case that someone has additional ideas about what I should be looking into while working on this this coming weekend. ---rony Rony G. Flatscher wrote: Short of an example that would reliably produce an exception in the heavy multithreading scenario, maybe this descritpion of what happens in BSF4Rexx may be helpful: In the context of the testUnits a Rexx program will create an instance of the Java class TestNestedEngines, supplying it the parameters (see below) and RexxProxy objects to follow/interact with. Below is the Java program, followed by the Rexx program that gets invoked. Finally, a brief description of how the Rexx APIs get used. * the following Java program from the BSF4Rexx test unit gets invoked from a Rexx script, supplying as arguments the current BSFManager object which manages one Rexx interpreter instance (RII), a RexxProxy that allows to interact with the testUnit (allowing sending it assert messages), the nrJavaThreads and the nrRexxThreads per Java thread, and a RexxProxy for an ooRexx array, which will get the different thread's thread IDs added (the items in this array will indicate how many threads got invoked): // rgf, 2009-09-10: test execution of Rexx scripts by concurrently creating Rexx scripts package rgf.F_multiThreading; import org.rexxla.bsf.engines.rexx.RexxProxy; import org.apache.bsf.*;// BSF support import java.io.IOException; // exception handling import java.io.File; import java.io.FileReader; import java.util.Vector; /** Test Java program which demonstrates how easy it is to invoke Rexx via BSF. * @author Rony G. Flatscher, 2001-04-27, 2007-09-10, 2009-09-11 */ public class TestNestedEngines { static BSFManager bm=null; // BSFManager of the Rexx instance that invoked this Java program static RexxProxy testUnit=null; // to allow assertions static int nrJavaThreads=0; // determine number of Java threads static int nrRexxThreads=0; // determine number of Rexx threads static String rexxCode=null; // Rexx code to run static RexxProxy rpArray=null;// RexxProxy to allow storing TID in Rexx array object public TestNestedEngines(BSFManager bm, RexxProxy testUnit, int nrJavaThreads, int nrRexxThreads, String rexxCode, RexxProxy rpArray) { // save arguments in attributes TestNestedEngines.bm=bm; TestNestedEngines.testUnit =testUnit; TestNestedEngines.nrJavaThreads =nrJavaThreads; TestNestedEngines.nrRexxThreads =nrRexxThreads; TestNestedEngines.rexxCode =rexxCode; TestNestedEngines.rpArray =rpArray; } /** Creates number of desired threads, runs them. */ public void dispatchRexxScripts() throws Exception { String tmpResult=; Throwable tmpTh=null; String tmpthreadName=null; // create arrays of needed size Thread t[]=new Thread[nrJavaThreads]; ThreadedJNIRexxStart r[]=new ThreadedJNIRexxStart[nrJavaThreads]; for (int i=0;inrJavaThreads; i++) { r[i]=new
[Oorexx-devel] Seems I got a version that creates an exceptin without BSF4Rexx (Re: Additional information (Re: Now with the debug-version in the release branch (Re: Exception in rexx.exe, please advi
Played around all the weekend, trying to create a test case which would cause an exception in the context of employing multithreading heavily, without BSF4Rexx and Java. Finally, after quite some time, I was lucky to get the following call trace: rexx.dll!RexxBehaviour::isPrimitive() Line 101 + 0xa bytes C++ rexx.dll!RexxInternalObject::isBaseClass() Line 175C++ rexx.dll!RexxObject::requestString() Line 1132 + 0x8 bytes C++ rexx.dll!REQUEST_STRING(RexxObject * object=0x7f0f28e0) Line 277 + 0x24 bytes C++ rexx.dll!ObjectToStringValue(RexxThreadContext_ * c=0x7eeed024, _RexxObjectPtr * o=0x7f0f28e0) Line 971 + 0x8 bytesC++ TestThreadedExecution.exe!RexxThreadContext_::ObjectToStringValue(_RexxObjectPtr * o=0x7f0f28e0) Line 1026 C++ TestThreadedExecution.exe!MyThreadFunction(void * lpParam=0x0015d5c0) Line 261 + 0xc bytes C++ kernel32.dll!7c80b729() [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll] rexx.dll!RexxMemory::holdObject(RexxInternalObject * obj=0x0015d5c0) Line 1617 C++ Here's the exception: The thread 'Win32 Thread' (0x584) has exited with code 0 (0x0). Unhandled exception at 0x10017f8a (rexx.dll) in TestThreadedExecution.exe: 0xC005: Access violation reading location 0x00d2. It was necessary to more or less come up with the same architecture as with BSF4Rexx, before I hit this (but had to run the program a couple of times): * a C-program that creates a Rexx interpreter instance (using it to create an array object that will be passed on to add the tid-value) and spins off 59 threads, in which each one creates another Rexx interpreter instance which is then used to run a Rexx program that spins off 29 Rexx threads; in the Rexx programs an external routine is called to return the TID to them. * main() sets up the parameters, one Rexx interpreter instance and calls CreateAndRunThreads(...), which controls the creation of threads; each thread executes the code in MyThreadFunction( ). Using the debug version of the 4.0.0 release; the exe and dll is created with debug information as well, such that each accounts for over 400KB, hence uploading the binaries to Sourceforge is not possible, judging from the last such attempts. Also, please note, that the exception does not occur reliably, so one may have to re-run the program a couple of times before it may bomb. (Also, I did change the parameters at the beginning of main() a couple of times, recompiled, re-ran the exe a couple of times.) Please advise where I should upload the archive to (compiled, sourcecode, Makefile and def-file), which is about 290KB. Regards, ---rony Rony G. Flatscher wrote: One more observation: changing the Java code for the Java threads to not use the same Rexx interpreter instance (RII) as the previously posted example, but rather create their own RII that then is used to run the submitted Rexx program (which then will spin off Rexx threads), then I get reliably exceptions (all Java threads got created at that point, but no Rexx script has generated any debug output yet), with a stack trace that goes into rexx. Unfortunately, because of the beginning winter semester, I have barely time to analyze this further, as my planner is now full with University meetings and preparation for classes and the like. So further information from my side may take a couple of days. [The *totally unsubstantiated* gut feeling - from weeks of looking at all sort of debug outputs - would be at the moment, that something goes wrong in the AttachThread() or DetachThread() in a heavily multithreaded run-set. Once I debug this new test case, which looks promising just because it reliably fails, I would know more. One test case I plan to create on the weekend is to write a small C++ program that creates 23 threads in which individual RIIs get created, which are then used from the threads to run an adapted Rexx proram, that spins off 27 Rexx threads. With a little luck that may exhibit the same behaviour, although the context switches between the Java and Rexx environments would not take place in this case.] Just posted this for the record, as it may be the case that someone has additional ideas about what I should be looking into while working on this this coming weekend. ---rony Rony G. Flatscher wrote: Short of an example that would reliably produce an exception in the heavy multithreading scenario, maybe this descritpion of what happens in BSF4Rexx may be helpful: In the context of the testUnits a Rexx program will create an instance of the Java class TestNestedEngines, supplying it the parameters (see below) and RexxProxy objects to follow/interact with. Below is the Java program, followed by the Rexx program that gets invoked. Finally, a brief