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


---
osname= darwin
osvers= 7.0
arch=   darwin-thread-multi-2level
cc=     cc 
---
Flags:
    category=core
    severity=critical
    ack=no
---
The following PIR segfaults. However, if you switch the order and call builtin before 
dynamic, it runs smoothly.

  .sub main @MAIN
     $P1 = new PerlHash
     newsub $P0, .Sub, _builtin
     $P1['builtin'] = $P0
     
     $P2 = compreg "PIR"
     $S0 = ".sub main\nprint \"dynamic\\n\"\nend\n.end"
     $P0 = compile $P2, $S0
     $P1['dynamic'] = $P0
     
     store_global "funcs", $P1
     
     $S0 = ".sub main\n$P1 = find_global\"funcs\"\n"
     $S0 .= "$P0 = $P1['dynamic']\n$P0()\n"
     $S0 .= "$P0 = $P1['builtin']\n$P0()\n"
     $S0 .= "end\n.end"
     
     $P2 = compreg "PIR"
     $P0 = compile $P2, $S0
     $P0()
     end
  .end
  
  .sub _builtin
      print "builtin\n"
      .pcc_begin_return
      .pcc_end_return
  .end

--
matt

---
Summary of my parrot 0.1.0 configuration:
  configdate='Wed Sep 15 18:14:17 2004'
  Platform:
    osname=darwin, archname=darwin-thread-multi-2level
    jitcapable=1, jitarchname=ppc-darwin,
    jitosname=DARWIN, jitcpuarch=ppc
    execcapable=1
    perl=perl
  Compiler:
    cc='cc', ccflags='-g -pipe -pipe -fno-common -no-cpp-precomp  -I/usr/local/include 
-pipe -fno-common -Wno-long-double ',
  Linker and Libraries:
    ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags='-L/usr/local/lib 
-flat_namespace ',
    cc_ldflags='',
    libs='-lm'
  Dynamic Linking:
    so='.dylib', ld_shared='-bundle -undefined dynamic_lookup -L/usr/local/lib',
    ld_shared_flags=''
  Types:
    iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
    ptrsize=4, ptr_alignment=1 byteorder=4321, 
    nv=double, numvalsize=8, doublesize=8

---
Environment:
    DYLD_LIBRARY_PATH    HOME    LANG    LANGUAGE    LD_LIBRARY_PATH    LOGDIR    PATH 
   SHELL

Reply via email to