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 "%^$%^$#%^$#%^$%^$#%^$#%^#!!!!!!!!********************** 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
>
----------------------------------------------------------------
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