[perl #58050] Segfault in "make testr" for t/compilers/imcc/syn/hll.t:2
# New Ticket Created by Bob Rogers # Please include the string: [perl #58050] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58050 > It looks like "subclass" is allocating an integer for the new PMC class, but failing to initialize interp->vtables properly (or something). It does not help to mark the ":setup" sub as ":load" in addition to ":immediate" (but logically that ought to be necessary?). -- Bob Rogers http://rgrjr.dyndns.org/ P.S. "testr" just compiles to PBC and runs in an separate parrot image. (I had forgotten.) (gdb) r t/compilers/imcc/syn/hll_2.pbc Starting program: /usr/src/parrot/parrot t/compilers/imcc/syn/hll_2.pbc Failed to read a valid object file image from memory. [Thread debugging using libthread_db enabled] [New Thread -1227610416 (LWP 19242)] warning: Lowest section in /usr/lib/libicudata.so.34 is .hash at 00b4 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1227610416 (LWP 19242)] 0xb7d016c3 in pmc_new (interp=0x8050040, base_type=79) at src/pmc.c:87 (gdb) bt #0 0xb7d016c3 in pmc_new (interp=0x8050040, base_type=79) at src/pmc.c:87 #1 0xb7cd15b3 in Parrot_process_args (interp=0x8050040, st=0xbfb03880, param_or_result=PARROT_PASS_PARAMS) at src/inter_call.c:1370 #2 0xb7cd1a7e in parrot_pass_args (interp=0x8050040, src_ctx=0x8223360, dest_ctx=0x8224888, src_indexes=0xb7b851cc, dest_indexes=0xb7b85208, param_or_result=PARROT_PASS_PARAMS) at src/inter_call.c:1536 #3 0xb7c5fdac in Parrot_get_params_pc (cur_opcode=0xb7b85208, interp=0x8050040) at src/ops/core.ops:581 #4 0xb7d026cc in runops_slow_core (interp=0x8050040, pc=0xb7b85208) at src/runops_cores.c:222 #5 0xb7cd5749 in runops_int (interp=0x8050040, offset=7) at src/interpreter.c:933 #6 0xb7cd6023 in runops (interp=0x8050040, offs=7) at src/inter_run.c:101 #7 0xb7cd62d6 in runops_args (interp=0x8050040, sub=0x82154cc, obj=0x809ea18, meth_unused=0x0, sig=0xb7f35fc7 "vP", ap=0xbfb03a9c "\230S!\bØ:°¿`cþ·\b4\"\b\230S!\bÌT!\bô¯û·Ø:°¿Ò\020ñ·@") at src/inter_run.c:223 #8 0xb7cd640c in Parrot_runops_fromc_args (interp=0x8050040, sub=0x82154cc, sig=0xb7f35fc7 "vP") at src/inter_run.c:295 #9 0xb7cbf4c7 in Parrot_runcode (interp=0x8050040, argc=1, argv=0xbfb03c08) at src/embed.c:951 #10 0xb7f110d2 in imcc_run_pbc (interp=0x8050040, obj_file=0, output_file=0x0, argc=1, argv=0xbfb03c08) at compilers/imcc/main.c:783 #11 0xb7f11b82 in imcc_run (interp=0x8050040, sourcefile=0xbfb04350 "t/compilers/imcc/syn/hll_2.pbc", argc=1, argv=0xbfb03c08) at compilers/imcc/main.c:1071 #12 0x08048998 in main (argc=1, argv=0xbfb03c08) at src/main.c:61 (gdb) p interp $1 = (Parrot_Interp) 0x8050040 (gdb) p interp->vtables $2 = (VTABLE **) 0x80731d8 (gdb) p interp->vtables->[base_type] A syntax error in expression, near `[base_type]'. (gdb) p interp->vtables[base_type] $3 = (VTABLE *) 0x0 (gdb)
[perl #58070] [PROPOSAL] Disallow .local declarations in long-style call statement
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58070] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58070 > the current implementation for PIR allows one to declare .locals in a .begin_call/.end_call sequence, after the .call directive, like so: .begin_call .arg 1 .arg 2 .call $P0 .local int a, b, c .result a .result b .result c .end_call (this is short for (a, b, c) = $P0(1, 2) ) IMHO, the whole sequence of directives from .begin_call to .end_call should be considered 1 statement; having .local declarations intermixed with .result directives is a bit strange, because the .local directive itself is not part of the sequence of directives to make the call. Furthermore, the locals stay in scope after the .end_call directive. I propose to disallow this language 'feature', and force the programmer to write the above example as follows: .local int a, b, c .begin_call .arg 1 .arg 2 .call $P0 .result a .result b .result c .end_call comments welcome. kjs
[perl #58068] [TODO] document PAST's :scope('register')
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58068] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58068 > r30260 adds the 'register' scope to PAST::Var. This value for :scope should be documented in pdd26_ast.pod. Preferably also in the source file of PAST/nodes. thanks, kjs
[perl #58076] Configure tests fail with "Can't store CODE items"
# New Ticket Created by Andy Dougherty # Please include the string: [perl #58076] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58076 > A number of Configure tests are faililng for me on Solaris 8/SPARC. Specifically, I see: Failed TestStat Wstat Total Fail List of Failed --- t/steps/auto_snprintf-01.t 255 6528038 34 22-38 t/steps/auto_warnings-01.t 255 6528056 80 17-56 t/steps/inter_progs-01.t255 6528044 56 17-44 All of these fail in the same way. Here's an example: prove -v t/steps/auto_snprintf-01.t t/steps/auto_snprintf-011..38 ok 1 - use config::init::defaults; ok 2 - use config::init::hints; ok 3 - use config::auto::attributes; ok 4 - use config::auto::aio; ok 5 - use config::auto::snprintf; ok 6 - init::defaults constructor returned defined value ok 7 - The object isa init::defaults ok 8 - init::defaults has description ok 9 - init::defaults runstep() returned defined value ok 10 - init::hints constructor returned defined value ok 11 - The object isa init::hints ok 12 - init::hints has description ok 13 - init::hints runstep() returned defined value ok 14 - auto::attributes constructor returned defined value ok 15 - The object isa auto::attributes ok 16 - auto::attributes has description ok 17 - auto::attributes runstep() returned defined value ok 18 - auto::aio constructor returned defined value ok 19 - The object isa auto::aio ok 20 - auto::aio has description ok 21 - auto::aio runstep() returned defined value Can't store CODE items at ../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_freeze.al) line 339, at lib/Parrot/Configure.pm line 509 # Looks like you planned 38 tests but only ran 21. # Looks like your test died just after 21. dubious Test returned status 255 (wstat 65280, 0xff00) DIED. FAILED tests 22-38 Failed 17/38 tests, 55.26% okay Failed TestStat Wstat Total Fail List of Failed --- t/steps/auto_snprintf-01.t 255 6528038 34 22-38 Failed 1/1 test scripts. 17/38 subtests failed. Files=1, Tests=38, 9 wallclock secs ( 2.95 cusr + 2.62 csys = 5.57 CPU) Failed 1/1 test programs. 17/38 subtests failed. The problem is that the solaris hints file uses 'triggers' and the configure tests can't handle them. This can be reproduced on any operating system by introducing a simple 'trigger' in the appropriate hints file (see config/init/hints/solaris.pm for examples). -- Andy Dougherty [EMAIL PROTECTED]
[perl #58078] [PATCH] PLATFORMS update for Solaris 8 (August 2008)
# New Ticket Created by Andy Dougherty # Please include the string: [perl #58078] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58078 > This patch updates the current status for me on Solaris 8. Nearly all of the failures are in the configure tests. See [perl #58076]. Solaris/gcc is still failing the op/trans test as it has for years. Details are in the config/init/hints/solaris.pm file. --- parrot-current/PLATFORMS2008-08-18 08:29:19.0 -0400 +++ parrot-andy/PLATFORMS 2008-08-18 12:57:40.0 -0400 @@ -35,8 +35,8 @@ linux-x86_64-gcc4.1.0 4 Y-- Y Y YY/2 ? 20060807 linux-x86_64-gcc4.1.2 8 Y-- Y Y YY ? 20080220 openbsd-zaurus-gcc3.3.5 Y-- Y Y Y? ? 20070309 -sol8-sparc-ccB--- - - -Y/1 ? 20080401 -sol8-sparc-gcc_4.1.0 B--- - - -Y/77 ? 20080401 +sol8-sparc-ccB--- - - -Y/85 ? 20080818 +sol8-sparc-gcc_4.1.0 B--- - - -Y/87 ? 20080818 sol10-sparc-cc_5.8 BY-- Y Y YY/9 ? 20060807 sol10-sparc-cc_5.9 B4*4 Y-- Y Y YY ? 20080510 sol10-sparc-cc_5.9 B8 Y-- Y Y YY/2 ? 20080518 -- Andy Dougherty [EMAIL PROTECTED]
[perl #58088] [PATCH] [pdd27mmd] Rename Parrot_mmd_sort_candidate_list
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #58088] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58088 > According to http://www.perlfoundation.org/parrot/index.cgi?pdd27mmd_tasklist the function src/multidispatch.c:Parrot_mmd_sort_candidate_list should be renamed to Parrot_mmd_sort_manhattan. This patch does exactly that, renaming all instances of the first to the second. This includes source code files, header files, and the PDD27 itself. --Andrew Whitworth Index: src/multidispatch.c === --- src/multidispatch.c (revision 30314) +++ src/multidispatch.c (working copy) @@ -1100,7 +1100,7 @@ /* -=item C +=item C Given an array PMC (usually a MultiSub) sort the mmd candidates by their manhatten distance to the current args. @@ -1113,7 +1113,7 @@ PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT PMC * -Parrot_mmd_sort_candidate_list(PARROT_INTERP, ARGIN(PMC *candidates)) +Parrot_mmd_sort_manhattan(PARROT_INTERP, ARGIN(PMC *candidates)) { PMC *arg_tuple; INTVAL n = VTABLE_elements(interp, candidates); Index: src/pmc/multisub.pmc === --- src/pmc/multisub.pmc (revision 30314) +++ src/pmc/multisub.pmc (working copy) @@ -60,7 +60,7 @@ } VTABLE opcode_t *invoke(void *next) { -PMC * const list = Parrot_mmd_sort_candidate_list(interp, SELF); +PMC * const list = Parrot_mmd_sort_manhattan(interp, SELF); PMC *func; if (PMC_IS_NULL(list)) Index: docs/pdds/pdd27_multiple_dispatch.pod === --- docs/pdds/pdd27_multiple_dispatch.pod (revision 30314) +++ docs/pdds/pdd27_multiple_dispatch.pod (working copy) @@ -93,7 +93,7 @@ =item invoke Invoke the best matching candidate for the current call arguments. This vtable -function calls C from the public MMD API, but +function calls C from the public MMD API, but may be changed to call C. =item set_integer_keyed_int, set_number_keyed_int, set_string_keyed_int @@ -140,7 +140,7 @@ =over 4 -=item Parrot_mmd_sort_candidate_list +=item Parrot_mmd_sort_manhattan Performs a multiple dispatch lookup on an array of subroutines. The call signature to match is pulled from the current interpreter, following the Index: include/parrot/multidispatch.h === --- include/parrot/multidispatch.h (revision 30314) +++ include/parrot/multidispatch.h (working copy) @@ -214,7 +214,7 @@ PARROT_API PARROT_CAN_RETURN_NULL PARROT_WARN_UNUSED_RESULT -PMC * Parrot_mmd_sort_candidate_list(PARROT_INTERP, ARGIN(PMC *candidates)) +PMC * Parrot_mmd_sort_manhattan(PARROT_INTERP, ARGIN(PMC *candidates)) __attribute__nonnull__(1) __attribute__nonnull__(2);
[perl #58090] [PATCH] [pdd27mmd] Deprecate mmd_create_builtin_multi_meth_2
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #58090] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58090 > The attached patch deprecates the function src/multidispatch.c:mmd_creatE_builtin_multi_meth_2, and folds all the functionality from that into the mmd_create_builtin_multi_meth function instead. The former was just a tail call to the later, and the later was not called from anywhere else in the codebase that I could find. This patch is probably dependent on #58088, or it might not apply cleanly. --Andrew Whitworth Index: src/multidispatch.c === --- src/multidispatch.c (revision 30314) +++ src/multidispatch.c (working copy) @@ -89,15 +89,6 @@ __attribute__nonnull__(2) __attribute__nonnull__(4); -static void Parrot_mmd_create_builtin_multi_meth_2(PARROT_INTERP, -ARGIN(PMC *ns), -INTVAL func_nr, -INTVAL type, -INTVAL right, -funcptr_t func_ptr) -__attribute__nonnull__(1) -__attribute__nonnull__(2); - PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT static PMC* Parrot_mmd_cvt_to_types(PARROT_INTERP, ARGIN(PMC *multi_sig)) @@ -1896,7 +1887,7 @@ /* -=item C +=item C RT #48260: Not yet documented!!! @@ -1905,11 +1896,14 @@ */ static void -mmd_create_builtin_multi_meth_2(PARROT_INTERP, ARGIN(PMC *ns), -INTVAL func_nr, INTVAL type, INTVAL right, funcptr_t func_ptr) +mmd_create_builtin_multi_meth(PARROT_INTERP, ARGIN(PMC *ns), INTVAL type, +ARGIN(const MMD_init *entry)) { const char *short_name; char signature[6], val_sig; +INTVAL func_nr = entry->func_nr; +INTVAL right = entry->right; +funcptr_t func_ptr = entry->func_ptr; STRING *meth_name; PMC *method, *multi, *_class, *multi_sig; @@ -1998,28 +1992,8 @@ VTABLE_push_pmc(interp, multi, method); } - /* -=item C - -RT #48260: Not yet documented!!! - -=cut - -*/ - -static void -mmd_create_builtin_multi_meth(PARROT_INTERP, ARGIN(PMC *ns), INTVAL type, -ARGIN(const MMD_init *entry)) -{ -mmd_create_builtin_multi_meth_2(interp, ns, -entry->func_nr, type, entry->right, entry->func_ptr); -} - - -/* - =item C Register MMD functions for this PMC type.
[perl #58108] [BUILD] languages/Makefile 'test' target has too many deps
# New Ticket Created by Will Coleda # Please include the string: [perl #58108] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58108 > The 'test' target in languages/Makefile depends on building -all- the languages, not just those that languages/t/harness tests. We should probably be keeping the list of testable languages in the Makefile so we can avoid building things unnecessarily, and we should also probably avoid keeping this list duplicated in t/harness. -- Will "Coke" Coleda
[perl #58176] [PATCH] dotnet exceptions
# New Ticket Created by Reini Urban # Please include the string: [perl #58176] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58176 > --- osname= cygwin osvers= 1.5.25(0.15642) arch= cygwin-thread-multi-64int cc= gcc --- Flags: category=languages severity=high ack=no --- make dotnet work with the new exceptions. I'm not sure how to return the jump_point correctly, but it looks fine. --- Summary of my parrot 0.7.0 (r0) configuration: configdate='Wed Aug 20 18:34:46 2008 GMT' Platform: osname=cygwin, archname=cygwin-thread-multi-64int jitcapable=1, jitarchname=i386-cygwin, jitosname=CYGWIN, jitcpuarch=i386 execcapable=1 perl=/usr/bin/perl.exe Compiler: cc='gcc', ccflags='-U__STRICT_ANSI__ -pipe -I/usr/local/include -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wno-missing-format-attribute -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O3 -DHAS_GETTEXT', Linker and Libraries: ld='gcc', ldflags=' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base ', cc_ldflags='', libs='-L/usr/local/lib -lcrypt -lgmp -lreadline -lpcre -lglut32 -lglu32 -lopengl32 -lcrypto -lintl' Dynamic Linking: share_ext='.dll', ld_share_flags='-shared', load_ext='.dll', ld_load_flags='-shared' Types: iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=1 byteorder=1234, nv=double, numvalsize=8, doublesize=8 Locally applied patches: [perl #39742] [BUG] installed conflict [perl #51944] [DOCS] Cygwin Readme [perl #56544] [PATCH] install_files.pl [perl #56998] [PATCH] rename cygwin dll to cygparrot$MAJ_$MIN_$P.dll [perl #57006] [PATCH] add cygwin opengl config quirks [perl #56554] [TODO] make install -C languages [perl #58034] [TODO] config_args [perl #56996] [TODO] FHS runtime paths --- Environment: CYGWIN =server HOME =/home/rurban LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH =~/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/usr/bin:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Programme/ATI Technologies/ATI.ACE/Core-Static:/usr/local/bin:/usr/lib/gstreamer-0.8:/usr/lib/lapack SHELL (unset) Index: parrot-svn/languages/dotnet/ops/dotnet.ops === --- parrot-svn.orig/languages/dotnet/ops/dotnet.ops +++ parrot-svn/languages/dotnet/ops/dotnet.ops @@ -88,7 +88,10 @@ static opcode_t* dotnet_OverflowExceptio PMC *ex_pmc = pmc_new(interp, enum_class_Exception); VTABLE_set_string_native(interp, ex_pmc, string_from_literal(interp, "System.OverflowException")); -return (opcode_t *)throw_exception(interp, ex_pmc, ret); +VTABLE_set_integer_keyed_str(interp, ex_pmc, +"severity", EXCEPT_error); +Parrot_ex_throw_from_c(interp, ex_pmc); +return ret; } Index: parrot-svn/languages/dotnet/pmc/dotnetassembly.pmc === --- parrot-svn.orig/languages/dotnet/pmc/dotnetassembly.pmc +++ parrot-svn/languages/dotnet/pmc/dotnetassembly.pmc @@ -1848,7 +1848,7 @@ pmclass DotNetAssembly dynpmc group dotn free(filename); if (!in) -Parrot_ex_throw_from_c_args(INTERP, NULL, E_IOError, +Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_PIO_ERROR, "Unable to open file %s", filename); /* Attempt to load the PE parts of the file; this locates the CLI @@ -2184,12 +2184,9 @@ pmclass DotNetAssembly dynpmc group dotn /* If we don't have an assembly or nothing is loaded, throw an exception and leave. */ -if (ass == NULL || ass->loaded == 0) -{ -EXCEPTION_INVALID_OPERATION(INTERP, NULL, INVAL
[perl #58170] Exception Handler Issues
# New Ticket Created by Stephen Weeks # Please include the string: [perl #58170] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58170 > There are some issues that need to be resolved for resumable exceptions. The first issue I've run into is that Parrot_cx_find_handler_local marks the exception handler as used when it finds it and ignores already-used exception handlers. The following PIR fails: .sub main :main say "start" push_eh handler $P0 = new 'Exception' $P0 = "Exception 1" throw $P0 $P0 = new 'Exception' $P0 = "Exception 2" throw $P0 pop_eh say "end" exit 0 handler: .local pmc exception .local string message .local pmc continuation .get_results(exception,message) continuation = exception['retcont'] print "handled exception: " say message continuation() .end Parrot_cx_find_handler_local uses an iterator for handlers for Exceptions, but just walks all the handlers ignoring used ones for everything else. It looks like maybe if everything stored their handlers in an iterator, as the comment suggest is possible, we could discard the used check? A few experiments into this turn up segfaults and other odd behavior. Maybe we need to have a 'cleanup' function for exception handlers to call instead?
[perl #58188] [TODO] Parrot_find_encoding_converter
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #58188] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58188 > The function src/encoding.c:Parrot_find_encoding_converter is a stub with the note "XXX: Apparently unwritten". This probably needs to be documented. I've updated the function to throw an exception stating that it isn't implemented. --Andrew Whitworth
[perl #58184] [TODO] Cannot load charsets
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #58184] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58184 > The function src/charset.c:Parrot_load_charset is basically an empty stub, and does nothing except throw an exception saying that we can't load charsets yet. I assume this has to be implemented, eventually. --Andrew Whitworth
[perl #58186] [TODO] Cannot load encodings
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #58186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58186 > The function src/encoding.c:Parrot_load_encoding currently does nothing except throw an exception to say that it does nothing. This probably needs to be implemented eventually. --Andrew Whitworth
[perl #58250] [TODO] Generate callgrind output
# New Ticket Created by Will Coleda # Please include the string: [perl #58250] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58250 > Provide a mechanism (for example, compiling with -DPARROT_CALLGRIND)[1], that forces each Sub invocation to be reported in a standard callgrind output (http://valgrind.org/docs/manual/cl-format.html). Future bonus points for providing similar support for opcodes (probably replacing the -p option). Double future super bonus points for combining the output of the C-level callgrind output (available from valgrind) with the parrot sub and opcode information into a single report. [1] chromatic's original suggestion was an alternate runcore. I think this suggestion makes more sense since we want this for more than opcode dispatch, but I could be wrong. -- Will "Coke" Coleda
[perl #58236] [TODO][PDD19] make decision on open issue on .return directive in pdd19
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58236] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58236 > PDD19, line 791 reads: The parentheses surrounding the arguments are mandatory. Besides making sequence break more conspicuous, this is necessary to distinguish this syntax from other uses of the C<.return> directive that will be probably deprecated. The open issue of the 'probably deprecation' should be decided on; what .return directive is meant here that supposedly would be deprecated? Will it? (any need?) kjs
[perl #58252] [TODO][PIR] finalize open issue with "pmc" type in .const definitions
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58252] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58252 > The following issues are not entirely clear from PDD19: [1] according to PDD19 (PIR) you can declare a .const as follows: =item .const = Define a constant named I of type I and assign value I to it. The I may be either an integer value or a string constant. The constant is stored in the constant table of the current bytecode file. stands for "int", "num", "string" or "pmc". However, writing "pmc" does not make any sense, because must be some literal constant, such as 42, 3.14 or "hello"; it doesn't make sense to write: .const pmc x = "hi" # what type will x be? THerefore, should we allow "pmc" as a type here? I see 2 reasonable solutions: 1: disallow "pmc" altogether 2: based on the type of the constant (int-constant, num-constant or string constant), make the variable (eh, constant) a constant of one of the standard types (Integer, Float or String , respectively). [2] you can declare a .const using a PMC class type id: .const .Sub x = "foo" AFAIU, type ids will be removed altogether (is this true?). If so, then the above would be invalid. Instead, we might allow for writing: .const "Sub" x = "foo". Which seems a nice enough solution, but this solution is rather limited, in that you can't create, for instance, an Array constant: .const "Array" a = "foo" # doesn't make sense. I know the creation of Sub constants is useful, so we definitely should keep something like this around. I see the following solutions: 1: only allow pmc types that are reasonable: - .const "Integer" x = 42 - .const "Float" PI = 3.14 - .const "String" message = "hi there" - .const "Sub" x = "foo" and report an error message if you would do something weird as ".const 'Env' e = 10". 2: extend syntax for other variants, for instance, to initialize arrays and hashtables: - .const "Array" a = (1, 2, 3, 4) # creates a constant array with 4 elements, nrs 1 to 4 - .const "Hash" h1 = {"x"=>42, "y"=>10} ## using syntactic sugar form that is used for named arguments as well - .const "Hash" h2 = { 42 :named("x"), 10 :named("y") } ## to be consistent with the above, using syntax well-known in named-arguments. Not sure if this would be helpful/possible, but just some thoughts. comments welcome. kjs
[perl #58238] [PROPOSAL][PIR] remove special handling of "addr" -> set_addr instruction mapping
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58238] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58238 > Parrot has an instruction called 'set_addr', that stores the address of a label into an integer register. IMCC (and pdd19_pir) defines a short-cut for this op, called 'addr'. $I0 = addr XYZ I propose to remove this shortcut; should anybody want to use it, just use the full opname: $I0 = set_addr XYZ (or, which may look a bit better: set_addr $I0, XYZ) The rationale behind this proposal is as follows: * This instruction is specially handled in the PIR compiler (IMCC). It is true that IMCC needs to handle certain ops as a special case, where PASM and PIR overlap; for instance, the 'if' op. No such overlap is present for 'addr'. Having special cases is fine if it's necessary, but otherwise it makes the code more complex. The rationale for having a special case for this instruction might lie in the far history of Parrot; I seem to remember, years ago, that one needed addresses to make sub calls. My memory may be wrong, though. Having a special case for a much-used feature is, according to the Huffman coding design principle, a good thing: make things that happen frequently easier/shorter; but: (reason 2) * A quick ack told me that this instruction is barely used, if any (did not do any detailed inspection, though). comments welcome, as always. kjs
[perl #58270] make fails @ src/null_config.c:29 on linux
# New Ticket Created by Stephen Simmons # Please include the string: [perl #58270] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58270 > [Note: this is a cut and paste from ./parrotbug ... SMTP is not configured on my machine] --- osname= linux osvers= 2.6.9-22.18.bz155725.elsmp arch= x86_64-linux-thread-multi cc= gcc --- Flags: category=install severity=critical ack=no --- make failed on the following compilation, on revisions 30353 and 30457 (and a couple of others in between). Additional information follows this output listing. -- gcc -o miniparrot src/main.o src/null_config.o \ -Wl,-rpath=/users/ssimmons/parrot/blib/lib -L/users/ssimmons/parrot/blib/lib -lparrot -lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lncurses -lcrypto -Wl,-E src/main.o(.text+0x39): In function `main': src/main.c:52: undefined reference to `Parrot_new' src/main.o(.text+0x46):src/main.c:53: undefined reference to `imcc_initialize' src/main.o(.text+0x5b):src/main.c:58: undefined reference to `string_from_cstring' src/main.o(.text+0x67):src/main.c:58: undefined reference to `Parrot_set_executable_name' src/main.o(.text+0x78):src/main.c:60: undefined reference to `parseflags' src/main.o(.text+0x90):src/main.c:61: undefined reference to `imcc_run' src/main.o(.text+0x9c):src/main.c:65: undefined reference to `Parrot_destroy' src/main.o(.text+0xaa):src/main.c:66: undefined reference to `Parrot_exit' src/null_config.o(.text+0x11): In function `Parrot_set_config_hash': src/null_config.c:29: undefined reference to `Parrot_set_config_hash_internal' collect2: ld returned 1 exit status make: *** [miniparrot] Error 1 -- $ cat /etc/redhat-release Red Hat Enterprise Linux WS release 4 (Nahant Update 4) $ uname -a Linux lx-ssimmons.cdc.maxim-ic.com 2.6.9-42.0.10.ELsmp #1 SMP Fri Feb 16 17:13:42 EST 2007 x86_64 x86_64 x86_64 GNU/Linux $ gcc -v Reading specs from /usr/lib/gcc/x86_64-redhat-linux/3.4.6/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-java-awt=gtk --host=x86_64-redhat-linux Thread model: posix gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) Note: I am not the administrator on this system, so I am unlikely to be able to change any of these versions in the short term, but I note that this combination is not listed in PLATFORMS. Also, I have been successful in building parrot on Darwin, so hopefully it isn't a user error :-) Stephen Simmons --- Summary of my parrot 0.7.0 (r30457) configuration: configdate='Fri Aug 22 20:48:53 2008 GMT' Platform: osname=linux, archname=x86_64-linux-thread-multi jitcapable=0, jitarchname=nojit, jitosname=linux, jitcpuarch=amd64 execcapable=0 perl=/usr/bin/perl Compiler: cc='gcc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wno-missing-format-attribute -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT', Linker and Libraries: ld='gcc', ldflags='', cc_ldflags='', libs='-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lncurses -lcrypto ' Dynamic Linking: share_ext='.so', ld_share_flags='-shared -fPIC', load_ext='.so', ld_load_flags='-shared -fPIC' Types: iv=long, intvalsize=8, intsize=4, opcode_t=long, opcode_t_size=8, ptrsize=8, ptr_alignment=1 byteorder=12345678, nv=double, numvalsize=8, doublesize=8 --- Environment: HOME =/users/ssimmons LANG =en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH =/import/vnetest/swrep/packages/gcc-3.2.3/lib:/import/vnetest/swrep/releases/2003.6/lib:/import/vnetest/swrep/releases/2003.6/qt/lib:/import/vnetest/swrep/packages/gcc-3.2.3/lib:/import/vnetest/swrep/releases/2003.6/lib:/import/vnetest/swrep/release
[perl #58296] [BUG]: compilers/ncigen: Many coding standards error after recent commits
# New Ticket Created by James Keenan # Please include the string: [perl #58296] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58296 > I've spent several hours this morning trying to fix failing coding standards tests. Most of these failures occur in files in compilers/ ncigen/; I believe they may have resulted from the merge done in r30452. I've cleaned up a lot of these, but many still remain. See attached. t/codingstd/c_indent...1/2 # Failed test 'Correctly indented preprocessor directives' # at t/codingstd/c_indent.t line 213. # incorrect indenting in preprocessor directive found 47 occurrences in 1 files: # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:16 # got: #define SPI_Hexpected: # define SPI_H -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:22 # got: #include "postgres.h"expected: # include "postgres.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:28 # got: #include "access/heapam.h"expected: # include "access/heapam.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:29 # got: #include "access/xact.h"expected: # include "access/xact.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:30 # got: #include "catalog/pg_language.h"expected: # include "catalog/pg_language.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:31 # got: #include "catalog/pg_proc.h"expected: # include "catalog/pg_proc.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:32 # got: #include "catalog/pg_type.h"expected: # include "catalog/pg_type.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:33 # got: #include "executor/execdefs.h"expected: # include "executor/execdefs.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:34 # got: #include "executor/executor.h"expected: # include "executor/executor.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:35 # got: #include "nodes/execnodes.h"expected: # include "nodes/execnodes.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:36 # got: #include "nodes/params.h"expected: # include "nodes/params.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:37 # got: #include "nodes/parsenodes.h"expected: # include "nodes/parsenodes.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:38 # got: #include "nodes/plannodes.h"expected: # include "nodes/plannodes.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:39 # got: #include "nodes/primnodes.h"expected: # include "nodes/primnodes.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:40 # got: #include "nodes/relation.h"expected: # include "nodes/relation.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:41 # got: #include "tcop/dest.h"expected: # include "tcop/dest.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:42 # got: #include "tcop/pquery.h"expected: # include "tcop/pquery.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:43 # got: #include "tcop/tcopprot.h"expected: # include "tcop/tcopprot.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:44 # got: #include "tcop/utility.h"expected: # include "tcop/utility.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:45 # got: #include "utils/builtins.h"expected: # include "utils/builtins.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:46 # got: #include "utils/datum.h"expected: # include "utils/datum.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:47 # got: #include "utils/portal.h"expected: # include "utils/portal.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:48 # got: #include "utils/syscache.h"expected: # include "utils/syscache.h" -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:63 # got: #define SPI_ERROR_CONNECT(-1)expected: # define SPI_ERROR_CONNECT(-1) -- it's inside of #ifndef SPI_H # /home/jimk/work/formergeops/compilers/ncigen/t/spi.c:64 # got: #define SPI_ERROR_COPY(-2)expected: # define SPI_ERROR_COPY(-2) -- it's inside of #ifndef SPI_H # /home/jimk/wor
[perl #58308] [PATCH] Implementation fo string_str_rindex and rindex op.
# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #58308] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58308 > Hello. There is almost copy-pasted version of rindex. -- Bacek. commit e23d65f77c2e0963d5647a9ccf585c6484c8323b Author: Vasily Chekalkin <[EMAIL PROTECTED](none)> Date: Sun Aug 24 20:40:35 2008 +1000 Implement op rindex diff --git a/src/ops/ops.num b/src/ops/ops.num index 24e25fb..18329c8 100644 --- a/src/ops/ops.num +++ b/src/ops/ops.num @@ -1224,3 +1224,16 @@ stm_commit_ic 1193 stm_wait_ic1194 stm_abort 1195 stm_depth_i1196 +rindex_i_s_s 1197 +rindex_i_sc_s 1198 +rindex_i_s_sc 1199 +rindex_i_sc_sc 1200 +rindex_i_s_s_i 1201 +rindex_i_sc_s_i1202 +rindex_i_s_sc_i1203 +rindex_i_sc_sc_i 1204 +rindex_i_s_s_ic1205 +rindex_i_sc_s_ic 1206 +rindex_i_s_sc_ic 1207 +rindex_i_sc_sc_ic 1208 + diff --git a/src/ops/string.ops b/src/ops/string.ops index 066186b..bf483cb 100644 --- a/src/ops/string.ops +++ b/src/ops/string.ops @@ -273,6 +273,29 @@ inline op index(out INT, in STR, in STR, in INT) :base_core { } +=item B(out INT, in STR, in STR) + +=item B(out INT, in STR, in STR, in INT) + +The B function searches for a substring within target string, but +without the wildcard-like behavior of a full regular-expression pattern match. +It returns the position of the last occurrence of substring $3 +in target string $2 at or after zero-based position $4. +If $4 is omitted, B starts searching from the beginning of the string. +The return value is based at "0". +If the string is null, or the substring is not found or is null, +B returns "-1". + +=cut + +inline op rindex(out INT, in STR, in STR) :base_core { +$1 = ($2 && $3) ? string_str_rindex(interp, $2, $3, 0) : -1; +} + +inline op rindex(out INT, in STR, in STR, in INT) :base_core { +$1 = ($2 && $3) ? string_str_rindex(interp, $2, $3, $4) : -1; +} + =item B(out STR, in STR, invar PMC) =item B(out PMC, invar PMC, invar PMC) commit bbd7144bee1648f4516d61a98b48177b1370fe78 Author: Vasily Chekalkin <[EMAIL PROTECTED](none)> Date: Sun Aug 24 20:51:41 2008 +1000 Implement rindex diff --git a/languages/perl6/src/builtins/any-str.pir b/languages/perl6/src/builtins/any-str.pir index 77bb24c..84a62c6 100644 --- a/languages/perl6/src/builtins/any-str.pir +++ b/languages/perl6/src/builtins/any-str.pir @@ -21,7 +21,7 @@ the size of that file down and to emphasize their generic, .namespace [] .sub 'onload' :anon :init :load $P0 = get_hll_namespace ['Any'] -'!EXPORT'('chars index substr', 'from'=>$P0) +'!EXPORT'('chars index rindex substr', 'from'=>$P0) .end @@ -75,6 +75,44 @@ the size of that file down and to emphasize their generic, .return ($P0) .end +=item rindex() + +=cut + +.namespace ['Any'] +.sub 'rindex' :method :multi(_) +.param string substring +.param int pos :optional +.param int has_pos :opt_flag +.local pmc retv + +if has_pos goto have_pos +pos = 0 + have_pos: + +.local string s +s = self + + check_substring: +if substring goto substring_search +$I0 = length s +if pos < $I0 goto done +pos = $I0 +goto done + + substring_search: +pos = rindex s, substring, pos +if pos < 0 goto fail + + done: +$P0 = new 'Int' +$P0 = pos +.return ($P0) + + fail: +$P0 = new 'Failure' +.return ($P0) +.end =item substr() =cut
[perl #58358] parrot_debugger - Undefined com mand: "ñì¶ñì¶"
# New Ticket Created by Will Coleda # Please include the string: [perl #58358] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58358 > Hitting enter immediately after successfully starting the debugger throws an error. $ cat foo.pir .sub main say 'hi' .end $ ./parrot_debugger foo.pir Parrot 0.7.0-devel Debugger Please note: the debugger is currently under reconstruction (pdb) Undefined command: "ñì¶ñì¶". Try "help". (pdb) -- Will "Coke" Coleda
[perl #58362] [BUG] can't set Env PMC values with non-keyed opcodes
# New Ticket Created by Jeff Horwitz # Please include the string: [perl #58362] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58362 > rakudo cannot write to %*ENV because the underlying Env PMC apparently does not update the environment when using a non-keyed opcode: fail code from pmichaud: $ cat y.pir .sub 'main' :main .local pmc env, foo env = new 'Env' foo = new 'String' foo = 'abc' env['foo'] = foo $P1 = env['foo'] say $P1 foo = 'def' $P1 = env['foo'] say $P1 .end $ ./parrot y.pir abc abc $ the trace output makes the different opcodes more obvious, at least to me: 0 new P2, "Env"P2=PMCNULL 3 new P1, "String" P1=PMCNULL 6 set P1, "abc"P1=String=PMC(0x82141c4 Str:"") 9 set P2["foo"], P1P2=Env=PMC(0x81fd8f8) P1=String=PMC(0x82141c4 Str:"abc") 13 set P0, P2["foo"]P0=PMCNULL P2=Env=PMC(0x81fd8f8) 17 say P0 P0=String=PMC(0x82141a8 Str:"abc") abc 19 set P1, "def"P1=String=PMC(0x82141c4 Str:"abc") 22 set P0, P2["foo"]P0=String=PMC(0x82141a8 Str:"abc") P2=Env=PMC(0x81fd8f8) 26 say P0 P0=String=PMC(0x821418c Str:"abc") abc 28 end
[perl #58374] [TODO][PDD19] Decide on maximum identifier length and implement this.
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58374] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58374 > >From PDD19: Identifiers don't have any limit on length at the moment, but some sane-but-generous length limit may be imposed in the future (256 chars, 1024 chars?). A decision on this must be made, and this must be implemented in the PIR lexer. (I think 64 chars. might be enough as well; who's using longer names than that?) kjs
[perl #58414] [TODO] review calling conventions
# New Ticket Created by Allison Randal # Please include the string: [perl #58414] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58414 > Briefly discussed in a phone call with Patrick, Jerry, and chromatic: Our calling conventions have grown in an organic fashion over the past few years, and they're showing some signs of cruft. The current design and implementation could use a consistency review. Among the topics for review: - VTABLE_invoke is inconsistent between different sub-like PMCs. For most subs it simply sets up the environment for invocation, and selects the first opcode instruction of the sub as the next 'opcode_t *' for 'runops'. For NCI subs it actually invokes the function pointer. The disjoint means that NCI subs can't be invoked from C argument lists the same way as all the other subs (because the regular C argument list passing can only happen *after* VTABLE_invoke has been called to set up the environment, but NCI requires the arguments to be passed *before* the call to VTABLE_invoke). - Also, VTABLE_invoke can't really be overridden from PIR, because it requires direct access to low-level interpreter data structures. - Standardize on PCC-style signature description strings throughout the system (instead of different signature description strings for NCI, PCC, and regular subs). - Refactor to remove code duplication between the various dispatch systems. - Optimize PCC dispatch (refactor to slim down the code). - Enable dispatching by CallSignature PMC everywhere. Some of these elements may be post-1.0 features. Consider this ticket a collection point for calling convention issues, and link in related tickets. Allison
[perl #58410] [TODO] Deprecate n_* variants of the math opcodes
# New Ticket Created by Allison Randal # Please include the string: [perl #58410] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58410 > Briefly discussed on the phone with Patrick, Jerry, and chromatic: The versions of the math opcodes that modify an existing destination PMC instead of creating a new destination PMC are not useful to HLLs, because they make assumptions about assignment semantics that don't hold true for all (or possibly even any) HLLs. Code generated from PCT takes the result of the math op as a temporary result value, and then performs a separate assignment operation to the HLL result variable, following the HLLs semantics for assignment. The plan is to make the regular variants (like 'add') create a new destination PMC, and then deprecate the old n_* variants (like 'n_add'). Allison
[perl #58438] [PATCH] nci can't pass NULL string arguments
# New Ticket Created by NotFound # Please include the string: [perl #58438] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58438 > I was doing a simple test of NCI calls with the xlib function XDisplayName, and found that nci can't handle a NULL string argument. Passing a NULL Parrot String segfaults. The attached patch passes a NULL char * when a NULL Parrot String is used. Don't know if this is the desired behaviour, I expect comments. -- Salu2 Index: tools/build/nativecall.pl === --- tools/build/nativecall.pl (revision 30618) +++ tools/build/nativecall.pl (working copy) @@ -505,8 +505,8 @@ /t/ && do { push @{$temps_ref}, "char *t_$temp_num;"; push @{$extra_preamble_ref}, -"t_$temp_num = string_to_cstring(interp, GET_NCI_S($reg_num));"; -push @{$extra_postamble_ref}, "string_cstring_free(t_$temp_num);"; +"{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? string_to_cstring(interp, s) : (char *) NULL;}"; +push @{$extra_postamble_ref}, "do { if (t_$temp_num) string_cstring_free(t_$temp_num); } while (0);"; return "t_$temp_num"; }; /b/ && do {
[perl #58452] Re: [PGE][BUG][PATCH] Apostrophes in optables are compiled to broken pir
# New Ticket Created by Moritz Lenz # Please include the string: [perl #58452] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58452 > Forwarding to [EMAIL PROTECTED] to open a ticket. After applying the patch all tests except a codingstd test (trailing whitespace) still pass, but since I'm not familiar with PGE I wait for somebody else (Patrick?) to apply it. Instead I attached a version of the patch without the trailing whitespace ;-) Marcelo Serra Castilhos wrote: > While writing something like a LISP reader I found this bug. To replicate it > this is enough: > > proto prefix:<'> is looser('term:') { ... } > > The problem is that the ' in the name of the operators aren't escaped. > > The patch I attached uses library/Data/Escape.pbc to escape the names. The > only modified file is > runtime/parrot/library/PGE/Perl6Grammar.pir A test for that would be nice. Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/ Index: runtime/parrot/library/PGE/Perl6Grammar.pir === --- runtime/parrot/library/PGE/Perl6Grammar.pir (revision 30633) +++ runtime/parrot/library/PGE/Perl6Grammar.pir (working copy) @@ -73,6 +73,7 @@ load_bytecode 'PGE/Text.pbc' load_bytecode 'PGE/Util.pbc' load_bytecode 'PCT/HLLCompiler.pbc' +load_bytecode 'library/Data/Escape.pbc' .local pmc p6regex p6regex = compreg 'PGE::Perl6Regex' @@ -339,6 +340,9 @@ $P0 = nstable[namespace] optable = $P0['optable'] +## Escape function +.local pmc esc +esc = find_global "Data::Escape", "String" ## build the list of traits .local pmc iter .local string traitlist @@ -366,8 +370,10 @@ goto trait_sub trait_arg: if trait == 'parsed' goto trait_sub -arg = concat "'", arg -arg = concat arg, "'" +## Escape the arg +arg = esc (arg) +arg = concat '"', arg +arg = concat arg, '"' goto trait_arg_done trait_sub: optable.emit(" $P0 = get_hll_global ['%0'], '%1'", namespace, arg) @@ -382,7 +388,10 @@ concat traitlist, arg goto trait_loop trait_end: -optable.emit(" optable.newtok('%0'%1)", name, traitlist) +## Escape the name +$P0 = find_global "Data::Escape", "String" +name = $P0(name, '"') +optable.emit(" optable.newtok(\"%0\"%1)", name, traitlist) .return () .end
[perl #58460] [PATCH] Bug with ResizablePMCArray::Append
# New Ticket Created by Stephen Weeks # Please include the string: [perl #58460] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58460 > I tried using resizablepmcarray's append() in cardinal and I got 'double fre or corruption' on program exit. I tried to fix it, but I'm not sure about GC issues. As far as I can tell, the attached shouldwork.patch (which adds GC_WRITE_BARRIER before the write) should fix the problem, but it doesn't change anything. The attached doeswork.patch actually does fix the issue, but has some obvious issues. As far as I can tell, shouldwork.patch is doing the same thing as calling VTABLE_set_pmc_keyed_int does, so I'm not sure why it doesn't work. I couldn't reproduce it with ResizablePMCArrays directly, though. I'll keep working to see if I can generate a small test case. Anyone have any ideas?
[perl #58484] Use of uninitialized value in scalar assignment at lib/Parrot/Revision.pm line 95.
# New Ticket Created by Ron Schmidt # Please include the string: [perl #58484] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58484 > Warning occurs when issuing 'perl Configure.pl' under cygwin where the LANG environment variable does not have a default value on my system. Patch to fix is included below. Index: lib/Parrot/Revision.pm === --- lib/Parrot/Revision.pm (revision 30633) +++ lib/Parrot/Revision.pm (working copy) @@ -80,19 +80,18 @@ } sub _analyze_sandbox { +local %ENV = %ENV; my $revision = 0; # code taken from pugs/util/version_h.pl rev 14410 # modified because in xml output commit and entry revision # are difficult to distinguih in a simplified parsing my $nul = File::Spec->devnull; -my $oldLANG = $ENV{LANG}; $ENV{LANG} = 'C'; if ( my @svn_info = qx/svn info 2>$nul/ and $? == 0 ) { if ( my ($line) = grep /^Revision:/, @svn_info ) { ($revision) = $line =~ /(\d+)/; } } -$ENV{LANG} = $oldLANG; return $revision; }
[perl #58488] crashing parrot when calling create_lexinfo
# New Ticket Created by Stephane Payrard # Please include the string: [perl #58488] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58488 > One can crash calling rakudo on a file containing eval 'class A { has $.a}; my $a = A.new();'; eval 'class A { has $.a}; my $a = A.new();'; eval 'class A { has $.a}; my $a = A.new();'; or by executing thrice the line class A { has $.a}; my $a = A.new() interactively in rakudo. This is reproduceable on Mac OS X Leopard and cygwin. The stack seems strange to me, it seems that the context of the eval is left on the stack when it should not as a result we have many runloops in the stack. The stack trace is : Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x0008 Crashed Thread: 0 Thread 0 Crashed: 0 libparrot.dylib 0x00702c4d create_lexinfo + 317 (pbc.c:993) 1 libparrot.dylib 0x007033c2 add_const_pmc_sub + 1202 (pbc.c:1193) 2 libparrot.dylib 0x0070485a e_pbc_emit + 570 (pbc.c:1865) 3 libparrot.dylib 0x006f9397 emit_flush + 199 (instructions.c:869) 4 libparrot.dylib 0x006f3c7e imc_compile_unit + 62 (imc.c:118) 5 libparrot.dylib 0x006f3dce imc_close_unit + 30 (imc.c:223) 6 libparrot.dylib 0x006e8128 yyparse + 3208 (imcc.y:718) 7 libparrot.dylib 0x006f39b5 compile_string + 197 (imcc.l:1342) 8 libparrot.dylib 0x00706ed7 imcc_compile + 519 (parser_util.c:802) 9 libparrot.dylib 0x007071ee imcc_compile_pir_ex + 46 (parser_util.c:986) 10 libparrot.dylib 0x00540ac8 pcf_P_Jt + 120 (nci.c:235) 11 libparrot.dylib 0x0062f340 Parrot_NCI_invoke + 176 (nci.pmc:310) 12 libparrot.dylib 0x004be05b Parrot_invokecc_p + 107 (core.ops:463) 13 libparrot.dylib 0x005761a7 runops_slow_core + 183 (runops_cores.c:222) 14 libparrot.dylib 0x00536d4f runops_int + 447 (interpreter.c:942) 15 libparrot.dylib 0x005376d2 runops + 194 (inter_run.c:105) 16 libparrot.dylib 0x00537974 runops_args + 436 (inter_run.c:237) 17 libparrot.dylib 0x00537aa9 Parrot_runops_fromc_args + 73 (inter_run.c:300) 18 libparrot.dylib 0x0052348c Parrot_ex_throw_from_c + 444 (exceptions.c:297) 19 libparrot.dylib 0x00523563 Parrot_ex_throw_from_c_args + 195 (exceptions.c:339) 20 libparrot.dylib 0x005f940f cant_do_method + 79 (default.pmc:63) 21 libparrot.dylib 0x005fc089 Parrot_default_get_string + 41 (default.c:1345) 22 libparrot.dylib 0x00569e26 fail_if_type_exists + 166 (oo.c:619) 23 libparrot.dylib 0x00569ec8 Parrot_oo_register_type + 24 (oo.c:653) 24 libparrot.dylib 0x0067ccf8 init_class_from_hash + 584 (class.pmc:222) 25 libparrot.dylib 0x0067e74b Parrot_Class_init_pmc + 555 (class.c:844) 26 libparrot.dylib 0x005757d0 pmc_new_init + 176 (pmc.c:369) 27 libparrot.dylib 0x004d395b Parrot_newclass_p_p + 59 (object.ops:249) 28 libparrot.dylib 0x005761a7 runops_slow_core + 183 (runops_cores.c:222) 29 libparrot.dylib 0x00536d4f runops_int + 447 (interpreter.c:942) 30 libparrot.dylib 0x005376d2 runops + 194 (inter_run.c:105) 31 libparrot.dylib 0x00537974 runops_args + 436 (inter_run.c:237) 32 libparrot.dylib 0x00537aa9 Parrot_runops_fromc_args + 73 (inter_run.c:300) 33 libparrot.dylib 0x0056b6e0 run_sub + 112 (packfile.c:496) 34 libparrot.dylib 0x0056b935 do_1_sub_pragma + 565 (packfile.c:589) 35 libparrot.dylib 0x0056bbb1 do_sub_pragmas + 289 (packfile.c:722) 36 libparrot.dylib 0x005701c9 PackFile_fixup_subs + 41 (packfile.c:3812) 37 libparrot.dylib 0x00706f46 imcc_compile + 630 (parser_util.c:822) 38 libparrot.dylib 0x007071ee imcc_compile_pir_ex + 46 (parser_util.c:986) 39 libparrot.dylib 0x00540ac8 pcf_P_Jt + 120 (nci.c:235) 40 libparrot.dylib 0x0062f340 Parrot_NCI_invoke + 176 (nci.pmc:310) 41 libparrot.dylib 0x004be05b Parrot_invokecc_p + 107 (core.ops:463) 42 libparrot.dylib 0x005761a7 runops_slow_core + 183 (runops_cores.c:222) 43 libparrot.dylib 0x00536d4f runops_int + 447 (interpreter.c:942) 44 libparrot.dylib 0x005376d2 runops + 194 (inter_run.c:105) 45 libparrot.dylib 0x00537974 runops_args + 436 (inter_run.c:237) 46 libp
[perl #58506] Problem with :outer
# New Ticket Created by Stephen Weeks # Please include the string: [perl #58506] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58506 > The attached pir file tries to call a sub set :outer() another sub without calling the outer sub first. This fails with: too few arguments passed (0) - 1 params expected current instr.: 'bar' pc 3 (tlib.pir:4) called from Sub 'foo' pc 19 (tlib.pir:10) Setting the outer sub to :load also works. I'm trying to do this because this is what the PIR PCT generates looks like, and I'm trying to use a precompiled test.rb for cardinal. Should I maybe be setting the top-level block to :load? Rakudo seems to not be encountering this issue because of some stuff done at :immediate time changing the $!proto of each sub. Any ideas? .sub "foo" :anon :lexid("1") .end .sub "bar" :lexid("2") :outer("1") .param pmc a print a .end .sub "main" :main 'bar'(9) .end
[perl #58550] [TODO] Deprecate the cmodulus vtable functions
# New Ticket Created by Allison Randal # Please include the string: [perl #58550] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58550 > Deprecate the following vtable functions: PMC* cmodulus(PMC* value, PMC* dest) PMC* cmodulus_int(INTVAL value, PMC* dest) PMC* cmodulus_float(FLOATVAL value, PMC* dest) void i_cmodulus(PMC* value) void i_cmodulus_int(INTVAL value) void i_cmodulus_float(FLOATVAL value) According to the documentation, the 'cmod' opcode is "provided for those who need it (such as speed-sensitive applications with heavy use of mod, but using it only with positive arguments)". There's no point in supporting a slow pmc/vtable/mmd-based implementation of an opcode that's only included as an optimization. Also deprecate the two-argument forms of the 'cmod' opcode (which only existed as an artifact of the old multiple dispatch system). Allison
[perl #58590] [PATCH] dotnet make
# New Ticket Created by Reini Urban # Please include the string: [perl #58590] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58590 > --- osname= cygwin osvers= 1.5.25(0.15642) arch= cygwin-thread-multi-64int cc= gcc --- Flags: category=languages severity=medium ack=no --- Attached patch overhauls the dotnet make + Configure system a bit, so that the conditional make syntax is supported and the perl stuff is gone. It requires the 57548-CONDITIONED_LINE_enh.patch (best wait for the cygwin070patches merge) Status: Failed 22/43 test programs. 141/263 subtests failed with cygwin + mono-1.2.1 --- Summary of my parrot 0.7.0 (r30732) configuration: configdate='Wed Sep 3 19:18:37 2008 GMT' Platform: osname=cygwin, archname=cygwin-thread-multi-64int jitcapable=1, jitarchname=i386-cygwin, jitosname=CYGWIN, jitcpuarch=i386 execcapable=1 perl=/usr/bin/perl.exe Compiler: cc='gcc', ccflags='-U__STRICT_ANSI__ -pipe -I/usr/local/include -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wno-missing-format-attribute -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O3 -DHAS_GETTEXT', Linker and Libraries: ld='gcc', ldflags=' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base ', cc_ldflags='', libs='-L/usr/local/lib -lcrypt -lgmp -lreadline -lpcre -lglut32 -lglu32 -lopengl32 -lcrypto -lintl' Dynamic Linking: share_ext='.dll', ld_share_flags='-shared', load_ext='.dll', ld_load_flags='-shared' Types: iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=1 byteorder=1234, nv=double, numvalsize=8, doublesize=8 -- Reini Urban http://phpwiki.org/ http://murbreak.at/ dotnet-make.patch Description: Binary data
[perl #58586] s/FedoraCore/Fedora/ on http://www.parrot.org/download
# New Ticket Created by Stuart Jansen # Please include the string: [perl #58586] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58586 > The Fedora Core/Extras split no longer exists. Fedora is now simply called Fedora, not Fedora Core. (Oh, and it was never FedoraCore.) http://www.parrot.org/download
[perl #58610] [ PATCH ] Broken link on parrotcode.org dev page - list item "Parrot Testing Status"
# New Ticket Created by Ronald Schmidt # Please include the string: [perl #58610] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58610 > I applied for an account and built what seems to me to be an appropriate Parrot Testing Status page. My proposed link target is http://www.parrot.org/wiki/some-testing-status-tools . If someone wants to set me up as a site editor I will fix the link myself otherwise the page is available for someone else to fix the link. Ron
[perl #58628] Re: [ PATCH ] Broken link on parrotcode.org dev page - list item "Parrot Testing Status"
# New Ticket Created by Allison Randal # Please include the string: [perl #58628] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58628 > Ronald Schmidt wrote: > I applied for an account and built what seems to me to be an appropriate > Parrot Testing Status page. My proposed link target is > http://www.parrot.org/wiki/some-testing-status-tools . If someone wants > to set me up as a site editor I will fix the link myself otherwise the > page is available for someone else to fix the link. Someone else beat me to granting you editor access. But, while I was in there anyway, I went ahead and switched the "Wiki" tab at the top to point to the top-level parrot.org wiki page. Allison
[perl #58636] Must Instantiate Class PMCs Before Using Them in HLL Mappings
# New Ticket Created by chromatic # Please include the string: [perl #58636] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58636 > Patrick's example code for RT #30843 creates an infinite loop (before the workaround checked in approximately as r30847) because registering an Integer mapping requires instantiating an HLL-equivalent Integer when storing the mapping. If the HLL equivalent is an uninstantiated class, attempting to create an instance of the class to store the mapping value creates an infinite loop of trying to look up the value before it's stored. A better solution would avoid this infinite regress. r30847 is a workaround.
[perl #58670] Parrot_print_backtrace() depends on __USE_GNU
# New Ticket Created by Christoph Otto # Please include the string: [perl #58670] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58670 > make cover is broken, apparently because of the use of Dl_info and a couple other GNU-specific functions in Parrot_print_backtrace() in src/exceptions.c . On my system __USE_GNU needs to be defined when the Dl_info struct is used, which happens during make cover. The attached patch makes src/exceptions.c compile again under make cover, but it's probably not a long-term fix. All it does is #define __USE_GNU in the same #ifdef where Dl_info is used. I don't propose that this patch be committed. The revision that exposes this problem is r30173, but I suspect that the offending code was added earlier. Index: src/exceptions.c === --- src/exceptions.c (revision 30881) +++ src/exceptions.c (working copy) @@ -23,6 +23,7 @@ #include "exceptions.str" #ifdef PARROT_HAS_BACKTRACE +# define __USE_GNU # include # include #endif
[perl #58672] [TODO] implement method lookup iterators
# New Ticket Created by Allison Randal # Please include the string: [perl #58672] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58672 > For SUPER and NEXT, provide a way of returning a list or iterator for access to the next method up the chain. Allison
[perl #58660] [PATCH] pbc_merge messes up line numbers
# New Ticket Created by Bob Rogers # Please include the string: [perl #58660] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58660 > The attached tarball illustrates the problem (which has been around for a while): 1. Unpack in your Parrot working copy. 2. "cd pbc-merge-lnum-bug" 3. Running "make" generates the following output, with the expected error: [EMAIL PROTECTED]> make ../parrot -o main.pbc main.pir ../parrot -o foo.pbc foo.pir ../parrot -o bar.pbc bar.pir ../pbc_merge -o all.pbc main.pbc foo.pbc bar.pbc ../parrot all.pbc in foo in bar Could not find non-existent sub baz current instr.: 'bar' pc 36 (bar.pir:3) called from Sub 'foo' pc 21 (foo.pir:3) called from Sub 'main' pc 7 (main.pir:2) make: *** [test] Error 1 [EMAIL PROTECTED]> The problem is that the backtrace reports that the current instruction is "bar.pir" line 3, when it's really line 6. Line numbers for "foo" and "main" are correct. 4. Running "make test2" uses a different "main" that loads the other two PBC files explicitly; the correct line number is reported in this case. I notice that pbc_merge_debugs (src/pbc_merge.c:546) adds the cumulative sum of the previous debug segment sizes to the mapping offsets. These sizes are 7, 9, and 10 for main.pbc, foo.pbc, and bar.pbc respectively, but each of these values seems high by one. The attached patch is based on the theory that in_seg->base.size is really the count of words in the bytecode file and therefore includes the initial size word as well as the data. It does make the attached test case work, but this is too much voodoo for my taste, so I'll wait to hear from someone who knows what's going on. -- Bob Rogers http://rgrjr.dyndns.org/ pbc-merge-lnum-bug.tgz Description: Binary data * src/pbc_merge.c: + (pbc_merge_debugs): Fix line number offset bug in bytecode merging. Index: src/pbc_merge.c === --- src/pbc_merge.c (revision 30656) +++ src/pbc_merge.c (working copy) @@ -584,8 +584,9 @@ mappings[num_mappings + j] = mapping; } -/* Update counts. */ -num_lines+= in_seg->base.size; +/* Update counts. The "- 1" allows for the fact that the size value + itself is included in in_seg->base.size. */ +num_lines+= in_seg->base.size - 1; num_mappings += in_seg->num_mappings; }
[perl #58668] src/exceptions.c exposes brokenness in make cover
# New Ticket Created by Christoph Otto # Please include the string: [perl #58668] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58668 > src/exceptions.c has some brokenness that caused gcc to barf during make cover on r30881, but the build process ignored the failure. I don't know why this is, since gcc definitely returned a non-0 exit status, but I imagine it'd be a quick fix for someone who knows the build process better than I do. The breakage seems to be specific to make cover. The normal make process DTRT. Christoph
[perl #58724] [pirc] Smolder Failures
# New Ticket Created by Will Coleda # Please include the string: [perl #58724] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58724 > http://smolder.plusthree.com/app/public_projects/report_details/5297#first_failure (but there's more than one) All the failures seem to be from compilers/pirc. -- Will "Coke" Coleda
[perl #58812] Tcl Segfaults parrot
# New Ticket Created by Will Coleda # Please include the string: [perl #58812] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58812 > After many weeks away from tcl, I tried to do a make test today (r31046) and found a segfault. I can't easily generate PIR to narrow it down, because even the --pir option is segfaulting. doing a build and just running "../../parrot tcl.pbc" is enough to trigger the segfault (that should drop you into an interpreter.) I'll post more details tomorrow if I can. Here's a backtrace from gdb. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb6c708d0 (LWP 426)] 0xb7ca4e33 in pmc_new_noinit (interp=0x804f040, base_type=81) at src/pmc.c:300 300 PMC *const classobj = interp->vtables[base_type]->pmc_class; (gdb) bt #0 0xb7ca4e33 in pmc_new_noinit (interp=0x804f040, base_type=81) at src/pmc.c:300 #1 0xb7c7113b in Parrot_register_HLL_type (interp=0x804f040, hll_id=2, core_type=67, hll_type=81) at src/hll.c:362 #2 0xb7dd875e in Parrot_ParrotInterpreter_thawfinish (interp=0x804f040, pmc=0x8220e9c, info=0xbfdc1aa8) at ./src/pmc/parrotinterpreter.pmc:670 #3 0xb7ca44dc in visit_loop_todo_list (interp=0x804f040, current=0x8220e9c, info=0xbfdc1aa8) at src/pmc_freeze.c:1609 #4 0xb7ca46a6 in run_thaw (interp=0x804f040, image=0x8215114, what=VISIT_THAW_NORMAL) at src/pmc_freeze.c:1700 #5 0xb7ca4920 in Parrot_thaw (interp=0x804f040, image=0x8215114) at src/pmc_freeze.c:1820 #6 0xb7c9f4a0 in PackFile_Constant_unpack_pmc (interp=0x804f040, constt=0x8229408, self=0x8229698, cursor=0xb7b12ba8) at src/packfile.c:3588 #7 0xb7c9f3f8 in PackFile_Constant_unpack (interp=0x804f040, constt=0x8229408, self=0x8229698, cursor=0xb7b129e8) at src/packfile.c:3542 #8 0xb7c9f0fc in PackFile_ConstTable_unpack (interp=0x804f040, seg=0x8229408, cursor=0xb7b129e4) at src/packfile.c:3338 #9 0xb7c9c81a in PackFile_Segment_unpack (interp=0x804f040, self=0x8229408, cursor=0xb7b129e0) at src/packfile.c:1614 #10 0xb7c9cd3e in directory_unpack (interp=0x804f040, segp=0x8229270, cursor=0xb7b129d0) at src/packfile.c:1808 #11 0xb7c9c81a in PackFile_Segment_unpack (interp=0x804f040, self=0x8229270, cursor=0xb7b12040) at src/packfile.c:1614 #12 0xb7c9b773 in PackFile_unpack (interp=0x804f040, self=0x8229270, packed=0xb7b12000, packed_size=8000) at src/packfile.c:877 #13 0xb7c60ba5 in Parrot_readbc (interp=0x804f040, fullname=0xbfdc39e0 "tcl.pbc") at src/embed.c:506 #14 0xb7eb6e0b in imcc_run (interp=0x804f040, sourcefile=0xbfdc39e0 "tcl.pbc", argc=1, argv=0xbfdc1e88) at compilers/imcc/main.c:1051 #15 0x08048978 in main (argc=1, argv=0xbfdc1e88) at src/main.c:61 -- Will "Coke" Coleda
[perl #58840] [BUG] Parrot::Test Check for filehandle before comparing with eq to '/dev/null'
# New Ticket Created by Reini Urban # Please include the string: [perl #58840] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58840 > --- osname= cygwin osvers= 1.5.25(0.15642) arch= cygwin-thread-multi-64int cc= gcc --- Flags: category=library severity=low ack=no --- All platforms, all Perls older than 5.10, just cygwin 5.8.8 passes. Detected by cotto, fixed in t/native_pbc/header.t in r31088. $ perl5.8.4 t/native_pbc/header.t 1..9 Operation `eq': no method found, left argument in overloaded package File::Temp, right argument has no overloaded magic at lib/Parrot/Test.pm line 312. # Looks like your test died before it could output anything. Fix in the test: my $out_f = File::Temp->new( UNLINK => 1, SUFFIX => '.pbc' ); ... Parrot::Test::run_command ( qq{$parrot $args -o $out_f $tmppasm}, - CD => $path_to_parrot, - STDOUT => $out_f, - STDERR => $out_f, + CD => $path_to_parrot ); my $pbc = slurp_file($out_f); Problematic part in lib/Parrot/Test.pm: while ( my ( $key, $value ) = each %options ) { $key =~ m/^STD(OUT|ERR)$/ or die "I don't know how to redirect '$key' yet!"; $value = File::Spec->devnull() if $value eq '/dev/null'; # TODO filehandle `eq' string will fail } # on older perls A invocation of Parrot::Test::run_command with an filehandle for STDOUT as in t/native_pbc/header.t will lead to the error. TODO: Check for filehandle before comparing with eq to '/dev/null' --- Summary of my parrot 0.7.0 (r0) configuration: configdate='Wed Aug 20 18:34:46 2008 GMT' Platform: osname=cygwin, archname=cygwin-thread-multi-64int jitcapable=1, jitarchname=i386-cygwin, jitosname=CYGWIN, jitcpuarch=i386 execcapable=1 perl=/usr/bin/perl.exe Compiler: cc='gcc', ccflags='-U__STRICT_ANSI__ -pipe -I/usr/local/include -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wno-missing-format-attribute -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wwrite-strings -Wbad-function-cast -Wdeclaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DDISABLE_GC_DEBUG=1 -DNDEBUG -O3 -DHAS_GETTEXT', Linker and Libraries: ld='gcc', ldflags=' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--stack,8388608 -Wl,--enable-auto-image-base ', cc_ldflags='', libs='-L/usr/local/lib -lcrypt -lgmp -lreadline -lpcre -lglut32 -lglu32 -lopengl32 -lcrypto -lintl' Dynamic Linking: share_ext='.dll', ld_share_flags='-shared', load_ext='.dll', ld_load_flags='-shared' Types: iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=1 byteorder=1234, nv=double, numvalsize=8, doublesize=8 --- Environment: CYGWIN =server HOME =/home/rurban LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH =~/bin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin SHELL (unset)
[perl #58852] [PATCH] enhance tools/install/smoke.pl
# New Ticket Created by Reini Urban # Please include the string: [perl #58852] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58852 > Enhance tools/install/smoke.pl to test already installed parrot by using %PConfig and a DESTDIR arg for a temporary installation. Attached patch is r31113 in the branch cygwin070patches. parrot in bin % cd /usr/local/parrot-$version % perl tools/install/smoke.pl -Ilib parrot in . % perl tools/install/smoke.pl --bindir=. test installation in DESTDIR: % cd /usr/src/parrot % mkdir .inst % make install DESTDIR=.inst % perl tools/install/smoke.pl DESTDIR=.inst Options: -I libdir Add libdir to the libpath to find Parrot::Config --bindir=/usr/bin Override Parrot::Config bindir --libdir=/usr/lib Override Parrot::Config libdir --prefix=/usr Override Parrot::Config prefix and adjust libdir and bindir accordingly. DESTDIR=instpath Use the temp. installation in instpath. -- Reini Urban http://phpwiki.org/ http://murbreak.at/ Index: tools/install/smoke.pl === --- tools/install/smoke.pl (revision 31112) +++ tools/install/smoke.pl (working copy) @@ -4,6 +4,10 @@ use strict; use warnings; +use 5.008; +use Getopt::Long; +use lib qw( lib ); +use vars qw( %PConfig ); use Test::More tests => 29; @@ -13,39 +17,116 @@ =head1 SYNOPSIS + parrot in bin + % cd /usr/local/parrot-$version -% perl tools/install/smoke.pl +% perl tools/install/smoke.pl -Ilib + parrot in . + +% perl tools/install/smoke.pl --bindir=. + + test installation in DESTDIR: + +% cd /usr/src/parrot +% mkdir .inst +% make install DESTDIR=.inst +% perl tools/install/smoke.pl DESTDIR=.inst + + =head1 DESCRIPTION Checks that most of things run (or just start) into the install directory, -try to detect missing part. +try to detect missing parts. +=head1 OPTIONS + +=over + +=item -I libdir + +Add libdir to the libpath to find Parrot::Config + +=item --bindir=/usr/bin + +Override Parrot::Config bindir + +=item --libdir=/usr/lib + +Override Parrot::Config libdir + +=item --prefix=/usr + +Override Parrot::Config prefix and adjust +libdir and bindir accordingly. + +=item DESTDIR=instpath + +Use the temp. installation in instpath. + +=back + =cut +my (@libdirs, $prefix, $bindir, $libdir, $DESTDIR); +my $opts = GetOptions( 'I=s' => [EMAIL PROTECTED], + 'prefix=s' => \$prefix, + 'bindir=s' => \$bindir, + 'libdir=s' => \$libdir, + 'DESTDIR=s' => \$DESTDIR, + ); +if (@libdirs) { +push @INC, @libdirs; +} +require Parrot::Config; +Parrot::Config->import; +require Parrot::Test; + +$bindir = $PConfig{bindir} unless $bindir; +$libdir = $PConfig{libdir} unless $libdir; +if ($prefix) { +$bindir = $prefix . "/bin"; +$libdir = $prefix . "/lib"; +} +# Check for DESTDIR arg and adjust the path +if (@ARGV and $ARGV[0] =~ /^DESTDIR/) { +if ($ARGV[0] =~ /^DESTDIR=(\S+)/) { +$DESTDIR = $1; +} else { +$DESTDIR = $ARGV[1]; +} +} +if ($DESTDIR) { +my $envsep = $^O eq 'MSWin32' ? ';' : ':'; +$ENV{PATH} = $DESTDIR.$bindir.$envsep.$ENV{PATH}; +$bindir = $DESTDIR . $bindir; +$libdir = $DESTDIR . $libdir; +} + use File::Spec::Functions; my $filename; my $exe; my $out; my $FH; -my $parrot = catfile('bin', 'parrot'); +my $parrot = catfile($bindir, 'parrot'); # # parrot executable # +-x $parrot or die "$parrot does not exist\n"; -$exe = catfile('bin', 'pbc_merge'); +$exe = catfile($bindir, 'pbc_merge'); $out = `$exe`; ok($out =~ /^pbc_merge/, "check pbc_merge"); -$exe = catfile('bin', 'pdump'); +$exe = catfile($bindir, 'pdump'); $out = `$exe`; ok($out =~ /^pdump/, "check pdump"); ok(system("$parrot -V") == 0, "display parrot version"); -$exe = catfile('bin', 'perl6'); +$exe = catfile($bindir, 'perl6'); $out = `$exe -v`; ok($out =~ /Rakudo/, "check rakudo"); @@ -58,10 +139,11 @@ or die "Can't open $filename ($!).\n"; print $FH "token TOP { \\s* }\n"; close $FH; -$out = `$parrot lib/parrot/library/PGE/Perl6Grammar.pir $filename`; +$out = `$parrot $libdir/parrot/library/PGE/Perl6Grammar.pir $filename`; ok($out =~ /^\n## <::TOP>/, "check PGE"); unlink($filename); +# compilers/tge is typically not installed $filename = 'test.tg'; open $FH, '>', $filename or die "Can't open $filename ($!).\n"; @@ -71,6 +153,7 @@ ok($out =~ /^\n\.sub '_ROOT_past'/, "check TGE"); unlink($filename); +# compilers/nqp is typically not installed $filename = 'test.nqp'; open $FH, '>', $filename or die "Can't open $filename ($!).\n"; @@ -129,7 +212,7 @@ or die "Can't open $filename ($!).\n"; print $FH "H"; close $FH; -$out = `$parrot languages/HQ9Plus/HQ9Plus.pbc $filename`; +$out = `$parrot
[perl #58938] [BUG] src/string.c:2241: failed assertion '(s)->encoding'
# New Ticket Created by Reini Urban # Please include the string: [perl #58938] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58938 > Since a few days loadlib initialization causes an src/string.c:2241: failed assertion '(s)->encoding' See http://nopaste.snit.ch/14072 gdb backtrace: src/string.c:2241: failed assertion '(s)->encoding' $ cat encoding-bug.pir loadlib 'rotest' $ gdb ./parrot encoding-bug.pir (gdb) s Breakpoint 7, string_hash (interp=0x1ef2328, s=0x1f41278, seed=3793) at src/string.c:2241 2241saneify_string(s); (gdb) p *s $1 = {cache = {_b = {_bufstart = 0x69205def, _buflen = 6}, _ptrs = { _struct_val = 0x69205def, _pmc_val = 0x6}, _i = {_int_val = 1763728879, _int_val2 = 6}, _num_val = 1.3603372593483627e-313, _string_val = 0x69205def}, flags = 405760, strstart = 0x69205def "ROTest", bufused = 6, strlen = 6, hashval = 0, encoding = 0x0, charset = 0x0} (gdb) bt #0 string_hash (interp=0x1ef2328, s=0x1f41278, seed=3793) at src/string.c:2241 #1 0x66fa9aa3 in key_hash_STRING (interp=0x1ef2328, s=0x1f41278, seed=3793) at src/hash.c:153 #2 0x66faaa5e in parrot_hash_get_bucket (interp=0x1ef2328, hash=0x1f6ce88, key=0x1f41278) at src/hash.c:1093 #3 0x66faaaef in parrot_hash_get (interp=0x1ef2328, hash=0x1f6ce88, key=0x1f41278) at src/hash.c:1123 #4 0x67166491 in Parrot_NameSpace_get_pointer_keyed_str (interp=0x1ef2328, pmc=0x1f67d48, key=0x1f41278) at ./src/pmc/namespace.pmc:434 #5 0x639518e0 in pmc_type () from /usr/bin/cygparrot0_7_0.dll #6 0x63951971 in pmc_register () from /usr/bin/cygparrot0_7_0.dll #7 0x69203d6a in Parrot_lib_rotest_load (interp=0x1ef2328) at ./rotest.c:1166 #8 0x66f9c9ee in Parrot_init_lib (interp=0x1ef2328, load_func=0x69203d20 , init_func=0) at src/dynext.c:317 #9 0x66f9cb21 in run_init_lib (interp=0x1ef2328, handle=0x6920, lib_name=0x20e4b78, wo_ext=0x20e4b78) at src/dynext.c:384 #10 0x66f9d0d9 in Parrot_load_lib (interp=0x1ef2328, lib=0x1f412a0, initializer_unused=0x0) at src/dynext.c:583 #11 0x671a7f46 in do_loadlib (interp=0x1ef2328, lib=0x21066f8 "'rotest'") at compilers/imcc/imcc.y:602 #12 0x671a8d0b in yyparse (yyscanner=0x20f2078, interp=0x1ef2328) at compilers/imcc/imcc.y:737 #13 0x671b5281 in compile_to_bytecode (interp=0x1ef2328, sourcefile=0xc3cce4 "encoding-bug.pir", output_file=0x0) at compilers/imcc/main.c:955 #14 0x671b562c in imcc_run (interp=0x1ef2328, sourcefile=0xc3cce4 "encoding-bug.pir", argc=1, argv=0x1ef213c) at compilers/imcc/main.c:1058 #15 0x00401120 in main (argc=1, argv=0x1ef213c) at src/main.c:61 (gdb) -- Reini Urban http://phpwiki.org/ http://murbreak.at/
[perl #58934] [CAGE] 'make fulltest' says "PASS" at the end, although some tests failed
# New Ticket Created by Moritz Lenz # Please include the string: [perl #58934] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58934 > 'make fulltest' runs several chunks of tests, and does not show a final summary. So although some tests in some chunks fail, the last thing that the tester sees is something along these lines: ===( 35 )==All tests successful. Files=10, Tests=108, 29 wallclock secs ( 0.04 usr 0.02 sys + 19.55 cusr 1.44 csys = 21.05 CPU) Result: PASS make[1]: Leaving directory `/home/moritz/src/parrot' If only the last chunk succeeded. This is very misleading, and probably dangerous. At the very least it should say something like "WARNING: not all tests were successful, scroll up to find out which failed". This could be done by collecting the return values from the various 'make test*' calls. Even better would be real summary at the end listing the failed tests. (Observed with perl-5.10.0 and Test::Harness 3.11, parrot as of shortly-before 0.7.1) Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
[perl #58978] [TODO][IMCC] replace .result by .get_result
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58978] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58978 > as suggested by Allison, .result in a .begin/end_call sequence will be replaced by .get_result
[perl #58976] [TODO][IMCC] .arg will be replaced by .set_arg
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58976] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58976 > as suggested by Allison, the .arg directive in a .begin_call/end_call statement will be replaced by .set_arg
[perl #58974] [TODO][IMCC] replace .return in tailcall context by .tailcall
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58974] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58974 > as suggested by Allison, .return in a tailcall context, like this: .return foo() will changed into: .tailcall foo()
[perl #58980] [TODO][IMCC] .return in a .begin/end_return will be replaced by .set_return
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #58980] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58980 > As suggested by Allison, in a .begin/end_return sequence, the .return directive will be replaced by .set_return Likewise .yield will become .set_yield in .begin/end_yield sequence.
[perl #58990] [TODO] Design new spec coverage mechanism
# New Ticket Created by James Keenan # Please include the string: [perl #58990] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58990 > We need a way to measure the extent to which Parrot's test suite covers the Parrot specification. Since the specification is expressed in words rather than code, a quantitative measurement of the "spec coverage" is unlikely. However, a visual representation of that coverage is possible and desirable. For example, HTML versions of the Parrot design documents might carry annotations which indicate which tests exercise the code described in particular paragraphs in the PDDs. The objective of this RT is to develop a specification for a new spec coverage mechanism. The specification, like other PDDs, should be written in Perl 5 POD. This specification should define key terms; it should not assume, for example, that everyone knows what a 'smartlink' is. It should describe the graphic appearance of the spec coverage mechanism and specify what functionality (e.g., 'mouse over') the functionality will have. While it should draw upon "prior art" where appropriate, it should not depend on a reader being previously familiar with, e.g., the Pugs implementation. The specification should also include a plan for testing the spec coverage mechanism, including both unit and functionality tests. A testing plan, in broad outline, should exist before any code is written. The code should be written in easily maintainable Perl 5 and documented in Perl 5 POD. Note: While the spec coverage mechanism will ultimately have to be written in Perl 5 POD, we should consider doing some early drafts on the Parrot wiki. Those readers of the list who want to work on this project should speak up as to whether this is a good way to proceed.
[perl #58988] [RFC] Parrot_get_runtime_prefix function
# New Ticket Created by NotFound # Please include the string: [perl #58988] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=58988 > The Parrot_get_runtime_prefix in src/library.c return a char *, forcing the places that currently uses it to be more complicated than desired for no real gain. I added and used a STRING * variant named Parrot_get_runtime_path (that name makes more sense to me) in r31216 The question is: must we retain the old variant, kill it, deprecate it, use his name for the new version, or revert the change and stay with the char * way? -- Salu2
[perl #59202] [BUG] [PATCH] Perl 6 code "class A::A {}; class A::A {}" crashes parrot
# New Ticket Created by Stephane Payrard # Please include the string: [perl #59202] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59202 > class names is now (always) a ResizableStringArray so we get a crash instead of printing an error message. rakudo > class A::A {} ; class A::A {}; Class A::A already registered! To be on the safe side, the code supports the old format. Note that there is still a problem to be solved. > class A::A {} ; class A::A {}; Class A::A already registered! > class A::A {} compilers/imcc/pbc.c:1734: failed assertion 'sig_arr->vtable->base_type == enum_class_FixedIntegerArray' In the process of investigating this bug, I added a get_string method to ResizableStringArray that may useful in its own right. --- src/oo.c.orig 2008-09-22 16:59:06.0 +0200 +++ src/oo.c2008-09-22 17:12:36.0 +0200 @@ -603,10 +603,12 @@ static void fail_if_type_exists(PARROT_INTERP, ARGIN(PMC *name)) { -INTVAL type; +INTVAL type; +STRING * classname; -PMC * const classname_hash = interp->class_hash; -PMC * const type_pmc = (PMC *)VTABLE_get_pointer_keyed(interp, +STRING * const separator = string_from_cstring(interp, "::", 0); +PMC *const classname_hash = interp->class_hash; +PMC *const type_pmc = (PMC *)VTABLE_get_pointer_keyed(interp, classname_hash, name); if (PMC_IS_NULL(type_pmc) @@ -615,10 +617,15 @@ else type = VTABLE_get_integer(interp, type_pmc); -if (type > enum_type_undef) +if (type > enum_type_undef) { +if (name->vtable->base_type == enum_class_ResizableStringArray) +classname = string_join( interp, separator, name); +else +classname = string_escape_string(interp, VTABLE_get_string(interp, name)); + Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, -"Class %Ss already registered!\n", -string_escape_string(interp, VTABLE_get_string(interp, name))); +"Class %Ss already registered!\n", classname); +} if (type < enum_type_undef) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION, -- cognominal stef
[perl #59288] [BUG] MMD bug in ResizablePMCArray.sort
# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #59288] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59288 > Hello. There is simple test case. $ cat mmd.pid .sub 'main' .local pmc arr arr = new 'ResizablePMCArray' arr = 4 arr[0] = 4 arr[1] = 3 arr[2] = 2 arr[3] = 1 $P0 = get_hll_global "infix:cmp" arr.'sort'($P0) .end .sub 'infix:cmp' :multi(_,_) .param pmc a .param pmc b $I0 = cmp a, b .return ($I0) .end $ ./parrot mmd.pir No applicable methods. current instr.: 'main' pc -342416984 ((unknown file):-1) called from Sub 'main' pc 31 (mmd.pir:10) Same results for "trunk" and "pdd27mmd" branch. -- Bacek
[perl #59340] t/stm/runtime_4.pir segfaults on FreeBSD 7 (i386)
# New Ticket Created by Geraud CONTINSOUZAS # Please include the string: [perl #59340] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59340 > --- osname= freebsd osvers= 7.1-prerelease arch= i386-freebsd-thread-multi-64int cc= cc --- Flags: category=core severity=medium ack=no --- I reported a problem on IRC yesterday and was prompted to file a bug. So here we go. [217]# prove t/stm/runtime.t t/stm/runtimeok 1/5 # Failed test 'queue adapted for the library' # in t/stm/runtime.t at line 506. t/stm/runtimeNOK 4# Exited with error code: 139 # Received: # Segmentation fault (core dumped) # # Expected: # ok # # Looks like you failed 1 test of 5. [218]# gdb ./parrot GNU gdb 6.1.1 [FreeBSD] ... (gdb) r t/stm/runtime_4.pir Starting program: /usr/home/geraud/code/parrot/parrot t/stm/runtime_4.pir [New LWP 100284] [New Thread 0x8101100 (LWP 100284)] [New Thread 0x8101200 (LWP 100311)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x8101100 (LWP 100284)] 0x281c0ad7 in Parrot_dod_trace_children (interp=0x8106040, how_many=4294966630) at src/gc/dod.c:399 399 const UINTVAL bits = PObj_get_FLAGS(current) & mask; (gdb) p mask $1 = 17825792 (gdb) p current $2 = (PMC *) 0x0 (gdb) p arena_base->dod_mark_start $3 = (PMC *) 0x819cef4 (gdb) bt #0 0x281c0ad7 in Parrot_dod_trace_children (interp=0x8106040, how_many=4294966630) at src/gc/dod.c:399 #1 0x281c0a74 in trace_active_PMCs (interp=0x8106040, trace_stack=1) at src/gc/dod.c:362 #2 0x281c15a7 in Parrot_dod_ms_run (interp=0x8106040, flags=1) at src/gc/dod.c:1140 #3 0x281c16aa in Parrot_do_dod_run (interp=0x8106040, flags=1) at src/gc/dod.c:1190 #4 0x281c2f78 in more_traceable_objects (interp=0x8106040, pool=0x815e150) at src/gc/smallobject.c:163 #5 0x281c305a in gc_ms_get_free_object (interp=0x8106040, pool=0x815e150) at src/gc/smallobject.c:245 #6 0x281c6023 in new_pmc_header (interp=0x8106040, flags=0) at src/headers.c:322 #7 0x281f9f86 in get_new_pmc_header (interp=0x8106040, base_type=36, flags=0) at src/pmc.c:267 #8 0x281fa15c in pmc_new_init (interp=0x8106040, base_type=36, init=0x81fdb88) at src/pmc.c:367 #9 0x2837adec in Parrot_Hash_get_iter (interp=0x8106040, pmc=0x81fdb88) at hash.pmc:581 #10 0x28203fdd in pt_ns_clone (d=0x8106260, dest_ns=0x877cb88, s=0x8106040, source_ns=0x81fdb88) at src/thread.c:550 #11 0x28204104 in pt_ns_clone (d=0x8106260, dest_ns=0x86237b4, s=0x8106040, source_ns=0x819d7b4) at src/thread.c:566 #12 0x28204104 in pt_ns_clone (d=0x8106260, dest_ns=0x86237d0, s=0x8106040, source_ns=0x819d7d0) at src/thread.c:566 #13 0x28204228 in pt_clone_globals (d=0x8106260, s=0x8106040) at src/thread.c:599 #14 0x2832a855 in clone_interpreter (d=0x8106260, s=0x8106040, flags=127) at parrotinterpreter.pmc:137 #15 0x2832cefe in do_thread_run (interp=0x8106040, thread=0x835d6a8, clone_flags=127, sub=0x835f75c, args=0x835a014) at parrotthread.pmc:65 #16 0x2832cffe in do_thread_run_clone_default (interp=0x8106040, thread=0x835d6a8, sub=0x835f75c, args=0x835a014) at parrotthread.pmc:82 #17 0x281d937d in pcf_I_JOPxAT_ (interp=0x8106040, self=0x81fefc4) at src/nci.c:983 #18 0x28340462 in Parrot_NCI_invoke (interp=0x8106040, pmc=0x81fefc4, next=0x8382824) at nci.pmc:308 #19 0x2816d1e0 in Parrot_callmethodcc_p_sc (cur_opcode=0x8382818, interp=0x8106040) at object.ops:78 #20 0x281fab2c in runops_slow_core (interp=0x8106040, pc=0x8382818) at src/runops_cores.c:222 #21 0x281cd7d9 in runops_int (interp=0x8106040, offset=463) at src/interpreter.c:937 #22 0x281ce063 in runops (interp=0x8106040, offs=463) at src/inter_run.c:101 #23 0x281ce300 in runops_args (interp=0x8106040, sub=0x835f740, obj=0x81a1870, meth_unused=0x0, sig=0x28427e23 "vP", ap=0xbfbfe89c "$÷5\bž\005") at src/inter_run.c:236 #24 0x281ce43c in Parrot_runops_fromc_args (interp=0x8106040, sub=0x835f740, sig=0x28427e23 "vP") at src/inter_run.c:300 #25 0x281b8627 in Parrot_runcode (interp=0x8106040, argc=1, argv=0xbfbfe9ac) at src/embed.c:951 #26 0x28404622 in imcc_run_pbc (interp=0x8106040, obj_file=0, output_file=0x0, argc=1, argv=0xbfbfe9ac) at compilers/imcc/main.c:791 #27 0x28405012 in imcc_run (interp=0x8106040, sourcefile=0xbfbfeb04 "t/stm/runtime_4.pir", argc=1, argv=0xbfbfe9ac) at compilers/imcc/main.c:1079 #28 0x08048892 in main (argc=1, argv=0xbfbfe9ac) at src/main.c:61 (gdb) quit [219]# Here are the last comments from chromatic who helped me obtain a trace on IRC: Can you do one more thing from the frame where you p mask and p current? p arena_base->dod_mark_start (gdb) p arena_base->dod_mark_start $3 = (PMC *) 0x819cef4 Figured, but good to know. Thanks. There's a loop over all destroy-now PMCs in that function. Somehow, one of them in the linked list is NULL, and not the PMCNULL kind of NULL. It's not the first one in the linked list though, which is good to know. Hope this helps. I'm idling on
[perl #59410] [PATCH] CONTROL_LOOP_NEXT support for pct. Rakudo won't build, though.
# New Ticket Created by Stephen Weeks # Please include the string: [perl #59410] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59410 > This patch adds support for handling CONTROL_LOOP_NEXT exceptions in pct-generated for loops. It also adds a 'next' sub to both rakudo and cardinal. Cardinal's works fine, but with this patch, rakudo hangs while building. Specifically, on parrot -o perl6.pbc perl6.pir. I don't yet have time to track it down more than this beyond gdb always showing parrot somewhere inside imcc when I looked. I don't quite have time to track this down right now, but this is a desired feature for rakudo, so I'll put it here for now. >From 3a8fe82c992dac72a77df35a984a02db3808c372 Mon Sep 17 00:00:00 2001 From: Stephen Weeks <[EMAIL PROTECTED]> Date: Sat, 27 Sep 2008 01:14:22 -0600 Subject: [PATCH] [pct] * Generate an exception handler for CONTROL_LOOP_NEXT exceptions in for loops [perl6] * Add a 'next' sub to throw CONTROL_LOOP_NEXT exceptions [cardinal] * Add a 'next' sub to throw CONTROL_LOOP_NEXT exceptions --- MANIFEST|1 + compilers/pct/src/PAST/Compiler.pir | 21 + include/parrot/exceptions.h |6 +- languages/cardinal/config/makefiles/root.in |1 + languages/cardinal/src/builtins/control.pir | 17 + languages/cardinal/src/parser/actions.pm|5 - languages/cardinal/t/07-loops.t | 15 --- languages/perl6/src/builtins/control.pir| 11 +++ 8 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 languages/cardinal/src/builtins/control.pir diff --git a/MANIFEST b/MANIFEST index c5a5c64..c94b2a7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1216,6 +1216,7 @@ languages/c99/t/spi.t [c99] languages/cardinal/cardinal.pir [cardinal] languages/cardinal/config/makefiles/root.in [cardinal] languages/cardinal/src/builtins/cmp.pir [cardinal] +languages/cardinal/src/builtins/control.pir [cardinal] languages/cardinal/src/builtins/eval.pir[cardinal] languages/cardinal/src/builtins/globals.pir [cardinal] languages/cardinal/src/builtins/guts.pir[cardinal] diff --git a/compilers/pct/src/PAST/Compiler.pir b/compilers/pct/src/PAST/Compiler.pir index 6eec545..f5ddbe4 100644 --- a/compilers/pct/src/PAST/Compiler.pir +++ b/compilers/pct/src/PAST/Compiler.pir @@ -1125,24 +1125,31 @@ by C. $P0 = get_hll_global ['POST'], 'Ops' ops = $P0.'new'('node'=>node) -.local pmc looplabel, endlabel +.local pmc looplabel, nextlabel, endlabel $P0 = get_hll_global ['POST'], 'Label' $S0 = self.'unique'('for_') looplabel = $P0.'new'('result'=>$S0) -$S0 = concat $S0, '_end' -endlabel = $P0.'new'('result'=>$S0) +$S1 = concat $S0, '_next' +nextlabel = $P0.'new'('result'=>$S1) +$S2 = concat $S0, '_end' +endlabel = $P0.'new'('result'=>$S2) .local pmc collpast, collpost collpast = node[0] collpost = self.'as_post'(collpast, 'rtype'=>'P') ops.'push'(collpost) -.local string iter +.local string iter, next_handler iter = self.'uniquereg'('P') ops.'result'(iter) $S0 = self.'uniquereg'('I') ops.'push_pirop'('defined', $S0, collpost) ops.'push_pirop'('unless', $S0, endlabel) +next_handler = self.'uniquereg'('P') +ops.'push_pirop'('new', next_handler, "'ExceptionHandler'") +ops.'push_pirop'('set_addr', next_handler, nextlabel) +ops.'push_pirop'('callmethod', 'handle_types', next_handler, .CONTROL_LOOP_NEXT) +ops.'push_pirop'('push_eh', next_handler) ops.'push_pirop'('iter', iter, collpost) ops.'push'(looplabel) ops.'push_pirop'('unless', iter, endlabel) @@ -1183,7 +1190,13 @@ by C. ops.'push'(subpost) ops.'push_pirop'('call', subpost, arglist :flat) ops.'push_pirop'('goto', looplabel) +ops.'push'(nextlabel) +ops.'push_pirop'('.local pmc exception') +ops.'push_pirop'('.get_results (exception)') +ops.'push_pirop'('set', next_handler, 0) +ops.'push_pirop'('goto', looplabel) ops.'push'(endlabel) +ops.'push_pirop'('pop_eh') .return (ops) .end diff --git a/include/parrot/exceptions.h b/include/parrot/exceptions.h index cab79aa..6363c4e 100644 --- a/include/parrot/exceptions.h +++ b/include/parrot/exceptions.h @@ -88,7 +88,11 @@ typedef enum { CONTROL_BREAK, CONTROL_CONTINUE, CONTROL_ERROR, -CONTROL_TAKE +CONTROL_TAKE, + +CONTROL_LOOP_NEXT, +CONTROL_LOOP_LAST, +CONTROL_LOOP_REDO } exception_type_enum; /* &end_gen */ diff --git a/languages/cardinal/config/makefiles/root.in b/languages/cardinal/config/makefiles/root.in index b94b8b9..99e011c 100644
[perl #59472] [TODO] Randomize hash seed
# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #59472] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59472 > In src/hash.c:816 there is a TODO comment: /* TODO randomize */ hash->seed = 3793; This needs to be investigated and probably implemented.
[perl #59544] open(null) kills parrot
# New Ticket Created by I Sop # Please include the string: [perl #59544] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59544 > (I'd expect an exception to be raised instead.) PIR code: ..sub 'foo' :main $S0 = null $P0 = open $S0, '<' ..end output: src/string.c:2106: failed assertion 's' Backtrace - Obtained 15 stack frames (max trace depth is 32). (unknown) Parrot_confess string_to_cstring Parrot_open_p_s_sc (unknown) (unknown) (unknown) (unknown) Parrot_runops_fromc_args Parrot_runcode (unknown) imcc_run (unknown) __libc_start_main (unknown) Aborted
[perl #59532] say typeof(namespace) gives a segfault
# New Ticket Created by I Sop # Please include the string: [perl #59532] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59532 > The following PIR code causes a segfault: ..sub 'foo' :main $P0 = get_namespace # this works: #$S0 = typeof $P0 #say $S0 $P1 = typeof $P0 say $P1 ..end --- Summary of my parrot 0.7.1 (r31549) configuration: configdate='Wed Oct 1 16:58:11 2008 GMT' Platform: osname=linux, archname=i486-linux-gnu-thread-multi jitcapable=1, jitarchname=i386-linux, jitosname=LINUX, jitcpuarch=i386 execcapable=1 perl=/usr/bin/perl Compiler: cc='cc', ccflags='-D_REENTRANT -D_GNU_SOURCE -DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wlogical-op -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -DHAS_GETTEXT', Linker and Libraries: ld='cc', ldflags=' -L/usr/local/lib', cc_ldflags='', libs='-ldl -lm -lpthread -lcrypt -lrt ' Dynamic Linking: share_ext='.so', ld_share_flags='-shared -O2 -g -L/usr/local/lib -fPIC', load_ext='.so', ld_load_flags='-shared -O2 -g -L/usr/local/lib -fPIC' Types: iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4, ptrsize=4, ptr_alignment=1 byteorder=1234, nv=double, numvalsize=8, doublesize=8
[perl #59542] null hash keys give segfault
# New Ticket Created by I Sop # Please include the string: [perl #59542] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59542 > maybe a duplicate of #43485 PIR code to reproduce: ..sub 'foo' :main $S0 = null $P0 = new 'Hash' # no crash without next line $P0['yum'] = 5 $P1 = $P0[$S0] ..end
[perl #59546] [PATCH] Combine hash exists/get into a new opcode (5% performance gain)
# New Ticket Created by Nick Glencross # Please include the string: [perl #59546] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59546 > Hi All, This patch adds two new opcodes which allow a hash "exists" and "get" to be performed together, which we can use in the OO subsystem to achieve a (roughly) 5% performance improvement (tested on the perl6 build and november). A 'make realclean' appears to be needed after applying the patch. Regards, Nick Patch which combines hash "exists" and "get" calls into a new op code internally, giving a 5% performance increase on some real-world code. Index: src/vtable.tbl === --- src/vtable.tbl (revision 31552) +++ src/vtable.tbl (working copy) @@ -61,6 +61,10 @@ PMC* get_pmc_keyed_str(STRING* key) PMC* slice(PMC* key, INTVAL flag) +# These variants perform exists/get in a single operation for efficiency +INTVAL get_integer_keyed_str_exists(STRING* key, INTVAL* exists) +PMC* get_pmc_keyed_str_exists(STRING* key, INTVAL* exists) + void* get_pointer() void* get_pointer_keyed(PMC* key) void* get_pointer_keyed_int(INTVAL key) Index: src/oo.c === --- src/oo.c (revision 31552) +++ src/oo.c (working copy) @@ -331,14 +331,18 @@ { Parrot_Class_attributes * const _class = PARROT_CLASS(classobj); -if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name)) -return VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name); -else { +INTVAL exists; + +PMC* result = VTABLE_get_pmc_keyed_str_exists(interp, +_class->parent_overrides, name, &exists); + +if (!exists) { /* Walk and search for the vtable method. */ const INTVAL num_classes = VTABLE_elements(interp, _class->all_parents); -PMC *result = PMCNULL; INTVAL i; +result = PMCNULL; + for (i = 0; i < num_classes; i++) { /* Get the class. */ PMC * const cur_class = @@ -352,9 +356,10 @@ } VTABLE_set_pmc_keyed_str(interp, _class->parent_overrides, name, result); +} -return result; -} + +return result; } @@ -1301,7 +1306,7 @@ "A conflict occurred during role composition " "due to method '%S'.", method_name); -/* What about a conflict with ourslef? */ +/* What about a conflict with ourself? */ if (VTABLE_exists_keyed_str(interp, proposed_add_methods, method_name)) /* Something very weird is going on. */ Index: src/pmc/object.pmc === --- src/pmc/object.pmc (revision 31552) +++ src/pmc/object.pmc (working copy) @@ -31,12 +31,16 @@ INTVAL cur_hll = CONTEXT(interp)->current_HLL; int num_classes, i; +INTVAL exists, retval; + CONTEXT(interp)->current_HLL = 0; /* First see if we can find it in the cache. */ -if (VTABLE_exists_keyed_str(interp, _class->attrib_cache, name)) { -INTVAL retval = -VTABLE_get_integer_keyed_str(interp, _class->attrib_cache, name); +retval = +VTABLE_get_integer_keyed_str_exists(interp, _class->attrib_cache, name, + &exists); + + if (exists) { CONTEXT(interp)->current_HLL = cur_hll; return retval; } @@ -46,6 +50,8 @@ num_classes = VTABLE_elements(interp, _class->all_parents); for (i = 0; i < num_classes; i++) { +INTVAL index; + /* Get the class and its attribute metadata hash. */ PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i); @@ -55,10 +61,11 @@ fq_name = string_append(interp, fq_name, name); /* Look up. */ -if (VTABLE_exists_keyed_str(interp, _class->attrib_index, fq_name)) { -/* Found it. Get value, cache it and we're done. */ -const INTVAL index = VTABLE_get_integer_keyed_str(interp, -_class->attrib_index, fq_name); +index = VTABLE_get_integer_keyed_str_exists(interp, +_class->attrib_index, fq_name, &exists); + +if (exists) { +/* Found it. Cache value and we're done. */ VTABLE_set_integer_keyed_str(interp, _class->attrib_cache, name, index); @@ -83,6 +90,8 @@ _class->attrib_cache, VTABLE_get_string(interp, key)); PMC *parent_class; STRING *fq_name; +INTVAL exists; +int index; if (!PMC_IS_NULL(class_cache)) if (VTABLE_exists_keyed_str(interp, class_cache, name)) @@ -334,6 +343,7 @@ int alien_parents_pos = VTABLE_el
[perl #59576] [PATCH] 'property' scope for PAST::Var
# New Ticket Created by I Sop # Please include the string: [perl #59576] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59576 > I just copied the 'attribute' method, renamed everything, and changed the parameter order for the 'getprop' op. Index: src/PAST/Compiler.pir === --- src/PAST/Compiler.pir (revision 31566) +++ src/PAST/Compiler.pir (working copy) @@ -1927,7 +1927,53 @@ .return $P0.'new'(call_on, name, bindpost, 'pirop'=>'setattribute', 'result'=>bindpost) .end + +.sub 'property' :method :multi(_, ['PAST::Var']) +.param pmc node +.param pmc bindpost +.local string name +$P0 = get_hll_global ['POST'], 'Ops' +name = node.'name'() +name = self.'escape'(name) + +.local int isdecl +isdecl = node.'isdecl'() + +.local pmc call_on, ops +call_on = node[0] +if null call_on goto use_self +call_on = self.'as_post'(call_on, 'rtype'=>'P') +ops = call_on +goto invocant_done + use_self: +call_on = new 'String' +call_on = 'self' +ops = $P0.'new'('node'=>node) + invocant_done: + +if bindpost goto property_bind + + property_post: +if isdecl goto property_decl +.local pmc fetchop, storeop +$P0 = get_hll_global ['POST'], 'Op' +fetchop = $P0.'new'(ops, name, call_on, 'pirop'=>'getprop') +storeop = $P0.'new'(call_on, name, ops, 'pirop'=>'setprop') +.return self.'vivify'(node, ops, fetchop, storeop) + + property_decl: +.return $P0.'new'('node'=>node) + + property_bind: +$P0 = get_hll_global ['POST'], 'Op' +if isdecl goto property_bind_decl +.return $P0.'new'(call_on, name, bindpost, 'pirop'=>'setprop', 'result'=>bindpost) + property_bind_decl: +.return $P0.'new'(call_on, name, bindpost, 'pirop'=>'setprop', 'result'=>bindpost) +.end + + .sub 'register' :method :multi(_, ['PAST::Var']) .param pmc node .param pmc bindpost
[perl #59600] [PATCH] Require Storable 2.13 indirectly by requiring perl 5.8.6
# New Ticket Created by Will Coleda # Please include the string: [perl #59600] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59600 > This is a patch-response to r31585, which required a particular version of Storable in one file. Attached, find a patch which bumps our core perl requirement to 5.8.6, the first time this particular version of Storable was included as a core module (`corelist -a Storable`). It: - updates every use/require to be "use 5.8.6;", avoiding any attempt at backward compatibility. [0] - updates the docs where appropriate (including NEWS) - updates files in languages/ too. - avoids updating anything in lib/Pod/Simple* - removes the specific version requirement for Storable introduced in r31585. We've been talking about doing this bump to avoid this problem for some time. I'd rather fail during the initial attempt to run configure than have someone with 5.8.0 -then- fail by missing the Storable requirement below. All (core) tests pass. [0] Many of these checks are probably unnecessary in the first place if we enforce this in Configure.pl, and ripping them out would allow us to simplify things the next time we had to do this. Doesn't need to be done for this version to get applied. -- Will "Coke" Coleda Index: docs/faq.pod === --- docs/faq.pod (revision 31589) +++ docs/faq.pod (working copy) @@ -45,7 +45,7 @@ =head2 What language is Parrot written in? -While much of the build system currently uses perl 5.8.0, the parrot +While much of the build system currently uses perl 5.8.6, the parrot runtime is C89. =head2 Why register-based and not stack-based? Index: docs/pdds/pdd07_codingstd.pod === --- docs/pdds/pdd07_codingstd.pod (revision 31589) +++ docs/pdds/pdd07_codingstd.pod (working copy) @@ -75,9 +75,9 @@ =item * -Perl code must be written for Perl 5.8.0 and all later versions. +Perl code must be written for Perl 5.8.6 and all later versions. -Perl code may use features not available in Perl 5.8.0 only if it is not vital +Perl code may use features not available in Perl 5.8.6 only if it is not vital to Parrot, and if it uses C<$^O> and C<$]> to degrade or fail gracefully when it is run where the features it depends on are not available. Index: docs/gettingstarted.pod === --- docs/gettingstarted.pod (revision 31589) +++ docs/gettingstarted.pod (working copy) @@ -60,7 +60,7 @@ =head2 Now that I've got Parrot, what do I do? Now that you've downloaded Parrot, you probably want to try it out. All you -need is Perl 5.8.0 or later, a C compiler (any ANSI C compliant compiler +need is Perl 5.8.6 or later, a C compiler (any ANSI C compliant compiler should do - if you find one that doesn't work, please report it to us), and some reasonable form of C. To do this, follow these three easy steps. Index: ext/Parrot-Embed/tools/check_embed_coverage.pl === --- ext/Parrot-Embed/tools/check_embed_coverage.pl (revision 31589) +++ ext/Parrot-Embed/tools/check_embed_coverage.pl (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use 5.008; +use 5.8.6; use Getopt::Long; Index: tools/dev/nopaste.pl === --- tools/dev/nopaste.pl (revision 31589) +++ tools/dev/nopaste.pl (working copy) @@ -3,7 +3,7 @@ # Copyright (C) 2008, The Perl Foundation. # $Id$ -use 5.008; +use 5.8.6; use strict; use warnings; Index: tools/dev/nm.pl === --- tools/dev/nm.pl (revision 31589) +++ tools/dev/nm.pl (working copy) @@ -138,7 +138,7 @@ use vars qw($VERSION); -require 5.005; +use 5.8.6; $VERSION = sprintf "%d.%d", q$Revision$ =~ /(\d+)/g;# [EMAIL PROTECTED]; Index: tools/dev/pbc_header.pl === --- tools/dev/pbc_header.pl (revision 31589) +++ tools/dev/pbc_header.pl (working copy) @@ -5,7 +5,7 @@ use strict; use warnings; -use 5.008; +use 5.8.6; =head1 NAME Index: tools/dev/reconfigure.pl === --- tools/dev/reconfigure.pl (revision 31589) +++ tools/dev/reconfigure.pl (working copy) @@ -3,7 +3,7 @@ # Copyright (C) 2007, The Perl Foundation. # $Id$ -use 5.008; +use 5.8.6; use strict; use warnings; use lib 'lib'; Index: tools/dev/svnclobber.pl === --- tools/dev/svnclobber.pl (revision 31589) +++ tools/dev/svnclobber.pl (working copy) @@ -29,7 +29,7 @@ use strict; use warnings; -use 5.008; +use 5.8.6; use File::Find (); Index: tools/dev/mk_language_shell.pl ===
[perl #59590] Parse Error for 'make splint'
# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #59590] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59590 > When fiddling with 'make splint' I ran into a Splint parse error: src/exceptions.c:500:25: Variable size initialized to type int, expects size_t: backtrace(array, 32) src/exceptions.c:503:36: Unrecognized format code: %zd stack frames (max trace depth is %d).\n src/exceptions.c:507:17: Unrecognized identifier: Dl_info src/exceptions.c:507:26: Parse Error. (For help on parse errors, see splint -help parseerrors.) *** Cannot continue. < cleaning .. > make: *** [splint] Fehler 1 [EMAIL PROTECTED]:~/devel/Parrot/trunk$ splint help version Splint 3.1.1 --- 03 Nov 2006 Maintainer: [EMAIL PROTECTED] Compiled using i486-linux-gnu-gcc -g -O2 on Linux palmer 2.6.15.7 #1 SMP Thu Sep 7 19:42:20 UTC 2006 i686 GNU/Linux by buildd [EMAIL PROTECTED]:~/devel/Parrot/trunk$ uname -a Linux heist 2.6.24-19-generic #1 SMP Wed Aug 20 22:56:21 UTC 2008 i686 GNU/Linux [EMAIL PROTECTED]:~/devel/Parrot/trunk$ gcc --version gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7) Copyright (C) 2007 Free Software Foundation, Inc. Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es gibt KEINE Garantie; auch nicht für MARKTGÄNGIGKEIT oder FÜR SPEZIELLE ZWECKE. 'dladdr()' and 'Dl_info' seem to be not in POSIX, but seem to be a common extension. I tried passing '+gnu-extensions' on the splint command line, but that didn't help. I also tried to define the missing type Dl_info with a preprocessor directive, but that didn't help either. SPLINTFLAGS_TEST = \ +posixlib -DDl_info="struct { const char *dli_fname; void *dli_fbase; const char *dli_sname; void *dli_saddr; }" \
[perl #59614] Wrong PC/line reported in handler arg-passing error
# New Ticket Created by Bob Rogers # Please include the string: [perl #59614] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59614 > Invoking the attached test case fails in the following way: [EMAIL PROTECTED]> ./parrot test-exception-pc.pir too few arguments passed (1) - 2 params expected current instr.: 'main' pc 9 (test-exception-pc.pir:3) [EMAIL PROTECTED]> The problem is that pc 9/line 3 is the location of the invokecc instruction that calls the erring test sub, not the location of the get_results instruction where the problem is detected. I'm not sure how to fix this, because it messes greatly with the modularity of how return addresses are tracked. But I think it really ought to be fixed before the next release -- that or the arg-checking requirement for exception handlers should be relaxed, at least temporarily. I stumbled onto this when Kea-CL fell afoul of the exception handling arg change introduced in r31294 (about which I don't recall seeing any mention on the list). Because of the misplaced error message, it took me a while to track it down. -- Bob .sub main :main push_eh handler test() ## NB: This makes sure the sub call PC is sufficiently ## different from the exception handler PC. print "foo\n" print "bar\n" .return () handler: .local pmc exception .local string message .get_results (exception, message) print "Error: " print message .end .sub test ## Throw an exception. $P0 = new 'Exception' $P0 = 'oops' throw $P0 .end
[perl #59660] Storable-2.13 requirement breaks build on OpenSolaris
# New Ticket Created by Andy Dougherty # Please include the string: [perl #59660] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59660 > Trying to compile today's parrot on an up-to-date version of OpenSolaris: SunOS xxx 5.11 snv_98 i86pc i386 i86pc Solaris it failed (after a while) with the following error: perl tools/build/pmc2c.pl --vtable Storable version 2.13 required--this is only version 2.12 at /export/home/doughera/src/parrot/parrot-cc/tools/build/../../lib/Parrot/Pmc2c/Pmc2cMain.pm line 6. BEGIN failed--compilation aborted at /export/home/doughera/src/parrot/parrot-cc/tools/build/../../lib/Parrot/Pmc2c/Pmc2cMain.pm line 6. Compilation failed in require at tools/build/pmc2c.pl line 10. BEGIN failed--compilation aborted at tools/build/pmc2c.pl line 10. make: *** [vtable.dump] Error 2 The problem is that OpenSolaris ships with (a patched version of) perl-5.8.4. I'm not sure why OpenSolaris is still shipping perl-5.8.4, but they are. I haven't looked at tools/build/pmc2c.pl at all to see why Storable 2.13 is required, nor at how large of a burden it would be to relax that requirement. Such digging would take more time than I have available at the moment. -- Andy Dougherty [EMAIL PROTECTED]
[perl #59680] Build error: tools/build/ops2pm.pl: Could not mkdir /home/moritz/src/parrot/lib/Parrot/OpLib: File exists!
# New Ticket Created by Moritz Lenz # Please include the string: [perl #59680] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59680 > I've just updated from r31667 to HEAD (r31745), and ran my usual build incantation: $ make realclean; perl Configure --cc='ccache gcc' && make -j 2 test This time it died: find_sub_not_null_p_s 1391 experimental, not in ops.num find_sub_not_null_p_sc1392 experimental, not in ops.num tools/build/ops2pm.pl: Could not mkdir /home/moritz/src/parrot/lib/Parrot/OpLib: File exists! make: *** [include/parrot/oplib/ops.h] Error 17 make: *** Waiting for unfinished jobs Running 'make realclean' again solved the problem, but I think this should never be necessary. Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/
[perl #59658] Build failure in src/pmc/float.c -- non-constant intiializer
# New Ticket Created by Andy Dougherty # Please include the string: [perl #59658] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59658 > Trying to compile today's parrot on: SunOS xxx 5.8 Generic_117350-02 sun4u sparc SUNW,Ultra-5_10 with Sun's compiler: cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2 it failed with the following errors: src/pmc/float.c "/home/doughera/src/parrot/parrot-cc/tools/build/../../lib/Parrot/Pmc2c/PCCMETHOD.pm", line 465: warning: statement not reached [ repeated 17 times ] "./src/pmc/float.c", line 3340: non-constant initializer: op "U*" "./src/pmc/float.c", line 3341: non-constant initializer: op "U*" "./src/pmc/float.c", line 3342: non-constant initializer: op "U*" [ 21 more similar errors ] "./src/pmc/float.c", line 3454: cannot recover from previous errors Looking at src/pmc/float.c, the first lines in question are: const multi_func_list _temp_multi_func_list[] = { { CONST_STRING(interp, "is_equal"),/* line 3340 */ CONST_STRING(interp, "IJPP"),/* line 3341 */ CONST_STRING(interp, "Float,Float"), /* line 3342 */ (funcptr_t) Parrot_Float_multi_is_equal_Float }, which ultimately expand to: const multi_func_list _temp_multi_func_list[] = { { ( interp ) -> const_cstring_table [ 515 ], ( interp ) -> const_cstring_table [ 84 ], ( interp ) -> const_cstring_table [ 639 ], (funcptr_t) Parrot_Float_multi_is_equal_Float }, which indeed are non-constant initializers. GNU cc accepts this, as do more modern compilers from Sun (such as version 5.9). I'm guessing it's a C99 thing, but I don't actually know. What to do about it? I suppose I could go in and rewrite those statements (and similar ones that crop up in other PMCs) but I certainly won't have any time to do that any time soon. Should anyone care? It's certainly an old compiler, but it's the only Sun compiler I have available on SPARC, and SPARC has often been a very helpful platform for debugging alignment and endian issues in parrot. -- Andy Dougherty [EMAIL PROTECTED]
[perl #59704] [BUG] Integer pow vtable promotes to float.
# New Ticket Created by Will Coleda # Please include the string: [perl #59704] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59704 > .sub main :main $P1 = new 'Integer' $P1 = 2 $P2 = new 'Integer' $P2 = 3 $P3 = $P1 ** $P2 $S0 = typeof $P3 say $S0 $P3 = $P1 ** 3 $S0 = typeof $P3 say $S0 .end generates "Float\nInteger", I'm pretty sure that before the MMD merge it would have been "Integer\nInteger". I've TODO'd some partcl tests until this is resolved. -- Will "Coke" Coleda
[perl #59686] [CAGE] Review t/pmc/ro.t - improve error testing
# New Ticket Created by Allison Randal # Please include the string: [perl #59686] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59686 > In fixing the Complex PMC in r31749, I revealed a problem in our read-only PMC tests. In t/pmc/ro.t, test 5 gets an error as expected, but the error it gets complains that add_p_ic_p doesn't exist (it hasn't existed for years, if ever). So, test 5 isn't actually testing anything useful. I'm a bit suspicious about the whole test file now, because it's not testing for the actual text of the error message, it's just testing that it got *some* error. The cage task is to review the test file and improve the error testing, so that if the read-only error is masked by some other error, the tests will fail. One possible direction is to use exception handlers to trap the read-only exceptions inside the tests, instead of just relying on the exit code. Allison
[perl #59696] [TODO] Unimplemented Unicode Functions
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #59696] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59696 > There are several functions in src/charset/unicode.c that are not implemented yet. These include: decompose downcase_first upcase_first titlecase_first cs_rindex These functions should probably all be implemented eventually. --Andrew Whitworth
[perl #59694] [TODO] src/charset/unicode.c:decompose
# New Ticket Created by Andrew Whitworth # Please include the string: [perl #59694] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59694 > The decompose function in src/charset/unicode.c is not yet implemented. It probably should be eventually. --Andrew Whitworth
[perl #59732] [BUG] rakudo segfaults when loaded from an embedded environment
# New Ticket Created by Jeff Horwitz # Please include the string: [perl #59732] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59732 > r31757 and r31758 cause mod_perl6 and any other embedding app to segfault when loading perl6.pbc. all is well if i revert those individual revs from my working copy. platform is debian, gcc 4.1.2 the following test program produces this segfault on r31798 (run in parrot source dir or set PARROT_RUNTIME): Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1083020992 (LWP 6603)] 0x401d1e68 in interpinfo_s (interp=0x804a008, what=19) at src/inter_misc.c:356 356 return VTABLE_get_string(interp, foo.c: /* gcc -o foo -g -I/home/jeff/build/parrot/include foo.c \ * -Wl,-rpath=/home/jeff/build/parrot/blib/lib \ * -L/home/jeff/build/parrot/blib/lib -lparrot */ #include #include #include int main(int argc, char* argv[]) { Parrot_Interp interp, interp2; Parrot_PackFile pf; Parrot_String str; interp = Parrot_new(NULL); if (!interp) { return 1; } pf = PackFile_new_dummy(interp, "test"); str = string_from_literal(interp, "languages/perl6/perl6.pbc"); Parrot_load_bytecode(interp, str); Parrot_exit(interp, 0); return 0; }
[perl #59722] [TODO] implement rest of sysinfo_s code
# New Ticket Created by Jerry Gay # Please include the string: [perl #59722] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59722 > currently, the sysinfo_s op, implemented in src/inter_misc.c, is incomplete: PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT STRING * sysinfo_s(PARROT_INTERP, INTVAL info_wanted) { switch (info_wanted) { case PARROT_OS: return const_string(interp, BUILD_OS_NAME); case PARROT_OS_VERSION: case PARROT_OS_VERSION_NUMBER: case CPU_ARCH: case CPU_TYPE: default: return CONST_STRING(interp, ""); } } one effect of this partial implementation is that the $*OSVER variable in rakudo always contains the empty string. ~jerry
[perl #59742] postgres.pir creates exception the wrong way
# New Ticket Created by Hans Dieter Pearcey # Please include the string: [perl #59742] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59742 > When libpq can't be loaded, this unhelpful message appears: No such string attribute '0' the attached patch fixes that. hdp. Index: runtime/parrot/library/postgres.pir === --- runtime/parrot/library/postgres.pir (revision 31812) +++ runtime/parrot/library/postgres.pir (working copy) @@ -8,7 +8,7 @@ loadlib $P1, 'cygpq' if $P1 goto has_lib $P2 = new 'Exception' -$P2[0] = 'error loading libpg - loadlib failed' +$P2 = 'error loading libpq - loadlib failed' throw $P2 has_lib: dlfunc $P2, $P1, 'PQconnectStart', 'pt'
[perl #59782] [PATCH] add pmc_cmp VTABLE function
# New Ticket Created by Christoph Otto # Please include the string: [perl #59782] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59782 > In response to a question about comparison operators in Pipp*, Allison suggested that I add a variant cmp VTABLE function which returns a PMC instead of an INTVAL. This patch adds such a function, named pmc_cmp. It's named pmc_cmp rather than cmp_pmc to try to avoid confusion with the other cmp_* functions, since the type name in this function name refers to the return type rather than the argument type. The patch should be simple enough to be obviously correct and doesn't cause any new test failures. Comments would be appreciated. * http://irclog.perlgeek.de/parrotsketch/2008-10-07#i_609226 Index: src/vtable.tbl === --- src/vtable.tbl (revision 31855) +++ src/vtable.tbl (working copy) @@ -273,6 +273,7 @@ INTVAL cmp(PMC* value) INTVAL cmp_num(PMC* value) INTVAL cmp_string(PMC* value) +PMC* pmc_cmp(PMC* value) PMC* logical_or(PMC* value, PMC* dest) Index: src/pmc/default.pmc === --- src/pmc/default.pmc (revision 31855) +++ src/pmc/default.pmc (working copy) @@ -2488,6 +2488,29 @@ /* +=item C + +Default fallback. Performs a multiple dispatch call for 'pmc_cmp'. + +=cut + +*/ + +VTABLE PMC *pmc_cmp(PMC *value) { +PMC *retval; + +/* Don't multidispatch if you've got two pointers to the same PMC. They + * are equal. */ +if (SELF == value) +return 0; + +Parrot_mmd_multi_dispatch_from_c_args(interp, +"pmc_cmp", "PP->P", SELF, value, &retval); + +return retval; +} +/* + =item C Default fallback. Performs a multiple dispatch call for 'logical_or'. Index: tools/dev/vtablize.pl === --- tools/dev/vtablize.pl (revision 31855) +++ tools/dev/vtablize.pl (working copy) @@ -220,6 +220,7 @@ s/^(\s*)(INTVAL\s+cmp\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(INTVAL\s+cmp_num\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(INTVAL\s+cmp_string\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/; +s/^(\s*)(INTVAL\s+pmc_cmp\(PMC\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(PMC\s+\*logical_or\(PMC\s+\*\w*,\s+PMC\s+\*\w*\)\s+{)/$1VTABLE $2/; s/^(\s*)(PMC\s+\*logical_xor\(PMC\s+\*\w*,\s+PMC\s+\*\w*\)\s+{)/$2VTABLE $2/; s/^(\s*)(PMC\s+\*logical_and\(PMC\s+\*\w*,\s+PMC\s+\*\w*\)\s+{)/$1VTABLE $2/;
[perl #59784] [PATCH] Enhancement : support for multiple optables in PGE
# New Ticket Created by Florian Hatat # Please include the string: [perl #59784] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59784 > Hi, PGE currently only supports one operator table, while some languages (for example the OCaml language, which has "type expressions") may need more than one. This patch updates Per6Grammar.pir to add support for multiple optables: each rule with the option "is optable" now creates a new PGE::OPTable with a unique identifier (using the "unique" method of CodeString). In the generated "__onload" sub, the operators are still added to the tables using the single "optable" variable, which holds the latest defined optable. This implies that once a new optable is defined, the previous ones cannot be extended any more. The diff on the code itself is actually quite small: it was mainly a matter of moving some code around, and adding the unique identifier instead of the "$optable" static name. It contains an update for docs/pct/pct_optable_guide.pod as well. It was made against the 0.7.1 sources. -- Florian, http://openweb.eu.org/ http://www.linux-france.org/ --- runtime/parrot/library/PGE/Perl6Grammar.pir 2008-09-17 00:14:12.0 +0200 +++ runtime/parrot/library/PGE/Perl6Grammar.new 2008-10-10 12:57:53.0 +0200 @@ -192,8 +192,6 @@ ns_optable: $P0 = ns['optable'] if $P0 == '' goto iter_loop -initpir.emit(" optable = new 'PGE::OPTable'") -initpir.emit(" set_hll_global ['%0'], '$optable', optable", namespace) initpir .= $P0 goto iter_loop iter_end: @@ -290,16 +288,24 @@ goto with_rulepir rulepir_optable: ## this is a special rule generated via the 'is optable' trait +.local pmc optable +$P0 = nstable[namespace] +optable = $P0['optable'] +$S0 = optable.unique('optable_') + rulepir = new 'CodeString' -rulepir.emit(<<' END', namespace, name) +rulepir.emit(<<' END', namespace, name, $S0) .namespace [ "%0" ] .sub "%1" .param pmc mob .param pmc adverbs :named :slurpy -$P0 = get_hll_global ["%0"], "$optable" +$P0 = get_hll_global ["%0"], "$%2" .return $P0.'parse'(mob, 'rulename'=>"%1", adverbs :named :flat) .end END + +optable.emit(" optable = new 'PGE::OPTable'") +optable.emit(" set_hll_global ['%0'], '$%1', optable", namespace, $S0) with_rulepir: ## add to set of rules --- docs/pct/pct_optable_guide.pod 2008-09-17 00:14:34.0 +0200 +++ docs/pct/pct_optable_guide.new 2008-10-10 13:23:41.0 +0200 @@ -426,7 +426,22 @@ =item * How many operator tables can I use in my language? -{{ XXX I think one only? Anybody? }} +You can use as many operator tables as you like: each operator table is declared +in a rule, as above. Operators automatically belong to the last operator table +defined before their C rule. This means, in particular, that you cannot +add any more operator to an optable once you've started another optable. + +The following example defines two optables C and C, with some +operators: + + rule expr is optable { ... } + proto 'infix:+' is precedence('1') { ... } + proto 'infix:*' is tighter('infix:+') { ... } + proto 'term:' is tighter('infix:*') is parsed(&term) { ... } + + rule otherexpr is optable { ... } + proto 'infix:+' is precedence('1') + proto 'term:' is tighter('infix:+') is parsed(&otherterm) { ... } =item * How does an optable parser work? signature.asc Description: PGP signature
[perl #59810] [PATCH] store hash seed in parrot_string_t struct
# New Ticket Created by Christoph Otto # Please include the string: [perl #59810] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59810 > Calling string_hash with a seed value other than the one used in src/hash.c (3793) can cause strange and wonderful failures if the STRING is reused by imcc. What happens is that after the STRING's hash is computed, it's cached in s->hashval. This is works fine unless the first caller of string_hash on a given STRING uses a seed other than 3793 *and* the STRING is reused by imcc as a hash key. When this happens, the second call to string_hash sees a cached hash which was computed with an unexpected seed. When this STRING is used as a hash key, parrot_hash_get_bucket looks in the wrong bucket and fails to find the associated value. This leads to various levels of badness. In Pipp's case, it means that with the following PIR code, the lookup of the hypothetical do_stuff METHOD would fail because the STRING 'do_stuff' would be hashed by Parrot_PhpArray_get_string_keyed_str with an unexpected seed. p = new 'PhpArray' p['do_stuff'] = 'x' #caches an unexpected hash in s->hashval p.'do_stuff'() #method lookup fails with reused STRING 'do_stuff' Because string_hash is marked PARROT_API and presumably intended for external use, a caller should be able to call it with an arbitrary seed without messing up the rest of Parrot. The attached patch allows this by adding a seedval field to parrot_string_t and checking both the seedval and the hashval before returning the cached hashval of a STRING. I'd appreciate comments on whether this is the right approach and if there is anything the patch misses. Index: src/hash.c === --- src/hash.c (revision 31889) +++ src/hash.c (working copy) @@ -146,7 +146,7 @@ static size_t key_hash_STRING(PARROT_INTERP, ARGMOD(STRING *s), size_t seed) { -if (s->hashval) { +if (s->hashval && s->seedval == seed) { return s->hashval; } Index: src/string.c === --- src/string.c (revision 31889) +++ src/string.c (working copy) @@ -2245,6 +2245,7 @@ h = CHARSET_COMPUTE_HASH(interp, s, seed); s->hashval = h; +s->seedval = seed; return h; } Index: include/parrot/pobj.h === --- include/parrot/pobj.h (revision 31889) +++ include/parrot/pobj.h (working copy) @@ -124,6 +124,7 @@ UINTVAL bufused; UINTVAL strlen; UINTVAL hashval; /* cached hash value computation */ +size_t seedval; /* cached hash seed */ /*parrot_string_representation_t representation;*/ const struct _encoding *encoding; Index: docs/pdds/pdd28_strings.pod === --- docs/pdds/pdd28_strings.pod (revision 31889) +++ docs/pdds/pdd28_strings.pod (working copy) @@ -265,6 +265,7 @@ UINTVAL bufused; UINTVAL strlen; UINTVAL hashval; + size_tseedval; const struct _encoding *encoding; const struct _charset*charset; const struct _normalization *normalization; @@ -303,6 +304,12 @@ A cache of the hash value of the string, for rapid lookups when the string is used as a hash key. +=item seedval + +A cache of the seed used to compute the hash value of the string. This value +ensures that hashes computed with different seeds will not interfere with +eachother. + =item encoding How the data is encoded (e.g. fixed 8-bit characters, UTF-8, or UTF-32). Note
[perl #59816] TGE fails in r31893
# New Ticket Created by Will Coleda # Please include the string: [perl #59816] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59816 > After building parrot, cd compilers/tge && make test; Test Summary Report --- ../../t/compilers/tge/basic.t (Wstat: 256 Tests: 3 Failed: 1) Failed test: 1 Non-zero exit status: 1 ../../t/compilers/tge/grammar.t (Wstat: 512 Tests: 3 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 Files=3, Tests=8, 0 wallclock secs ( 0.00 usr 0.01 sys + 0.36 cusr 0.12 csys = 0.49 CPU) Result: FAIL make: *** [test] Error 1 -- Will "Coke" Coleda
[perl #59830] [PROPOSAL][PDD19] Split .line directive into separate .line and .file directives.
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #59830] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59830 > currently, the .line directive takes both an integer (for line number) and a string (for filename) argument. I propose to split these into a separate .line and .file directives, both only taking 1 argument. (much line #line and #file in the C preprocessor). kjs
[perl #59870] Tcl/Glob.pbc broken in head
# New Ticket Created by Will Coleda # Please include the string: [perl #59870] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59870 > Tcl/Glob (which happens to be used only by Tcl at the moment, but provides a glob-style interface that might be of use to other languages) is failing in trunk but isn't tested. Attached is a test file that works in r31835, but fails in r31925. The test and the library file should probably both be updated to avoid the :: as faux-namespace separator to match recent changes in other library items. There's no need for it to live in a top level Tcl namespace as the name currently implies; having it be "TclGlob" in a child namespace, for example, is fine. The tests aren't meant to be exhaustive; Should probably have more glob_isnt variants to prevent accidental inclusion of PGE::Glob features, but it at least covers the basics. Without (even an updated version of) this test working, partcl can't upgrade to svn-latest. Regards. -- Will "Coke" Coleda tcl_glob.t Description: Troff document
[perl #59862] [TODO][PIRC] Fix Makefile for compilers/pirc
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #59862] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59862 > Recently I updated config/gen/makefiles/pirc.in to generate a Makefile for the macro, heredoc preprocessors and the PIR parser. However, on windows things seem to go well, but on linux it doesn't. There's some problems when doing the linking. This needs to be fixed. It's probably something to do with the variable that defines the location/name of the [EMAIL PROTECTED]@ thing. kjs
[perl #59880] DOD crash in r31926, t/op/bitwise.t #27 on linux/x86_64
# New Ticket Created by Mark Glines # Please include the string: [perl #59880] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59880 > This GDB was configured as "x86_64-pc-linux-gnu"... (gdb) run t/op/bitwise_27.pir Starting program: /work/parrot-dev/parrot-trunk/parrot t/op/bitwise_27.pir [Thread debugging using libthread_db enabled] warning: Lowest section in /usr/lib64/libicudata.so.38 is .hash at 0190 [New Thread 0x7f59a97b7710 (LWP 32001)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f59a97b7710 (LWP 32001)] 0x7f59a910bb4b in pobject_lives (interp=0xc59080, obj=0x7f59a908a1ab) at src/gc/dod.c:206 206 PObj_live_SET(obj); (gdb) print obj $1 = (PObj *) 0x7fa8e10631ab (gdb) print *obj $2 = {cache = {_b = {_bufstart = 0x458b481c7ec08548, _buflen = 39204292909025512}, _ptrs = {_struct_val = 0x458b481c7ec08548, _pmc_val = 0x8b4818c08348e8}, _i = {_int_val = 5011178297602639176, _int_val2 = 39204292909025512}, _num_val = 1.0554090610765521e+27, _string_val = 0x458b481c7ec08548}, flags = 16741440331238654280} (gdb) bt #0 0x7f59a910bb4b in pobject_lives (interp=0xc59080, obj=0x7f59a908a1ab) at src/gc/dod.c:206 #1 0x7f59a92c75b9 in Parrot_CPointer_mark (interp=0xc59080, pmc=0xdb3de8) at ./src/pmc/cpointer.pmc:97 #2 0x7f59a910c0b0 in Parrot_dod_trace_children (interp=0xc59080, how_many=18446744073709550456) at src/gc/dod.c:429 #3 0x7f59a910be98 in trace_active_PMCs (interp=0xc59080, trace_stack=1) at src/gc/dod.c:362 #4 0x7f59a910cd47 in Parrot_dod_ms_run (interp=0xc59080, flags=1) at src/gc/dod.c:1140 #5 0x7f59a910ce56 in Parrot_do_dod_run (interp=0xc59080, flags=1) at src/gc/dod.c:1190 #6 0x7f59a910edac in more_traceable_objects (interp=0xc59080, pool=0xc5a750) at src/gc/smallobject.c:163 #7 0x7f59a910eec5 in gc_ms_get_free_object (interp=0xc59080, pool=0xc5a750) at src/gc/smallobject.c:245 #8 0x7f59a911239a in new_pmc_header (interp=0xc59080, flags=1024) at src/headers.c:322 #9 0x7f59a915af78 in get_new_pmc_header (interp=0xc59080, base_type=60, flags=1024) at src/pmc.c:267 #10 0x7f59a915abc3 in pmc_new (interp=0xc59080, base_type=60) at src/pmc.c:92 #11 0x7f59a9123e0d in Parrot_build_sig_object_from_varargs ( interp=0xc59080, sig=0x7f59a938fcec "PP->I", args=0x7fffb1954170) at src/multidispatch.c:468 #12 0x7f59a91245c6 in Parrot_mmd_multi_dispatch_from_c_args ( interp=0xc59080, name=0x7f59a938fcf2 "cmp", sig=0x7f59a938fcec "PP->I") at src/multidispatch.c:574 #13 0x7f59a92030b6 in Parrot_default_cmp (interp=0xc59080, pmc=0xd32730, value=0xdb3c28) at ./src/pmc/default.pmc:2447 #14 0x7f59a908a1ab in Parrot_gt_p_ic_ic (cur_opcode=0xdb3628, interp=0xc59080) at src/ops/cmp.ops:432 #15 0x7f59a915bc2f in runops_slow_core (interp=0xc59080, pc=0xdb3628) at src/runops_cores.c:222 #16 0x7f59a911bed4 in runops_int (interp=0xc59080, offset=0) at src/interpreter.c:937 #17 0x7f59a911c8c3 in runops (interp=0xc59080, offs=0) at src/inter_run.c:101 #18 0x7f59a911cb7a in runops_args (interp=0xc59080, sub=0xd338b0, obj=0xce6020, meth_unused=0x0, sig=0x7f59a9386cfb "vP", ap=0x7fffb1954440) at src/inter_run.c:236 #19 0x7f59a911cd6b in Parrot_runops_fromc_args (interp=0xc59080, sub=0xd338b0, sig=0x7f59a9386cfb "vP") at src/inter_run.c:300 #20 0x7f59a90fe81e in Parrot_runcode (interp=0xc59080, argc=1, argv=0x7fffb1954720) at src/embed.c:951 #21 0x7f59a935ff38 in imcc_run_pbc (interp=0xc59080, obj_file=0, ---Type to continue, or q to quit--- output_file=0x0, argc=1, argv=0x7fffb1954720) at compilers/imcc/main.c:791 #22 0x7f59a9360837 in imcc_run (interp=0xc59080, sourcefile=0x7fffb1955165 "t/op/bitwise_27.pir", argc=1, argv=0x7fffb1954720) at compilers/imcc/main.c:1079 #23 0x00400c64 in main (argc=1, argv=0x7fffb1954720) at src/main.c:61 (gdb) -- Mark
[perl #59886] Segfault in pcre.t
# New Ticket Created by Moritz Lenz # Please include the string: [perl #59886] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59886 > Hello, with r31926 the pcre.t tests fails due to a segfault: (gdb) run pcre.pir Starting program: /home/moritz/src/parrot/parrot pcre.pir [Thread debugging using libthread_db enabled] [New Thread -1232648512 (LWP 21873)] warning: Lowest section in /usr/lib/libicudata.so.36 is .hash at 00b4 ok 1 ok 2 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1232648512 (LWP 21873)] 0xb7d4881b in compact_pool (interp=0x90fd048, pool=0x90fda48) at src/gc/resources.c:475 475 memcpy(cur_spot, PObj_bufstart(b), PObj_buflen(b )); (gdb) bt #0 0xb7d4881b in compact_pool (interp=0x90fd048, pool=0x90fda48) at src/gc/resources.c:475 #1 0xb7d48a7d in Parrot_go_collect (interp=0x90fd048) at src/gc/resources.c:566 #2 0xb7beb984 in Parrot_dod_ms_run (interp=0x90fd048, flags=1) at src/gc/dod.c:1137 #3 0xb7beba9a in Parrot_do_dod_run (interp=0x90fd048, flags=1) at src/gc/dod.c:1190 #4 0xb7bed4f8 in more_traceable_objects (interp=0x90fd048, pool=0x911db68) at src/gc/smallobject.c:163 #5 0xb7bed5da in gc_ms_get_free_object (interp=0x90fd048, pool=0x911db68) at src/gc/smallobject.c:245 #6 0xb7bf03ac in get_free_buffer (interp=0x90fd048, pool=0x911db68) at src/headers.c:101 #7 0xb7bf09ee in new_string_header (interp=0x90fd048, flags=393472) at src/headers.c:444 #8 0xb7b6ff87 in Parrot_make_COW_reference (interp=0x90fd048, s=0x91da340) at src/string.c:141 #9 0xb7b71484 in string_copy (interp=0x90fd048, s=0x91da340) at src/string.c:975 #10 0xb7b92ee1 in Parrot_set_s_sc (cur_opcode=0x91de470, interp=0x90fd048) at src/ops/set.ops:156 #11 0xb7c3958c in runops_slow_core (interp=0x90fd048, pc=0x91de470) ---Type to continue, or q to quit--- at src/runops_cores.c:222 #12 0xb7bf9199 in runops_int (interp=0x90fd048, offset=0) at src/interpreter.c:937 #13 0xb7bf9a3f in runops (interp=0x90fd048, offs=0) at src/inter_run.c:101 #14 0xb7bf9ce4 in runops_args (interp=0x90fd048, sub=0x918a884, obj=0x9165e20, meth_unused=0x0, sig=0xb7ed82e7 "vP", ap=0xbf9c9aec "h�\030\t(\233\234�\220\020��017\th�\030\t\204�\030\t̾�\233\234��\035��017\t\001") at src/inter_run.c:236 #15 0xb7bf9e1c in Parrot_runops_fromc_args (interp=0x90fd048, sub=0x918a884, sig=0xb7ed82e7 "vP") at src/inter_run.c:300 #16 0xb7bdfb57 in Parrot_runcode (interp=0x90fd048, argc=1, argv=0xbf9c9c48) at src/embed.c:951 #17 0xb7eb1da4 in imcc_run_pbc (interp=0x90fd048, obj_file=0, output_file=0x0, argc=1, argv=0xbf9c9c48) at compilers/imcc/main.c:791 #18 0xb7eb2852 in imcc_run (interp=0x90fd048, sourcefile=0xbf9cbbd2 "pcre.pir", argc=1, argv=0xbf9c9c48) at compilers/imcc/main.c:1079 #19 0x08048928 in main (argc=1, argv=0xbf9c9c48) at src/main.c:61 This is on Debian 4.0 Etch, 32 bit. Moritz -- Moritz Lenz http://perlgeek.de/ | http://perl-6.de/ | http://sudokugarden.de/
[perl #59898] [TODO][IMCC] add some #define's to fix the inconsistent dll linkage on windows
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #59898] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59898 > hi, In order to fix the 'inconsistent dll linkage' errors on windows (and also the warnings during compiling the parser/lexer of imcc), 2 defines must be added. These are: #define YYMALLOC #define YYFREE These must occur /before/ #including imclexer.h in imcc.y This is an easy, low-hanging-fruit kind of job (but no time now to do it myself). kjs
[perl #59914] Re: building parrot
# New Ticket Created by Will Coleda # Please include the string: [perl #59914] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59914 > On Wed, Oct 15, 2008 at 9:43 AM, Michael P. Soulier <[EMAIL PROTECTED]> wrote: > Hello, > > I'd report a bug but this link > > http://www.parrot.org/docs/submissions.html > > is broken. Whoops. We're in the middle of migrated to that site: http://www.parrotcode.org/docs/submissions.html has the information. I'm cc'ing the bug tracker to open a ticket. > I'm trying to build parrot on a CentOS 4.6 box and it's failing at link time. > > gcc -o miniparrot src/main.o src/null_config.o \ > -Wl,-rpath=/home/msoulier/downloads/parrot-0.7.1/blib/lib > -L/home/msoulier/downloads/parrot-0.7.1/blib/lib -lparrot -lresolv -lnsl -ldl > -lm -lcrypt -lutil -lpthread -lrt -lgmp -lreadline -lncurses -lcrypto > -L/usr/local/lib -Wl,-E > src/main.o(.text+0x5c): In function `main': > src/main.c:52: undefined reference to `Parrot_new' > src/main.o(.text+0x6a):src/main.c:53: undefined reference to `imcc_initialize' > src/main.o(.text+0x86):src/main.c:58: undefined reference to > `string_from_cstring' > src/main.o(.text+0x95):src/main.c:58: undefined reference to > `Parrot_set_executable_name' > src/main.o(.text+0xae):src/main.c:60: undefined reference to `parseflags' > src/main.o(.text+0xd1):src/main.c:61: undefined reference to `imcc_run' > src/main.o(.text+0xdf):src/main.c:65: undefined reference to `Parrot_destroy' > src/main.o(.text+0xf2):src/main.c:66: undefined reference to `Parrot_exit' > src/null_config.o(.text+0x25): In function `Parrot_set_config_hash': > src/null_config.c:29: undefined reference to `Parrot_set_config_hash_internal' > collect2: ld returned 1 exit status > make: *** [miniparrot] Error 1 > > I found one bug online like this, where the fix was not using tcsh, > but I don't use tcsh. > > Suggestions welcome. Do you have a previously installed parrot? It's possible that we're inadvertently linking against the installed libparrot instead of the one in your build dir. -- Will "Coke" Coleda
[perl #59912] Re: hllmagic branch tests namespace changes
# New Ticket Created by Will Coleda # Please include the string: [perl #59912] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59912 > On Tue, Oct 14, 2008 at 8:03 AM, Will Coleda <[EMAIL PROTECTED]> wrote: > On Tue, Oct 14, 2008 at 7:59 AM, François Perrad > <[EMAIL PROTECTED]> wrote: >> Stephen Weeks a écrit : >>> Not long ago, Patrick R. Michaud proclaimed... Any help others can provide would be greatly appreciated, as we'd like to merge the current hllmagic branch back into trunk in the next day or so. Once that's done we'll be creating a new branch where we can start putting each language into its own hll namespace, instead of most of them sharing the 'parrot' namespace. >>> >>> This branch has been merged as of r31862. Please report any new >>> failures that you need help fixing here or on IRC. >> >> TGE needs to be updated in the same way for namespace (pdd21 compliant). >> TGE is used by : >> - c99 (currently broken) >> - Lua (currently fixed with ugly hack r31940) >> - Pheme (currently broken) > > partcl uses it as well, but another issue is preventing an upgrade to > this revision of parrot. Once that is resolved, I can give you a > status on how this affects partcl. partcl seems to be busted against head as well; PGE is splitting the namespaces on ::, but TGE is not. Sending this to parrotbug to open a ticket. -- Will "Coke" Coleda
[perl #59924] [BUG] t/examples/library.t: new failure
# New Ticket Created by James Keenan # Please include the string: [perl #59924] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59924 > The test below, which always previously passed for me on Linux, started to fail somewhere between r31872 (Oct 10) and r31967 (Oct 14). http://smolder.plusthree.com/app/public_projects/tap_stream/6132/396 1..4 ok 1 - examples/library/getopt_demo.pir ok 2 - examples/library/md5sum.pir 7.4 not ok 3 - examples/library/pcre.pir # Failed test 'examples/library/pcre.pir' # at t/examples/library.t line 67. # got: 'asdf =~ /as/ # 1 match(es): # ' # expected: 'asdf =~ /as/ # 1 match(es): # as # ' not ok 4 - ncurses_life.pir # TODO ncurses_life.pir not testable yet # Failed (TODO) test 'ncurses_life.pir' # at t/examples/library.t line 77. # Looks like you failed 1 test of 4. So far I have not been able to identify any files which changed during this interval and which are obvious candidates for causing this bug. kid51
[perl #59926] [TODO][IMCC] Remove n_ code
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #59926] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59926 > There's a number of spots in IMCC where the n_ variants of ops are considered. One example is in parser_util.c:364, another in the 'is_op' function that is called for each identifier scanned, also in parser_util.c:275. As the n_ variants are removed, this n_ handling code should be removed as well. kjs
[perl #59938] [patch] test_more.pir does not export "nok"
# New Ticket Created by Mark Grimes # Please include the string: [perl #59938] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59938 > Hi, I was doing some test clean up (converting perl test to pir), and I noticed that test_more.pir doesn't export "nok". It is a simple fix, and I have included a patch. Thanks, Mark test_more.patch Description: Binary data
[perl #59968] [BUG] Calling Test::More sub after catching a div by zero exception segfaults
# New Ticket Created by Mark Grimes # Please include the string: [perl #59968] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59968 > The following code results in a segfault: .sub main :main .include 'include/test_more.pir' new P0, 'Integer' new P2, 'Integer' new P1, 'Integer' set P0, 1 set P2, 0 ok( 1, 'ready...' ) push_eh handler P1 = P0 / P2 ok( 0, "not caught" ) end pop_eh handler: ok( 1, 'caught' ) # segfaults # say "ok" # no problem with this .end The ok() line will segfault, but if it is replaced by the "say" line, all is well. If we use I0, I1, I2 instead of the Integer PMC's, it works find, as well. Thanks, Mark
[perl #59978] [TODO] Add SVN revision number of reports to Smolder front page
# New Ticket Created by James Keenan # Please include the string: [perl #59978] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59978 > This is a Wishlist item. I continue to find our Smolder reports very useful. One feature I'd like to see: On the home page (http://smolder.plusthree.com/app/ public_projects/smoke_reports/8), could we squeeze in the SVN revision number at which a report was generated -- perhaps flush right on the same line as the "# Added ..." for each report. We have the SVN rev number available *inside* each report, but not on the outside. This would be useful for two reasons: (1) Sometimes when several people are submitting Smolder reports within the same hour, the report with the highest Smolder number is not from the most recent SVN revision. (2) When we're doing binary searches to track down bugs, once we're inside SVN it's a bit easier to search by revision number than by revision date (fewer keystrokes, more granularity). It would be nice to have both date and SVN rev number on the Smolder home page. Thank you very much. kid51
[perl #59980] [CAGE] 'make' warnings
# New Ticket Created by James Keenan # Please include the string: [perl #59980] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59980 > Our smoke and smolder reports do a good job at indicating test failures. But they don't tell us anything about what warnings are being emitted one phase earlier during 'make'. Such warnings are presumably not causing Parrot to fail to build, but they may be useful in diagnosing test failures. And, in any event, from a scientific point of view they warrant exploration. The file attached is an edited version of a 'grep' on my build log. It happens to be from my most recent build on Darwin/PPC. But with the exception of one warning from a Darwin-specific file, I am getting the same warnings during 'make' on my Linux server. Since these warnings are not causing a build failure, I'm filing this RT as CAGE rather than BUG. Thank you very much. kid51 382-config/gen/platform/darwin/dl.c: In function 'Parrot_dlclose': 383:config/gen/platform/darwin/dl.c:273: warning: cast from function call of type '_Bool' to non-matching type 'int' -- 402-src/packfile/pf_items.c: In function 'PackFile_assign_transforms': 403:src/packfile/pf_items.c:876: warning: assignment from incompatible pointer type -- 415-src/exec_save.c: In function 'Parrot_exec_save': 416:src/exec_save.c:548: warning: comparison between signed and unsigned 417:src/exec_save.c:551: warning: comparison between signed and unsigned -- 527-compilers/imcc/imcparser.c: In function 'yyparse': 528:compilers/imcc/imcparser.c:2680: warning: statement with no effect 529:compilers/imcc/imcparser.c:4817: warning: statement with no effect 530:compilers/imcc/imcparser.c:4974: warning: statement with no effect 531:compilers/imcc/imcparser.c:4978: warning: statement with no effect -- 533-compilers/imcc/imclexer.c: In function 'yylex': 534:compilers/imcc/imclexer.c:4318: warning: switch missing default case 535-compilers/imcc/imclexer.c: In function 'yy_get_next_buffer': 536:compilers/imcc/imclexer.c:4477: warning: comparison between signed and unsigned 537-compilers/imcc/imclexer.c: In function 'input': 538:compilers/imcc/imclexer.c:4645: warning: switch missing default case 539-compilers/imcc/imcc.l: In function 'destroy_frame': 540:compilers/imcc/imcc.l:836: warning: passing argument 1 of 'mem_sys_free' discards qualifiers from pointer target type -- 547-compilers/imcc/reg_alloc.c: In function 'first_avail': 548:compilers/imcc/reg_alloc.c:1056: warning: comparison between signed and unsigned 549:compilers/imcc/reg_alloc.c:1057: warning: signed and unsigned type in conditional expression -- 725-./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_bool': 726:./gdbmhash.pmc:174: warning: function call has aggregate value 727-./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_integer': 728:./gdbmhash.pmc:148: warning: function call has aggregate value 729:./gdbmhash.pmc:150: warning: function call has aggregate value 730-./gdbmhash.pmc: In function 'Parrot_GDBMHash_get_string_keyed': 731:./gdbmhash.pmc:234: warning: function call has aggregate value
[perl #60000] [BUG][IMCC] an :immediate sub cannot load_bytecode
# New Ticket Created by Klaas-Jan Stol # Please include the string: [perl #6] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=6 > when running code as this: .sub main :immediate load_bytecode "foo.pir" .end (assuming you have a file 'foo.pir'), IMCC can't handle this. This is because in pbc.c, a global structure called 'globals' is used to allow the different functions to share access to some data (in particular, the code segment stuff). As documented by a warning in imcc's sources, a load_bytecode will trigger a (nested) compilation phase, which will overwrite this data. Parrot won't output anything (windows) , possibly segfaulting. The fix would be to store this 'globals' structure in the imcc_info structure (I think). kjs
[perl #60030] [BUG] segfault after using substr
# New Ticket Created by Jeff Horwitz # Please include the string: [perl #60030] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60030 > a while back in #parrot, i reported a rakudo segfault when calling "use" with a multilevel namespace: ./parrot --gc-debug languages/perl6/perl6.pbc -e 'use Foo::Bar' chromatic was able to reproduce, but debugging proved to be difficult. however, i've since been able to narrow it down to a simple pure-PIR test case: === .sub doit .param string s $I0 = index s, '::' say s substr s, $I0, 2, "/" say s collect say s .end .sub main :main doit('Foo::Bar') .end [EMAIL PROTECTED] parrot]$ ./parrot foo.pir Foo::Bar Foo/Bar Segmentation fault === i used the "collect" opcode instead of --gc-debug as it helped with debugging. in any case, the backtrace shows that the string buffer for s is no longer valid after collect: (gdb) p *s $1 = {cache = {_b = {_bufstart = 0x2b648e5d5ad8, _buflen = 8}, _ptrs = { _struct_val = 0x2b648e5d5ad8, _pmc_val = 0x8}, _i = { _int_val = 47710885206744, _int_val2 = 8}, _num_val = 2.357230931332755e-310, _string_val = 0x2b648e5d5ad8}, flags = 131328, strstart = 0x2b648e5d5ad8 , bufused = 7, strlen = 7, hashval = 0, encoding = 0x60ab10, charset = 0x60c250} after seeing that, i ran it again, setting a watchpoint on s->strstart so i could see exactly when it was freed. the culprit is compact_pool, and i was able to get the backtrace from the corresponding free(): Breakpoint 4, 0x2b87ad29fa90 in free () from /lib64/libc.so.6 (gdb) bt #0 0x2b87ad29fa90 in free () from /lib64/libc.so.6 #1 0x2b87ab8a09bc in mem__internal_free (from=0x2b87ad794010, file=0x2b87abaa2dc8 "src/gc/resources.c", line=531) at src/gc/memory.c:328 #2 0x2b87ab9692d5 in compact_pool (interp=0x609080, pool=0x60a4e0) at src/gc/resources.c:531 #3 0x2b87ab969390 in Parrot_go_collect (interp=0x609080) at src/gc/resources.c:564 #4 0x2b87ab8275d9 in Parrot_collect (cur_opcode=0x983700, interp=0x609080) at src/ops/core.ops:1187 #5 0x2b87ab8dc65f in runops_slow_core (interp=0x609080, pc=0x983700) at src/runops_cores.c:222 #6 0x2b87ab8adbd4 in runops_int (interp=0x609080, offset=22) at src/interpreter.c:937 #7 0x2b87ab8ae5c3 in runops (interp=0x609080, offs=22) at src/inter_run.c:101 #8 0x2b87ab8ae899 in runops_args (interp=0x609080, sub=0x960f18, obj=0x663350, meth_unused=0x0, sig=0x2b87aba9bf03 "vP", ap=0x7f60ad50) at src/inter_run.c:236 #9 0x2b87ab8aea8b in Parrot_runops_fromc_args (interp=0x609080, sub=0x960f18, sig=0x2b87aba9bf03 "vP") at src/inter_run.c:300 #10 0x2b87ab8943fe in Parrot_runcode (interp=0x609080, argc=1, argv=0x7f60b048) at src/embed.c:951 #11 0x2b87aba75568 in imcc_run_pbc (interp=0x609080, obj_file=0, output_file=0x0, argc=1, argv=0x7f60b048) at compilers/imcc/main.c:791 #12 0x2b87aba75f77 in imcc_run (interp=0x609080, sourcefile=0x7f60bc42 "foo.pir", argc=1, argv=0x7f60b048) at compilers/imcc/main.c:1079 #13 0x00400b14 in main (argc=1, argv=0x7f60b048) at src/main.c:61 i'm not sure if this is compact_pool's fault or if it's just the messenger, but obviously the string is still in use and shouldn't be freed. 2 other things i noted: 1) this only segfaults if the original string is passed as an argument to a subroutine. for example, this works just fine: .sub main :main $S0 = 'Foo::Bar' $I0 = index $S0, '::' say $S0 substr $S0, $I0, 2, "/" say $S0 collect say $S0 .end 2) substr has some COW semantics, which may be relevant, but i'm not sure. -jeff
[perl #60020] [TODO] remove coding standards tests from 'make test' target
# New Ticket Created by Allison Randal # Please include the string: [perl #60020] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60020 > 1) Remove the coding standards tests from the main 'make test' target. 2) Add a step to the release manager's guide to run 'make codetest' and fix various stray spaces, lines that are too long, etc. before cutting the release. We'll try this for a couple of releases and see how it goes. Allison
[perl #60044] [BUG?] rethrow just throwing?
# New Ticket Created by Will Coleda # Please include the string: [perl #60044] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60044 > I would expect both of these programs to output the same thing, but it looks like rethrow is generating the same output that throw would here. What is the difference supposed to be between these two ops? $ cat foo.pir .sub foo :main bar() .end .sub bar baz() .end .sub baz die "eek" .end $ ../../parrot foo.pir eek current instr.: 'baz' pc 24 (foo.pir:10) called from Sub 'bar' pc 19 (foo.pir:6) called from Sub 'foo' pc 7 (foo.pir:2) $ cat bar.pir .sub foo :main push_eh eh bar() pop_eh end eh: .get_results($P0) rethrow $P0 .end .sub bar baz() .end .sub baz die "eek" .end $ ../../parrot bar.pir eek current instr.: 'foo' pc 16 (bar.pir:9) -- Will "Coke" Coleda
[perl #60042] Crash in examples/library/pcre.pir in r32073 on x86 linux (libpcre v7.7)
# New Ticket Created by Mark Glines # Please include the string: [perl #60042] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60042 > This GDB was configured as "i686-pc-linux-gnu"... Using host libthread_db library "/lib/libthread_db.so.1". (gdb) break src/headers.c:110 if buffer == 0x80f9e30 No source file named src/headers.c. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (src/headers.c:110 if buffer == 0x80f9e30) pending. (gdb) run examples/library/pcre.pir asdf as Starting program: /home/infinoid/parrot/parrot examples/library/pcre.pir asdf as [Thread debugging using libthread_db enabled] [New Thread 0xb723e900 (LWP 25750)] Breakpoint 2 at 0xb7b44255: file src/headers.c, line 110. Pending breakpoint "src/headers.c:110 if buffer == 0x80f9e30" resolved asdf =~ /as/ [Switching to Thread 0xb723e900 (LWP 25750)] Breakpoint 2, get_free_buffer (interp=0x8050040, pool=0x8070b60) at src/headers.c:110 110 return buffer; (gdb) print *buffer $1 = {cache = {_b = {_bufstart = 0x0, _buflen = 0}, _ptrs = {_struct_val = 0x0, _pmc_val = 0x0}, _i = {_int_val = 0, _int_val2 = 0}, _num_val = 0, _string_val = 0x0}, flags = 0} (gdb) print buffer->cache._b._bufstart $2 = (void *) 0x0 (gdb) watch *(void**)0x80f9e30 Hardware watchpoint 3: *(void **) 135241264 (gdb) cont Continuing. Hardware watchpoint 3: *(void **) 135241264 Old value = (void *) 0x0 New value = (void *) 0xb7212904 Parrot_allocate_string (interp=0x8050040, str=0x80f9e30, size=500) at src/gc/resources.c:914 914 PObj_buflen(str) = new_size - sizeof (void*); (gdb) bt #0 Parrot_allocate_string (interp=0x8050040, str=0x80f9e30, size=500) at src/gc/resources.c:914 #1 0xb7ac4ee6 in string_make_direct (interp=0x8050040, buffer=0x0, len=500, encoding=0x8070d88, charset=0x8072328, flags=0) at src/string.c:750 #2 0xb7ac5481 in string_repeat (interp=0x8050040, s=0x812e8dc, num=500, d=0x0) at src/string.c:1050 #3 0xb7aeaa04 in Parrot_repeat_s_sc_i (cur_opcode=0x81326e8, interp=0x8050040) at src/ops/string.ops:142 #4 0xb7b8d67c in runops_slow_core (interp=0x8050040, pc=0x81326e8) at src/runops_cores.c:222 #5 0xb7b4d079 in runops_int (interp=0x8050040, offset=263) at src/interpreter.c:937 #6 0xb7b4d91f in runops (interp=0x8050040, offs=263) at src/inter_run.c:101 #7 0xb7b4dbc4 in runops_args (interp=0x8050040, sub=0x80dd63c, obj=0x80b8e28, meth_unused=0x0, sig=0xb7e2ba27 "vP", ap=0xbfa7f6cc " \r\b\b") at src/inter_run.c:236 #8 0xb7b4dcfc in Parrot_runops_fromc_args (interp=0x8050040, sub=0x80dd63c, sig=0xb7e2ba27 "vP") at src/inter_run.c:300 #9 0xb7b33a67 in Parrot_runcode (interp=0x8050040, argc=3, argv=0xbfa7f838) at src/embed.c:959 #10 0xb7e05454 in imcc_run_pbc (interp=0x8050040, obj_file=0, output_file=0x0, argc=3, argv=0xbfa7f838) at compilers/imcc/main.c:791 #11 0xb7e05f02 in imcc_run (interp=0x8050040, sourcefile=0xbfa7ff47 "examples/library/pcre.pir", argc=3, argv=0xbfa7f838) at compilers/imcc/main.c:1079 #12 0x080489c8 in main (argc=3, argv=0xbfa7f838) at src/main.c:61 (gdb) cont Continuing. Hardware watchpoint 3: *(void **) 135241264 Old value = (void *) 0xb7212904 New value = (void *) 0x0 0xb784859e in pcre_compile2 () from /usr/lib/libpcre.so.0 (gdb) bt #0 0xb784859e in pcre_compile2 () from /usr/lib/libpcre.so.0 #1 0xb7848e4f in pcre_compile () from /usr/lib/libpcre.so.0 #2 0xb7b5f2b5 in pcf_p_tiB3P (interp=0x8050040, self=0x80e0480) at src/nci.c:3002 #3 0xb7cf1ca2 in Parrot_NCI_invoke (interp=0x8050040, pmc=0x80e0480, next=0x8132738) at ./src/pmc/nci.pmc:308 #4 0xb7ac9196 in Parrot_invokecc_p (cur_opcode=0x8132730, interp=0x8050040) at src/ops/core.ops:463 #5 0xb7b8d67c in runops_slow_core (interp=0x8050040, pc=0x8132730) at src/runops_cores.c:222 #6 0xb7b4d079 in runops_int (interp=0x8050040, offset=263) at src/interpreter.c:937 #7 0xb7b4d91f in runops (interp=0x8050040, offs=263) at src/inter_run.c:101 #8 0xb7b4dbc4 in runops_args (interp=0x8050040, sub=0x80dd63c, obj=0x80b8e28, meth_unused=0x0, sig=0xb7e2ba27 "vP", ap=0xbfa7f6cc " \r\b\b") at src/inter_run.c:236 #9 0xb7b4dcfc in Parrot_runops_fromc_args (interp=0x8050040, sub=0x80dd63c, sig=0xb7e2ba27 "vP") at src/inter_run.c:300 #10 0xb7b33a67 in Parrot_runcode (interp=0x8050040, argc=3, argv=0xbfa7f838) at src/embed.c:959 #11 0xb7e05454 in imcc_run_pbc (interp=0x8050040, obj_file=0, output_file=0x0, argc=3, argv=0xbfa7f838) at compilers/imcc/main.c:791 #12 0xb7e05f02 in imcc_run (interp=0x8050040, sourcefile=0xbfa7ff47 "examples/library/pcre.pir", argc=3, argv=0xbfa7f838) at compilers/imcc/main.c:1079 #13 0x080489c8 in main (argc=3, argv=0xbfa7f838) at src/main.c:61 (gdb) cont Continuing. 1 match(es): Program received signal SIGSEGV, Segmentation fault. 0xb7c9c6bb in compact_pool (interp=0x8050040, pool=0x8050a40) at src/gc/resources.c:475 475 memcpy(cur_spot, PObj_bufstart(b), PObj_buflen(b)); (gdb) bt #0 0xb7c9c6bb in compact_
[perl #60048] CGP Does Not Work with PCC Runcore Reentry
# New Ticket Created by chromatic # Please include the string: [perl #60048] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=60048 > Several tests fail with the CGP runcore (parrot -C) when multidispatch re-enters bytecode -- in specific, anything that calls into src/pic.c from Parrot_pcc_invoke_sub_from_sig_object causes failures. The problem appears to be that CGP's PIC tries to poke into the bytecode directly to find get_params and similar opcodes, while parameter-passing information is in a context after Parrot_pcc_invoke_sub_from_sig_object. One workaround is to enforce the use of the normal runcore only for calls back into Parrot from Parrot_pcc_invoke_sub_from_sig_object, but that's just a workaround. A better solution is to fix the PIC code to look in the appropriate place in the context for return values. That seems like a good task for the calling conventions branch. -- c