[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] Reflect Table overhaul is finished!

2000-07-14 Thread Larry W. Virden

Sorry Mo, I should have remembered this from the last time.  Unfortunately,
because the Sun JDK comes with Solaris, that's what I am resigned to using.
-- 
Never apply a Star Trek solution to a Babylon 5 problem.
Larry W. Virden mailto:[EMAIL PROTECTED] URL: http://www.purl.org/NET/lvirden/
Unless explicitly stated to the contrary, nothing in this posting should 
be construed as representing my employer's opinions.
--


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] Reflect Table overhaul is finished!

2000-07-14 Thread Larry W. Virden

Would it be worthwhile for these tests to generate a msg when the test case
sees what it is using that marks the test case as a known problem?
-- 
Never apply a Star Trek solution to a Babylon 5 problem.
Larry W. Virden mailto:[EMAIL PROTECTED] URL: http://www.purl.org/NET/lvirden/
Unless explicitly stated to the contrary, nothing in this posting should 
be construed as representing my employer's opinions.
--


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] problems using tclBlend with Tcl threading

2000-07-14 Thread Mike Schwartz

Hi,

I am using Tcl 8.3.0 with tclBlend 1.3.0 (with the code for the testthread 
command compiled in) and Java JS2E v1.3 beta.  When my software first 
starts, I need to invoke a static Java method, and then later I need to 
spawn a Tcl thread that invokes more Java methods (both static and instance 
methods).  I find that the Tcl thread's Java invocation does not work, as 
demonstrated by the following code snippet:

 1   package require java
 2   java::call Integer parseInt 3
 3   set th [testthread create]
 4   testthread send $th [list set env(LD_LIBRARY_PATH) 
$env(LD_LIBRARY_PATH)]
 5   testthread send $th [list package require java]
 6   testthread send $th [list java::call Integer parseInt 3]

[Line numbers above are just for discussion, they're not in the actual tcl 
script file.]

Basically, if you create a thread and then try to send it some tclblend
commands to run, it doesn't work right.  The "package require java" at
line 5 causes the following error output:
 #
 # HotSpot Virtual Machine Error, Unexpected Signal 11
 # Please report this error at
 # http://java.sun.com/cgi-bin/bugreport.cgi
 #
 # Error ID: 4F533F534F4C415249530E4350500820 01
 #
 # Problematic Thread: Segmentation fault

If I don't do the "package require java" at line 5, Tcl complains 'invalid
command name "java::call"'

If you remove lines 1-2 in the code snippet, it works.  I could hack around
this problem by changing the structure of my system to create threads before
it does any tcl/java calls, but that would be kind of a screwy way to
structure my software and I'm hoping not to have to do that.  So, any
suggestions would be greatly appreciated.


thanks,
  - Mike Schwartz


The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:send mail to [EMAIL PROTECTED]  
 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com




[Tcl Java] Re: [Tcl Java] problems using tclBlend with Tcl threading

2000-07-14 Thread Mo DeJong

On Fri, 14 Jul 2000, Mike Schwartz wrote:

 Hi,

Hi Mike.

 I am using Tcl 8.3.0 with tclBlend 1.3.0 (with the code for the testthread 
 command compiled in) and Java JS2E v1.3 beta.  When my software first 
 starts, I need to invoke a static Java method, and then later I need to 
 spawn a Tcl thread that invokes more Java methods (both static and instance 
 methods).  I find that the Tcl thread's Java invocation does not work, as 
 demonstrated by the following code snippet:
 
  1   package require java
  2   java::call Integer parseInt 3
  3   set th [testthread create]
  4   testthread send $th [list set env(LD_LIBRARY_PATH) \
$env(LD_LIBRARY_PATH)]
  5   testthread send $th [list package require java]
  6   testthread send $th [list java::call Integer parseInt 3]
 
 [Line numbers above are just for discussion, they're not in the actual tcl 
 script file.]
 
 Basically, if you create a thread and then try to send it some tclblend
 commands to run, it doesn't work right.  The "package require java" at
 line 5 causes the following error output:
  #
  # HotSpot Virtual Machine Error, Unexpected Signal 11
  # Please report this error at
  # http://java.sun.com/cgi-bin/bugreport.cgi
  #
  # Error ID: 4F533F534F4C415249530E4350500820 01
  #
  # Problematic Thread: Segmentation fault

I tested out your example code with IBM JDK 1.3 and got
(what I can only assume is) the same error. Here is the stack trace.

