[Tcl Java] Re: merge with aolserver

2000-10-13 Thread Daniel Wickstrom

> "Jiang" == Jiang Wu <[EMAIL PROTECTED]> writes:

Jiang> I ran your test on my version of the fix.  I don't see any
Jiang> crash.  One difference in my code is that I didn't remove
Jiang> any of the reference counting code that was in the C part
Jiang> of TclBlend.  I.e. when a Tcl_Obj is created to wrap a
Jiang> TclObject, it adds a ref count.  Theoretically, this is not
Jiang> needed since it already adds a Java global reference.  I
Jiang> left those code alone because I have not had the time to
Jiang> think through the impact on removing these.

I've been trying to think about the ref-counting problem, but I find
that I get confused about the role of various objects in tclblend.
Could someone summarize the roles and relationships for TclObjects,
CObjects, ReflectObjects and Tcl_Obj's and if you think there is
anything else that is relevant to thinking about reference counting, I
would be glad to hear about that also.

-Dan


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: merge with aolserver

2000-10-10 Thread Jiang Wu

I ran your test on my version of the fix.  I don't see any crash.  One
difference in my code is that I didn't remove any of the reference counting
code that was in the C part of TclBlend.  I.e. when a Tcl_Obj is created to
wrap a TclObject, it adds a ref count.  Theoretically, this is not needed
since it already adds a Java global reference.  I left those code alone
because I have not had the time to think through the impact on removing
these.

I only changed the reference counting on the part where TclObject is
wrapping Tcl_Obj.  With that change, I noticed one core dump scenario, which
was fixed by the patch to the ReflectObject.java.

The test was ran on Solaris 2.7, JDK 1.2.2, blend 1.2.6 with the patch on
reference counting in the Java section only.

I see some other non-crashing errors, which may still bugs related to the
reference counting elsewhere in the TclJava section.  I see errors that
says:

Unable to load tcl.lang.NativeTestExtension.  Some tests may fail.
load "tcl.lang.NativeTestExtension" failed: can't find class "2656256"

-- Jiang

