Ticket #856 (closed bug: fixed)

Opened 5 years ago

Last modified 4 years ago

segfault in pbc_merge

Reported by: jkeenan Owned by: whiteknight
Priority: normal Milestone:
Component: install Version: 1.3.0
Severity: medium Keywords: pbc_merge
Cc: Language: lua
Patch status: Platform:


This ticket was originally created as  RT #50708 in February 2008 by Ryan Voots. It was never fully resolved. I am moving it into the Trac system at this time because the phenomenon described -- trying to run an executable from outside of the build tree -- sounds suspiciously like many of the install-related issues we'be been focusing on in the past month. The language Voots was using in the original instance was Lua -- but the bug may not be limited thereto.

Original description:
When calling pbc_merge outside of the parrot root I encountered a segfault because pbc_merge cannot find lua_group.so, when run inside the parrot root it is able to find the .so inside the runtime directory.

A simple test case of this is to compile these two files to pbc's and then use pbc_merge on them outside the parrot root. I would think either an option to pbc_merge to tell it where to find the parrot runtime, or an envrionment variable might be appropriate, but a check should be made that it can find the needed files to merge and print an error when not found.

-----BEGIN main.pir-----
.HLL 'Lua', 'lua_group'

.sub _main :main
------END main.pir------

-----BEGIN call.pir-----
.sub _testcall
print 42
------END call.pir------

chromatic subsequently reported being unable to reproduce this bug, but Voots provided a backtrace done at r25855:

./pbc_merge -o parmud.pbc hello.pbc sockets.pbc

#0 0x00002b227d6aba6e in memcpy () from /lib/libc.so.6
#1 0x00002b227afad40e in string_make_direct (interp=0x60d010,
buffer=0x2b227b5569c8 "", len=397568, encoding=0x60e8a0,
flags=0) at src/string.c:742
#2 0x00002b227afad307 in string_make (interp=0x60d010,
buffer=0x2b227b5569c8 "", len=397568, charset_name=0x2b227b206d14
flags=0) at src/string.c:691
#3 0x00002b227b07b48d in PF_fetch_string (interp=0x60d010, pf=0x986e70,
cursor=0x8f3188) at src/packfile/pf_items.c:673
#4 0x00002b227b06930f in shift_opcode_string (interp=0x60d010, io=0x986e30)
at src/pmc_freeze.c:802
#5 0x00002b227b176258 in Parrot_Class_thaw (interp=0x60d010, pmc=0x9521e0,
info=0x7fff2fe9db20) at ./src/pmc/class.pmc:1288
#6 0x00002b227b069cd2 in do_thaw (interp=0x60d010, pmc=0x9521e0,
info=0x7fff2fe9db20) at src/pmc_freeze.c:1228
#7 0x00002b227b06a4c5 in visit_todo_list_thaw (interp=0x60d010, old=0x0,
info=0x7fff2fe9db20) at src/pmc_freeze.c:1487
#8 0x00002b227b06a660 in visit_loop_todo_list (interp=0x60d010,
info=0x7fff2fe9db20) at src/pmc_freeze.c:1551
#9 0x00002b227b06a9fa in run_thaw (interp=0x60d010, image=0x8f3168,
what=VISIT_THAW_NORMAL) at src/pmc_freeze.c:1688
#10 0x00002b227b06acf2 in Parrot_thaw (interp=0x60d010, image=0x8f3168)
at src/pmc_freeze.c:1808
#11 0x00002b227b06571a in PackFile_Constant_unpack_pmc (interp=0x60d010,
constt=0x97d200, self=0x986c00, cursor=0x97b028) at src/packfile.c:3492
#12 0x00002b227b065668 in PackFile_Constant_unpack (interp=0x60d010,
constt=0x97d200, self=0x986c00, cursor=0x97af38) at src/packfile.c:3446
#13 0x00002b227b065371 in PackFile_ConstTable_unpack (interp=0x60d010,
seg=0x97d200, cursor=0x97af30) at src/packfile.c:3242
#14 0x00002b227b06257e in PackFile_Segment_unpack (interp=0x60d010,
self=0x97d200, cursor=0x97a5b0) at src/packfile.c:1552
#15 0x00002b227b062b26 in directory_unpack (interp=0x60d010, segp=0x978d30,
cursor=0x97a590) at src/packfile.c:1728
#16 0x00002b227b06257e in PackFile_Segment_unpack (interp=0x60d010,
self=0x978d30, cursor=0x978ff0) at src/packfile.c:1552
#17 0x00002b227b061268 in PackFile_unpack (interp=0x60d010, self=0x978d30,
packed=0x978f90, packed_size=16496) at src/packfile.c:859
#18 0x00000000004016ba in pbc_merge_loadpbc (interp=0x60d010,
fullname=0x7fff2fe9e6bd "hello.pbc") at src/pbc_merge.c:262
#19 0x000000000040297e in main (argc=2, argv=0x7fff2fe9e0b0)
at src/pbc_merge.c:884

... and then commented: while outside of the parrot svnroot, creating a symlink to parrot/runtime in the current directory is a work around (it can then find the lua_group.so)

Change History

Changed 4 years ago by whiteknight

  • owner set to whiteknight

Changed 4 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

This example works fine for me without segfault. In the new Parrot-on-Git world, with an installable Parrot, this does not appear to be an issue any longer. I am going to close this ticket now. If we find specific, reproducible problems on specific platforms we can open new tickets for them.

Note: See TracTickets for help on using tickets.