(gdb) bt
#0  0x4011fd41 in __kill () from /lib/libc.so.6
#1  0x400d7c33 in __pthread_restart_new (th=0x400df940) at pthread.c:809
#2  0x400d51cc in pthread_cond_broadcast (cond=0x81ff860) at restart.h:21
#3  0x400af2a6 in Tcl_ConditionNotify (condPtr=0x81ff830) at 
/home/mo/project/tcl/unix/../unix/tclUnixThrd.c:715
#4  0x8058946 in ThreadEventProc (evPtr=0x81ff7f8, mask=-3) at 
/home/mo/project/tcl/unix/../generic/tclThreadTest.c:893
#5  0x4008a1e8 in Tcl_ServiceEvent (flags=-3) at 
/home/mo/project/tcl/unix/../generic/tclNotify.c:607
#6  0x4008a63b in Tcl_DoOneEvent (flags=-3) at 
/home/mo/project/tcl/unix/../generic/tclNotify.c:910
#7  0x8057d3d in Tcl_ThreadObjCmd (dummy=0x0, interp=0x81f8d80, objc=2, 
objv=0xbefffb58) at /home/mo/project/tcl/unix/../generic/tclThreadTest.c:358
#8  0x4008d07f in EvalObjv (interp=0x81f8d80, objc=2, objv=0xbefffb58, 
command=0x8202d60 "testthread wait", length=15, flags=0) at 
/home/mo/project/tcl/unix/../generic/tclParse.c:932
#9  0x4008d974 in Tcl_EvalEx (interp=0x81f8d80, script=0x8202d60 
"testthread wait", numBytes=15, flags=0) at 
/home/mo/project/tcl/unix/../generic/tclParse.c:1393
#10 0x4008dc75 in Tcl_Eval (interp=0x81f8d80, string=0x8202d60 
"testthread wait") at /home/mo/project/tcl/unix/../generic/tclParse.c:1512
#11 0x8058030 in NewThread (clientData=0xbfffe954) at 
/home/mo/project/tcl/unix/../generic/tclThreadTest.c:512
#12 0x400d5b85 in pthread_start_thread (arg=0xbefffe40) at manager.c:241
#13 0x400d654c in pthread_start_thread_event (arg=0xbefffe40) at 
manager.c:264


It is crashing at line 715 in tclUnixThrd.c, it is
the call to pthread_cond_broadcast() that seems
to be going bad.

710 Tcl_ConditionNotify(condPtr)
711 Tcl_Condition *condPtr;
-   712 {
-   713 pthread_cond_t *pcondPtr = *((pthread_cond_t **)condPtr);
-   714 if (pcondPtr != NULL) {
-   715 pthread_cond_broadcast(pcondPtr);
-   716 } else {
717 /*
718  * Noone has used the condition variable, so 
there are no waiters.
719  */
720 }
-   721 }



I don't know too much about the guts of pthreads, but
here is what I am getting for the pcondPtr variable.

(gdb) print *pcondPtr
$2 = {__c_lock = {__status = 0, __spinlock = 0}, __c_waiting = 0x0}


Perhaps the JVM and Tcl are using the same signals to
do inter thread communication or something. Does anyone
have any ideas what this one might be?

Things get even more strange when I run this in JDK 1.1.8
from Blackdown. Here is the stack trace I get there.

#0  0x4026cca6 in ?? ()
#1  0x40258f1d in ?? ()
#2  0x4020f03e in ?? ()
#3  0x400854e4 in Tcl_LoadObjCmd (dummy=0x0, interp=0x808e760, objc=2, 
objv=0x818e730) at /home/mo/project/tcl/unix/../generic/tclLoad.c:384
#4  0x4008d07f in EvalObjv (interp=0x808e760, objc=2, objv=0x818e730, 
command=0x400b88f4 "", length=0, flags=262144) at 
/home/mo/project/tcl/unix/../generic/tclParse.c:932
#5  0x4008d204 in Tcl_EvalObjv (interp=0x808e760, objc=2, objv=0x818e730, 
flags=262144) at /home/mo/project/tcl/unix/../generic/tclParse.c:1019
#6  0x40038eb5 in Tcl_EvalObjEx (interp=0x808e760, objPtr=0x818e1f0, 
flags=262144) at /home/mo/project/tcl/unix/../generic/tclBasic.c:2575
#7  0x40096139 in Tcl_UplevelObjCmd (dummy=0x0, interp=0x808e760, objc=2, 
objv=0x816a564) at /home/mo/project/tcl/unix/../generic/tclProc.c:614
#8  0x40060bb6 in TclExecuteByteCode (interp=0x808e760,