On Oct 30, 2005, at 4:06 PM, Jonathan Worthington wrote:

"Leopold Toetsch" <[EMAIL PROTECTED]> wrote:

On Oct 27, 2005, at 7:27, Will Coleda (via RT) wrote:


But if I try this from languages/tcl, I get:

../../parrot -o foo.pbc foo.pir
../../parrot -o bar.pbc bar.pir
../../pbc_merge -o whee.pbc foo.pbc bar.pbc

Couldn't load 'tcl_group': unknown reason


Setting a breakpoint at Parrot_load_lib reveals that this a bit nasty. The HLL info is needed to compile loaded types, i.e. that "$P0 = new .TclString" et al works. This syntax should or course work inside PBcs too, which means that at runtime dynamic class libraries have to be loaded in same order as compile-time.

To achieve this the HLL info is created during unpacking PMC constants, which causes loading of the "tcl_group" shared lib. But as pbc_merge is obviously linked with null_config, loading the lib fails.

Changing the link line to use parrot_config should help.

I've done this now - hopefully it works?

Sorry, nope: :(

../../pbc_merge -o lib/tcllib.pbc lib/tcllib_temp.pbc lib/ tclbinaryops.pbc lib/tclcommand.pbc lib/tclcommandlist.pbc lib/ tclconst.pbc lib/tclfunc.pbc lib/tclops.pbc lib/tclvar.pbc lib/ tclword.pbc

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xdeadbeef
0x0011b3e0 in list_pmc_new (interpreter=0xd000f0, container=0x18d9028) at src/list.c:1209
1209        PMC_data(container) = l;
(gdb) bt
#0 0x0011b3e0 in list_pmc_new (interpreter=0xd000f0, container=0x18d9028) at src/list.c:1209 #1 0x001d8b38 in Parrot_Array_init (interpreter=0xd000f0, pmc=0x18d9028) at classes/array.pmc:187 #2 0x00019150 in pmc_new (interpreter=0xd000f0, base_type=42) at src/ pmc.c:47 #3 0x0002dc90 in ft_init (interpreter=0xd000f0, info=0xbffff380) at src/pmc_freeze.c:724 #4 0x0002dd48 in todo_list_init (interpreter=0xd000f0, info=0xbffff380) at src/pmc_freeze.c:753 #5 0x0002eba0 in Parrot_freeze (interpreter=0xd000f0, pmc=0xf5c158) at src/pmc_freeze.c:1575 #6 0x0000d25c in PackFile_Constant_pack (interpreter=0xd000f0, self=0xd93f40, cursor=0x1b2737c) at src/packout.c:246 #7 0x0000d004 in PackFile_ConstTable_pack (interpreter=0xd000f0, seg=0xd8e7f0, cursor=0x1b27378) at src/packout.c:169 #8 0x00008a84 in PackFile_Segment_pack (interpreter=0xd000f0, self=0xd8e7f0, cursor=0x1b15200) at src/packfile.c:1293 #9 0x00009a84 in directory_pack (interpreter=0xd000f0, self=0xd8e630, cursor=0x1b151f0) at src/packfile.c:1688 #10 0x00008a84 in PackFile_Segment_pack (interpreter=0xd000f0, self=0xd8e630, cursor=0x1b05030) at src/packfile.c:1293 #11 0x0000ce38 in PackFile_pack (interpreter=0xd000f0, self=0xd8e630, cursor=0x1b05020) at src/packout.c:106 #12 0x00003c70 in pbc_merge_write (interpreter=0xd000f0, pf=0xd8e630, filename=0xbffff8e0 "lib/tcllib.pbc") at src/pbc_merge.c:664
#13 0x00004008 in main (argc=9, argv=0xbffff818) at src/pbc_merge.c:775
(gdb)

And, there were some errors during the build:

src/pbc_merge.c
src/pbc_merge.c: In function `pbc_merge_bytecode':
src/pbc_merge.c:231: warning: assignment discards qualifiers from pointer target type
src/pbc_merge.c: In function `pbc_merge_debugs':
src/pbc_merge.c:501: warning: suggest parentheses around assignment used as truth value
src/pbc_merge.c: In function `pbc_merge_ctpointers':
src/pbc_merge.c:552: warning: comparison between signed and unsigned
src/pbc_merge.c: In function `main':
src/pbc_merge.c:719: warning: cast discards qualifiers from pointer target type

Getting closer. =-) Thanks.

Better would be to not load the shared lib, if not running inside parrot, as it's AFAIK not needed to load it.


The way that parts of the packfile code assume that you're loading the packfile to run it rather than just to do "stuff" with it was a constant annoyance while writing pbc_merge.

Jonathan


Reply via email to