On Sat, Aug 2, 2008 at 11:07 AM, Will Coleda <[EMAIL PROTECTED]> wrote:
> On Sat, Aug 2, 2008 at 11:00 AM, Will Coleda <[EMAIL PROTECTED]> wrote:
>> On Sat, Aug 2, 2008 at 5:00 AM, Allison Randal via RT
>> <[EMAIL PROTECTED]> wrote:
>>> In r29934 of the branch, I can't even get tcl to build, it keeps
>>> complaining about calls to tcl_error_s which it says doesn't exist.
>>> Since you mentioned you were eliminating the versions of tcl_error
>>> identical to 'die', I went through and replaced the calls to tcl_error
>>> with calls to die. It builds now, but some tests are failing because of
>>> empty exception handler messages.
>>>
>>
>> Thanks for the fixup on the tcl_error/die.
>>
>> When I run make test now, the first failure is in t/cmd_cd.t.
>>
>> $ prove -v t/cmd_cd.t
>> t/cmd_cd......
>> 1..3
>> not ok 1 - cd too many args
>>
>> #   Failed test 'cd too many args'
>> #   at t/cmd_cd.t line 16.
>> #          got: ''
>> #     expected: 'wrong # args: should be "cd ?dirName?"
>> # '
>> # '../../parrot  ./tcl.pbc t/cmd_cd_1.tcl' failed with exit code [SIGNAL 11]
>>
>> That is just the tcl "cd a b", so if we just run:
>>
>> $ ../../parrot tcl.pbc -e 'cd a b'
>> Segmentation fault
>>
>> Seems to be the same backtrace as above.
>>
>> Where are the failures you're seeing with empty exception handler
>> messages? I'm consistently seeing segfaults for  the failures, and
>> they all seem to be related to exception handling. (And are these
>> really the same error failing differently?)
>>
>> --
>> Will "Coke" Coleda
>>
>
> If I put in a 'trace 1' immediately before the die in
> runtime/builtin/cd.pir, I see the following:
>
> $ ../../parrot tcl.pbc -
> e 'cd a b'
>  16152 die "wrong # args: should"
>   411 set I6, P9["severity"]           I6=-888 P9=Exception=PMC(0x83fc608)
>   415 eq I6, 6, 58                     I6=2
>   419 set I6, -1                       I6=2
>   422 push_eh 7
>   424 set I6, P9["type"]               I6=-1 P9=Exception=PMC(0x83fc608)
>   428 pop_eh
>   429 eq I6, 60, 18                    I6=61
>   433 eq I6, 59, 27                    I6=61
>   437 set S6, P9["stacktrace"]         S6="tcl.pbc" 
> P9=Exception=PMC(0x83fc608)
>
> --
> Will "Coke" Coleda
>

At a guess, getting an unset hash element there is returning a C NULL,
which I am then concatenating with another string elsewhere, getting
the boom.

Something like:

.sub main :main
 $P1 = new 'Exception'
 $S0 = $P1['barf']
 $S0.="\n"
.end

or

.sub main :main
 push_eh try
   joe()
 pop_eh
 exit 0
 try:
 .get_results($P0,$S0)
 $S1 = $P0['stacktrace']
 $S1 .= "\n"
say $S1
.end

.sub joe
  die 'what'
.end

Committed a fix to tcl in branch (r29940) to pull from the correct
slot. All tests now pass. I'd like to see this segfault/assert/boom
addressed before we merge back, just in case.

-- 
Will "Coke" Coleda

Reply via email to