> -Original Message-
> From: Mo DeJong [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 09, 2000 9:42 PM
> To: [EMAIL PROTECTED]
> Subject: [Tcl Java] Re: merge with aolserver
> 
> 
> On Mon, 9 Oct 2000, Daniel Wickstrom wrote:
> 
> > >>>>> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
> > 
> > Mo> Humm, I think so but I can't remember off hand. The problem
> > Mo> with this "fix" is that it currently does not work. 
> There are
> > Mo> strange crashes when running the test suite. 
> > 
> > By strange crashes, do you mean that it doesn't 
> consistently crash at
> > the same point in the test suite?
> 
> What I meant to say was that a wacky ref counting problem that
> I have not been able to pin down seems to be causing a core
> dump inside the JVM. It happens at the exact same spot in
> the test suite, but getting a small test case is really tricky.
> 
> After many hours of trimming, the minimal code that will crash
> was identified as:
> 
> 
> if 1 {
> 
> if {[string compare test [info procs test]] == 1} then {source defs}
> setupJavaPackage
> 
> set testArray1 [java::new {int[]} 5 {6 7 8 9 10}]
> set testArray3 [java::new {int[][][]} {2 3 4}]
> 
> puts " 10.4"
> 
> test ArrayObject-10.4 {cmdProc initArray} {
> list [catch {
>   set a [java::new {int[]} 5 {6 7 8 9 10}]
>   $a getrange 1 3
> } msg] $msg
> } {0 {7 8 9}}
> 
> puts " 11.8"
> 
> test arrayObject-11.8 {initArray} {
> list [catch {
>   set handle [java::new {int[][]} {4} {{} {6} {7 8} {9 10 11}}]
>   set a0 [$handle get 0]
>   set a1 [$handle get 1]
>   set a2 [$handle get 2]
>   set a3 [$handle get 3]
>   list [java::info cl $handle] [$handle length] \
>   [$a0 getrange] [$a1 getrange] [$a2 getrange] [$a3 getrange]
> } msg] $msg
> } {0 {{int[][]} 4 {} 6 {7 8} {9 10 11}}}
> 
> test arrayObject-11.10 {initArray} {
> list [catch {
>   set handle [java::new {String[][]} {3 2} {{hello} {7 8} 
> {foo bar baz}}]
>   set a00 [$handle get {0 0}]
>   set a01 [$handle -noconvert get {0 1}]
>   if {$a01 == [java::null]} {set a01 "null"}
>   set a1 [$handle get 1]
>   set a2 [$handle get 2]
>   list [java::info cl $handle] [$handle length] \
>   $a00 $a01 [$a1 getrange] [$a2 getrange]
> } msg] $msg
> } {0 {{java.lang.String[][]} 3 hello null {7 8} {foo bar}}}
> 
> test arrayObject-11.11 {initArray} {
> list [catch {
>   set handle [java::new {String[][]} {3 2} {{hello} {7 8} 
> {foo bar baz}}]
>   set a00 [$handle get {0 0}]
>   set a01 [$handle get {0 1}]
>   if {$a01 == [java::null]} {set a01 "null"}
>   set a1 [$handle get 1]
>   set a2 [$handle get 2]
>   list [java::info cl $handle] [$handle length] \
>   $a00 $a01 [$a1 getrange] [$a2 getrange]
> } msg] $msg
> } {0 {{java.lang.String[][]} 3 hello {} {7 8} {foo bar}}}
> 
> 
> 
> test arrayObject-11.12 {initArray, error conditions} {
> list [catch {
>   set handle [java::new {int[][]} {} {}]
> } msg] $msg
> } {1 {cannot initialize a 2 dimensional array with zero size 
> in dimension 0}}
> 
> test arrayObject-11.13 {initArray} {
> list [catch {
>   set handle [java::new {int[][][]} {} {{{1 2} {3 4}} {}}]
> } msg] $msg
> } {1 {cannot initialize a 3 dimensional array with zero size 
> in dimension 1}}
> 
> puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 

[Tcl Java] Re: merge with aolserver

2000-10-09 Thread Mo DeJong

On Mon, 9 Oct 2000, Daniel Wickstrom wrote:

> > "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
> 
> Mo> Humm, I think so but I can't remember off hand. The problem
> Mo> with this "fix" is that it currently does not work. There are
> Mo> strange crashes when running the test suite. 
> 
> By strange crashes, do you mean that it doesn't consistently crash at
> the same point in the test suite?

What I meant to say was that a wacky ref counting problem that
I have not been able to pin down seems to be causing a core
dump inside the JVM. It happens at the exact same spot in
the test suite, but getting a small test case is really tricky.

After many hours of trimming, the minimal code that will crash
was identified as:


if 1 {

if {[string compare test [info procs test]] == 1} then {source defs}
setupJavaPackage

set testArray1 [java::new {int[]} 5 {6 7 8 9 10}]
set testArray3 [java::new {int[][][]} {2 3 4}]

puts " 10.4"

test ArrayObject-10.4 {cmdProc initArray} {
list [catch {
set a [java::new {int[]} 5 {6 7 8 9 10}]
$a getrange 1 3
} msg] $msg
} {0 {7 8 9}}

puts " 11.8"

test arrayObject-11.8 {initArray} {
list [catch {
set handle [java::new {int[][]} {4} {{} {6} {7 8} {9 10 11}}]
set a0 [$handle get 0]
set a1 [$handle get 1]
set a2 [$handle get 2]
set a3 [$handle get 3]
list [java::info cl $handle] [$handle length] \
[$a0 getrange] [$a1 getrange] [$a2 getrange] [$a3 getrange]
} msg] $msg
} {0 {{int[][]} 4 {} 6 {7 8} {9 10 11}}}

test arrayObject-11.10 {initArray} {
list [catch {
set handle [java::new {String[][]} {3 2} {{hello} {7 8} {foo bar baz}}]
set a00 [$handle get {0 0}]
set a01 [$handle -noconvert get {0 1}]
if {$a01 == [java::null]} {set a01 "null"}
set a1 [$handle get 1]
set a2 [$handle get 2]
list [java::info cl $handle] [$handle length] \
$a00 $a01 [$a1 getrange] [$a2 getrange]
} msg] $msg
} {0 {{java.lang.String[][]} 3 hello null {7 8} {foo bar}}}

test arrayObject-11.11 {initArray} {
list [catch {
set handle [java::new {String[][]} {3 2} {{hello} {7 8} {foo bar baz}}]
set a00 [$handle get {0 0}]
set a01 [$handle get {0 1}]
if {$a01 == [java::null]} {set a01 "null"}
set a1 [$handle get 1]
set a2 [$handle get 2]
list [java::info cl $handle] [$handle length] \
$a00 $a01 [$a1 getrange] [$a2 getrange]
} msg] $msg
} {0 {{java.lang.String[][]} 3 hello {} {7 8} {foo bar}}}



test arrayObject-11.12 {initArray, error conditions} {
list [catch {
set handle [java::new {int[][]} {} {}]
} msg] $msg
} {1 {cannot initialize a 2 dimensional array with zero size in dimension 0}}

test arrayObject-11.13 {initArray} {
list [catch {
set handle [java::new {int[][][]} {} {{{1 2} {3 4}} {}}]
} msg] $msg
} {1 {cannot initialize a 3 dimensional array with zero size in dimension 1}}

puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"
puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"
puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"
puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"
puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"
puts "%^$%^$#%^$#%^$%^$#%^$#%^#** 11.4"


test arrayObject-11.14 {initArray} {
list [catch {
set handle [java::new {int[][][]} {3} {{{1 2} {3 4}} {{5 6} {7 8}}}]
} msg] $msg
} {1 {cannot initialize a 3 dimensional array with zero size in dimension 1}}


}


puts DONE!
exit


You can save it in a file or just copy and paste it into
the shell you started with "make shell". It crashes every
time on my Linux box (Red Hat 6.2) during 11.14.

I even tried it with Jiang's patch to add an additional
incrRefCount() and decrRefCount() call, but that did no good.

I am rather stumped at this point. I could do some more
debugging, but at this point I would rather punt on
the ref count issue and focus on the Notifier.

Mo DeJong
Red Hat Inc


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: merge with aolserver

2000-10-09 Thread Daniel Wickstrom

> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:


Mo> Humm, I think so but I can't remember off hand. The problem
Mo> with this "fix" is that it currently does not work. There are
Mo> strange crashes when running the test suite. 

By strange crashes, do you mean that it doesn't consistently crash at
the same point in the test suite?

-Dan


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: merge with aolserver

2000-10-09 Thread Daniel Wickstrom

> "Jiang" == Jiang Wu <[EMAIL PROTECTED]> writes:

Jiang> This patch contains my code for the ref count fix.  Patch
Jiang> is generated against 1.2.6.  It passes the test suite
Jiang> without any problems.  It includes the reflect object bug
Jiang> fix, which causes the test suite to core dump.  I am
Jiang> planning to integrate this into my work product, which is
Jiang> using 1.2.6.  But with this fix, it makes life much easier
Jiang> to write Tcl commands in Java.

O.k. Thanks.  I'll take a look at these and see if I can apply it to
my work.

-Dan


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: merge with aolserver

2000-10-09 Thread Jiang Wu

This patch contains my code for the ref count fix.  Patch is generated
against 1.2.6.  It passes the test suite without any problems.  It includes
the reflect object bug fix, which causes the test suite to core dump.  I am
planning to integrate this into my work product, which is using 1.2.6.  But
with this fix, it makes life much easier to write Tcl commands in Java.

-- Jiang Wu
   [EMAIL PROTECTED]





> -Original Message-
> From: Daniel Wickstrom [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 09, 2000 6:51 AM
> To: [EMAIL PROTECTED]
> Subject: [Tcl Java] Re: merge with aolserver
> 
> 
> >>>>> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
> 
> 
> Jiang> 1. The work on fixing how TclObject uses Tcl_Obj's
> Jiang> reference counting.
> >>  Is this detailed earlier in the mailing list archvies?
> 
> Mo> Humm, I think so but I can't remember off hand. The problem
> Mo> with this "fix" is that it currently does not work. There are
> Mo> strange crashes when running the test suite. I was thinking
> Mo> that it might be best to try using one of the other
> Mo> implementations we talked about (like the free Tcl object
> Mo> enque thing) in the short term.  After the notifier queue impl
> Mo> was fixed, things should be working well enough to be merged
> Mo> back into the HEAD branch. Then, the ref counting stuff could
> Mo> be worked on in isolation.
> 
> If you could send me what you have, I would be willing to look into it
> some more.  I've spent a considerable amount of time looking at the
> reference counting problem this week-end, and I would like to pursue
> it a little further.
> 
> -Dan
> 
> 
> 
> 
> 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


 ReflectObject.java.patch
 InternalRep.java.patch
 CObject.java.patch
 TclObject.java.patch


[Tcl Java] Re: merge with aolserver

2000-10-09 Thread Daniel Wickstrom

> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:


Jiang> 1. The work on fixing how TclObject uses Tcl_Obj's
Jiang> reference counting.
>>  Is this detailed earlier in the mailing list archvies?

Mo> Humm, I think so but I can't remember off hand. The problem
Mo> with this "fix" is that it currently does not work. There are
Mo> strange crashes when running the test suite. I was thinking
Mo> that it might be best to try using one of the other
Mo> implementations we talked about (like the free Tcl object
Mo> enque thing) in the short term.  After the notifier queue impl
Mo> was fixed, things should be working well enough to be merged
Mo> back into the HEAD branch. Then, the ref counting stuff could
Mo> be worked on in isolation.

If you could send me what you have, I would be willing to look into it
some more.  I've spent a considerable amount of time looking at the
reference counting problem this week-end, and I would like to pursue
it a little further.

-Dan




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: merge with aolserver

2000-10-09 Thread Mo DeJong

On Fri, 6 Oct 2000, Daniel Wickstrom wrote:

> > "Jiang" == Jiang Wu <[EMAIL PROTECTED]> writes:
> 
> Jiang> I had allocated time to work on this until the end of
> Jiang> August.  Due to various delays, the project was not
> Jiang> finished in that time frame.  I am no longer working on it.
> Jiang> Looking at the CVS branch, I think the following things
> Jiang> have to be added before you can get a working version:
> 
> Has this work been suspended indefinitely?

The contract with Ajuba was terminated prematurely and it
will not be renewed. Any further work would be time
donated by Jiang, myself, or anyone else who wanted
to help out.

> Jiang> 1. The work on fixing how TclObject uses Tcl_Obj's
> Jiang> reference counting.  
> 
> Is this detailed earlier in the mailing list archvies?

Humm, I think so but I can't remember off hand. The problem with
this "fix" is that it currently does not work. There are strange
crashes when running the test suite. I was thinking that it might
be best to try using one of the other implementations we talked
about (like the free Tcl object enque thing) in the short term.
After the notifier queue impl was fixed, things should be working
well enough to be merged back into the HEAD branch. Then, the
ref counting stuff could be worked on in isolation.

Mo DeJong
Red Hat Inc


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: merge with aolserver

2000-10-06 Thread Daniel Wickstrom

> "Jiang" == Jiang Wu <[EMAIL PROTECTED]> writes:

Jiang> I had allocated time to work on this until the end of
Jiang> August.  Due to various delays, the project was not
Jiang> finished in that time frame.  I am no longer working on it.
Jiang> Looking at the CVS branch, I think the following things
Jiang> have to be added before you can get a working version:

Has this work been suspended indefinitely?

Jiang> 1. The work on fixing how TclObject uses Tcl_Obj's
Jiang> reference counting.  

Is this detailed earlier in the mailing list archvies?

 
-Dan


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: merge with aolserver

2000-10-06 Thread Jiang Wu

I had allocated time to work on this until the end of August.  Due to various delays, 
the project was not finished in that time frame.  I am no longer working on it.

Looking at the CVS branch, I think the following things have to be added before you 
can get a working version:

1. The work on fixing how TclObject uses Tcl_Obj's reference counting.
2. The couple of patches I sent out in September, one fixes a core dump in the test 
suite if item 1 is performed, the other fixes a minor problem on startup on Windows.
3. need to alter the Notifier:
a. make per thread Notifier Java object (easily done with a Hashtable)
b. for each Java Notifier, remembers the Tcl C Thread identifier for the thread, 
for which the Notifier is created.
c. replace the platform specific code on how to alert the notifier with 
Tcl_AlertThread().  You can find the platform specific notification code in 
/win/winNotifier.c and /unix/unixNotifier.c

-- Jiang Wu
   [EMAIL PROTECTED]

On Thu, 05 October 2000, Dan Wickstrom wrote:

> 
> I recently merged the code from the ajuba-contract branch with
> nsjava/aolserver and it seems to be work pretty well on linux.
> Operation on solaris machines on the other hand seems to be totally
> hosed with bus-errors occuring at random times during the execution of
> JavaInitBlend at the start of a new thread.  I commented out some of the
> notifier code as it didn't seem to be modified for per/thread
> operation.  I would be interested in finishing up the notifier code
> myself, but I don't have a good understanding of what work remains to be
> done.  Maybe somebody could elaborate for me.
> 
> I've been checking the ajuba-contract branch periodically for a while,
> but I haven't seen any changes in quite a while.  Has worked on this
> stopped, or are the developers just busy with other things.
> 
> -Dan
> 
> 
> 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


--
[EMAIL PROTECTED] is brought to you by 
the Stanford Alumni Association and Critical Path.


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