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

Reply via email to