[perl #38784] [PATCH] imcc/parser_util.c memory overrun

2006-03-22 Thread via RT
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #38784]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=38784 >


The following trivial patch prevents parrot from reading possibly 
unallocated memory:  If the C< char *name > were less than 10 characters 
long, then the memcmp could read beyond the end of the allocated block;
the strncmp will properly terminate at the end of C.

In most other places, this file uses a plain strcmp().  In these two 
places, it used a memcmp().  I don't know why.

--- parrot-current/compilers/imcc/parser_util.c Wed Feb 22 11:15:12 2006
+++ parrot-andy/compilers/imcc/parser_util.cWed Mar 22 12:36:53 2006
@@ -537,8 +537,8 @@
 else if (!strcmp(name, "yield")) {
 cur_unit->instructions->r[0]->pcc_sub->calls_a_sub |= 1 |ITPCCYIELD;
 }
-else if (!memcmp(name, "invoke", 6) ||
-!memcmp(name, "callmethod", 10)) {
+else if (!strncmp(name, "invoke", 6) ||
+!strncmp(name, "callmethod", 10)) {
 if (cur_unit->type & IMC_PCCSUB)
 cur_unit->instructions->r[0]->pcc_sub->calls_a_sub |= 1;
 }

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: svn performance

2006-03-22 Thread Andy Dougherty
On Sat, 4 Mar 2006, Leopold Toetsch wrote:

> 
> On Feb 28, 2006, at 19:27, Andy Dougherty wrote:
> 
> > 
> > Executive summary -- svn co on Solaris 8 is still *slow*!  I"ll stick
> > to fetching snapshots with wget.
> 
> Dumb question? Why 'svn co' instead of incrementally updating with 'svn up'?

It's not a dumb question.  I only occasionally have a chance to work on 
Parrot.  For a variety of reasons, including disk space limitations, I 
find it inconvenient to keep an svn copy locally.

-- 
Andy Dougherty  [EMAIL PROTECTED]


[svn:parrot-pdd] r11993 - in trunk: . docs/pdds/clip

2006-03-22 Thread allison
Author: allison
Date: Wed Mar 22 18:00:36 2006
New Revision: 11993

Added:
   trunk/docs/pdds/clip/pddXX_exceptions.pod

Changes in other areas also in this revision:
Modified:
   trunk/   (props changed)
   trunk/MANIFEST

Log:
A first draft of the PDD on exceptions.

Added: trunk/docs/pdds/clip/pddXX_exceptions.pod
==
--- (empty file)
+++ trunk/docs/pdds/clip/pddXX_exceptions.pod   Wed Mar 22 18:00:36 2006
@@ -0,0 +1,332 @@
+# Copyright: 2001-2006 The Perl Foundation.
+# $Id: $
+
+=head1 NAME
+
+docs/pdds/clip/pddXX_exceptions.pod - Parrot Exceptions
+
+=head1 ABSTRACT
+
+This document defines the requirements and implementation strategy for
+Parrot's exception system.
+
+=head1 VERSION
+
+$Revision: $
+
+=head1 DESCRIPTION
+
+An exception system gives user-developed code control over how run-time
+error conditions are handled. Exceptions are errors or unusual
+conditions that requires special processing. An exception handler
+performs the necessary steps to appropriately respond to a particular
+kind of exception.
+
+=head2 Exception Opcodes
+
+These are the opcodes relevant to exceptions and exception handlers:
+
+=over
+
+=item *
+
+C creates an exception handler and pushes it onto the control
+stack. It takes a label (the location of the exception handler) as its
+only argument. [Is this right? Treating exception handlers as label
+jumps rather than full subroutines seems error-prone.]
+
+=item *
+
+C removes the most recently added exception from the control
+stack.
+
+=item *
+
+C throws an exception object.
+
+=item *
+
+C rethrows an exception object. It can only be called from
+inside an exception handler.
+
+=item *
+
+C throws an exception. It takes two arguments, one for the severity
+of the exception and one for the type of exception.
+
+If the severity is C, it exits via a call to
+C<_exit($2)>, which is not a catchable exception.
+
+These are the constants defined for severity:
+
+  0EXCEPT_NORMAL
+  1EXCEPT_WARNING
+  2EXCEPT_ERROR
+  3EXCEPT_SEVERE
+  4EXCEPT_FATAL
+  5EXCEPT_DOOMED
+  6EXCEPT_EXIT
+
+These are the constants defined for exception types:
+
+  0E_Exception
+  1E_SystemExit
+  2E_StopIteration
+  3E_StandardError
+  4E_KeyboardInterrupt
+  5E_ImportError
+  6E_EnvironmentError
+  7E_IOError
+  8E_OSError
+  9E_WindowsError
+  10   E_VMSError
+  11   E_EOFError
+  12   E_RuntimeError
+  13   E_NotImplementedError
+  14   E_LibraryNotLoadedError
+  15   E_NameError
+  16   E_UnboundLocalError
+  17   E_AttributeError
+  18   E_SyntaxError
+  19   E_IndentationError
+  20   E_TabError
+  21   E_TypeError
+  22   E_AssertionError
+  23   E_LookupError
+  24   E_IndexError
+  25   E_KeyError
+  26   E_ArithmeticError
+  27   E_OverflowError
+  28   E_ZeroDivisionError
+  29   E_FloatingPointError
+  30   E_ValueError
+  31   E_UnicodeError
+  32   E_UnicodeEncodeError
+  33   E_UnicodeDecodeError
+  34   E_UnicodeTranslateError
+  35   E_ReferenceError
+  36   E_SystemError
+  37   E_MemoryError
+  37   E_LAST_PYTHON_E
+  38   BAD_BUFFER_SIZE
+  39   MISSING_ENCODING_NAME
+  40   INVALID_STRING_REPRESENTATION
+  41   ICU_ERROR
+  42   UNIMPLEMENTED
+  43   NULL_REG_ACCESS
+  44   NO_REG_FRAMES
+  45   SUBSTR_OUT_OF_STRING
+  46   ORD_OUT_OF_STRING
+  47   MALFORMED_UTF8
+  48   MALFORMED_UTF16
+  49   MALFORMED_UTF32
+  50   INVALID_CHARACTER
+  51   INVALID_CHARTYPE
+  52   INVALID_ENCODING
+  53   INVALID_CHARCLASS
+  54   NEG_REPEAT
+  55   NEG_SUBSTR
+  56   NEG_SLEEP
+  57   NEG_CHOP
+  58   INVALID_OPERATION
+  59   ARG_OP_NOT_HANDLED
+  60   KEY_NOT_FOUND
+  61   JIT_UNAVAILABLE
+  62   EXEC_UNAVAILABLE
+  63   INTERP_ERROR
+  64   PREDEREF_LOAD_ERROR
+  65   PARROT_USAGE_ERROR
+  66   PIO_ERROR
+  67   PARROT_POINTER_ERROR
+  68   DIV_BY_ZERO
+  69   PIO_NOT_IMPLEMENTED
+  70   ALLOCATION_ERROR
+  71   INTERNAL_PANIC
+  72   OUT_OF_BOUNDS
+  73   JIT_ERROR
+  74   EXEC_ERROR
+  75   ILL_INHERIT
+  76   NO_PREV_CS
+  77   NO_CLASS
+  78   LEX_NOT_FOUND
+  79   PAD_NOT_FOUND
+  80   ATTRIB_NOT_FOUND
+  81   GLOBAL_NOT_FOUND
+  82   METH_NOT_FOUND
+  83   WRITE_TO_CONSTCLASS
+  84   NOSPAWN
+  85   INTERNAL_NOT_IMPLEMENTED
+  86   ERR_OVERFLOW
+  87   LOSSY_CONVERSION
+
+=item *
+
+C throws an exception of severity C. It takes a
+single argument for the exception type.
+
+=item *
+
+C pushes a subroutine object onto the control stack. If the
+control stack is unwound due to an exception (or C, or
+subroutine return), the subroutine is invoked with an integer argument:
+C<0> means a normal return; C<1> means an exception has been raised.
+[Seems like there's lots of room for dangerous collisions here.]
+
+=back
+
+=head1 IMPLEMENTATION
+
+[I'm not convinced the control stack is the right way to handle
+exceptions. Most of Parrot is based on the continuation-passing style of
+control, shouldn't exceptions be based on it too?]
+
+=head

[perl #38788] make test results

2006-03-22 Thread via RT
# New Ticket Created by  Ryan Hinton 
# Please include the string:  [perl #38788]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/rt3/Ticket/Display.html?id=38788 >


I just checked out revision 11994 from SVN and a few of the tests failed 
(FreeBSD 5.3 I386).  The summary is below.  I am happy to provide more 
information if desired (please copy me directly, I am not on the list).


Failed 5/229 test scripts, 97.82% okay. 30/4559 subtests failed, 99.34% 
okay.
Failed Test  Stat Wstat Total Fail  Failed  List of Failed
---
t/dynoplibs/dan.t   7  1792 77 100.00%  1-7
t/dynoplibs/myops.t 7  1792 77 100.00%  1-7
t/dynpmc/dynlexpad.t6  1536 66 100.00%  1-6
t/dynpmc/foo.t  8  2048 98  88.89%  1-5 7-9
t/dynpmc/sub.t  2   512 22 100.00%  1-2
  (1 subtest UNEXPECTEDLY SUCCEEDED), 10 tests and 390 subtests skipped.


---
Ryan Hinton
[EMAIL PROTECTED]