# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #31032]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=31032 >


After the [perl #31029] this one failure remains in IRIX64 (big-endian,
intval and long size 8, int size 4):

The remaining failure has something to with alignment (or lack
thereof, too, and something to do with keyed access):

./parrot t/pmc/nci_20.pasm
10
Bus error

./parrot -t t/pmc/nci_20.pasm
...
    69 push P2, 0       - P2=PerlArray=PMC(0x10615ae0),
    72 push P2, 0       - P2=PerlArray=PMC(0x10615ae0),
    75 assign P5, P2    - P5=UnManagedStruct=PMC(0x10615e40),
P2=PerlArray=PMC(0x10615ae0)
    78 set I0, P5[0]    - I0=0, P5=UnManagedStruct=PMC(0x10615e40),
    82 print I0         - I0=10
    84 print "\n"
10
    86 set I0, P5[1;0]          - I0=10,
P5=UnManagedStruct=PMC(0x10615e40),
Bus error

and also if in the pasm one comments everything up to but not including
the keyed set (line 36 in the pasm), no sigbus, but if that is included,
sigbus.

Core from signal SIGBUS: Bus error
(dbx) where

Thread 0x10000
>  0 char_offset_key(interpreter = 0x10390248, pmc = 0x10615f00, key =
0x10e17280, type = 0xfffffbfba0)
["/tmp/jhi/parrot/classes/unmanagedstruct.c":182, 0x101eeaa0]
   1 Parrot_UnManagedStruct_get_integer_keyed(interpreter = 0x10390248,
pmc = 0x10615f00, key = 0x10e17280)
["/tmp/jhi/parrot/classes/unmanagedstruct.c":649, 0x101efa6c]
   2 Parrot_set_i_p_kc(cur_opcode = 0x48743d0, interpreter = 0x10390248)
["/tmp/jhi/parrot/ops/set.ops":488, 0x100b6bac]
   3 runops_slow_core(interpreter = 0x10390248, pc = 0x48743d0)
["/tmp/jhi/parrot/src/runops_cores.c":147, 0x10086828]
   4 runops_int(interpreter = 0x10390248, offset = 0)
["/tmp/jhi/parrot/src/interpreter.c":810, 0x10085a18]
   5 runops(interpreter = 0x10390248, offset = 0)
["/tmp/jhi/parrot/src/inter_run.c":69, 0x10083508]
   6 Parrot_runcode(interpreter = 0x10390248, argc = 1, argv =
0xfffffbfe10) ["/tmp/jhi/parrot/src/embed.c":701, 0x100795a0]
   7 Parrot_runcode(interpreter = 0x10390248, argc = 1, argv =
0xfffffbfe10) ["/tmp/jhi/parrot/src/embed.c":635, 0x1007935c]
   8 main(argc = 1, argv = 0xfffffbfe10)
["/tmp/jhi/parrot/imcc/main.c":584, 0x1006f188]
   9 __start()
["/xlv55/kudzu-apr12/work/irix/lib/libc/libc_64_M4/csu/crt1text.s":177,
0x1006d5a8]
(dbx) l
>* 182                  PMC_data(init) = *(void**)p;
   183              }
   184              else {
   185                  /* or just an offset for nested structs */
   186                  PMC_data(init) = p;
   187              }
   188          }
   189          else if (init->vtable->base_type ==
enum_class_ManagedStruct &&
   190              *type == enum_type_struct_ptr) {
   191              /* a nested struct pointer belonging to us
(dbx)

If I edit away the naughty cast (and use just PMC_data(int) = p),
I get further (of course the result is wrong), but then the test falls
with a sigbus later after printing

10
0
63

at:

>  0 ret_float(p = 0x3fffff415c = "\377\377A@", type = -82)
["/tmp/jhi/parrot/classes/unmanagedstruct.c":280, 0x101eed2c]
   1 Parrot_UnManagedStruct_get_number_keyed(interpreter = 0x10390248,
pmc = 0x10615f00, key = 0x10e171c0)
["/tmp/jhi/parrot/classes/unmanagedstruct.c":663, 0x101efb58]
   2 Parrot_set_n_p_kc(cur_opcode = 0x4874450, interpreter = 0x10390248)
["/tmp/jhi/parrot/ops/set.ops":493, 0x100b6d3c]
   3 runops_slow_core(interpreter = 0x10390248, pc = 0x4874450)
["/tmp/jhi/parrot/src/runops_cores.c":147, 0x10086828]
   4 runops_int(interpreter = 0x10390248, offset = 0)
["/tmp/jhi/parrot/src/interpreter.c":810, 0x10085a18]
   5 runops(interpreter = 0x10390248, offset = 0)
["/tmp/jhi/parrot/src/inter_run.c":69, 0x10083508]
   6 Parrot_runcode(interpreter = 0x10390248, argc = 1, argv =
0xfffffbfe10) ["/tmp/jhi/parrot/src/embed.c":701, 0x100795a0]
   7 Parrot_runcode(interpreter = 0x10390248, argc = 1, argv =
0xfffffbfe10) ["/tmp/jhi/parrot/src/embed.c":635, 0x1007935c]
   8 main(argc = 1, argv = 0xfffffbfe10)
["/tmp/jhi/parrot/imcc/main.c":584, 0x1006f188]
   9 __start()
["/xlv55/kudzu-apr12/work/irix/lib/libc/libc_64_M4/csu/crt1text.s":177,
0x1006d5a8]
(dbx) list
>* 280              return (FLOATVAL) *(double*) p;
   281          default:
   282              internal_exception(1, "returning unhandled float
type in struct");
   283      }
   284      return -1.0;
   285  }
   286
   287  /*
   288
   289  =item C<static STRING*

The p is 0x3fffff415c which unaligned for doubles.  It came from
char_offset_int():

   671      int type;
   672      char *p = char_offset_int(interpreter, pmc, key, &type);
   673      return ret_float(p, type);

Sigh.  Enough pointer alignment assumptions for tonight.  I'll leave
something for others or myself when I'm more rested.

-- 
Jarkko Hietaniemi <[EMAIL PROTECTED]> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

Reply via email to