Re: Parrot hackathon at OSCON

2007-07-18 Thread Jonathan Worthington

Andy Lester wrote:

On Jul 17, 2007, at 7:36 PM, Allison Randal wrote:

Saturday, July 28th, we'll have a Parrot hackathon in Portland. The 
location is to-be-determined (chromatic's house if there aren't more 
than 10 of us). Drop me a note if you plan to join and I'll update 
you with details.


Alas, I'll be leaving on Friday but will be around on Sunday before 
OSCON.  Will anyone else be available for pre-OSCON hacking?
I leave first thing Saturday morning after OSCON, but I am about on the 
Sunday before too.


Jonathan


Re: [svn:parrot] r19956 - trunk/src

2007-07-18 Thread Nicholas Clark
On Tue, Jul 17, 2007 at 10:30:30PM -0700, chromatic wrote:
 On Tuesday 17 July 2007 21:50:44 [EMAIL PROTECTED] wrote:
 
  Modified:
 trunk/src/debug.c
 
  Log:
  Reverse a check on a pointer so that we check for NULL first.  Thanks,
  Coverity!
 
  Modified: trunk/src/debug.c
  ===
 === --- trunk/src/debug.c(original)
  +++ trunk/src/debug.c   Tue Jul 17 21:50:43 2007
  @@ -344,7 +343,7 @@
   PIO_eprintf(interp, %li  , line-number);
   c = pdb-file-source + line-source_offset;
 
  -while (*c != '\n'   c)
  +while (c  (*c != '\n'))
   PIO_eprintf(interp, %c, *(c++));
   }
 
 That's an improvement, but *can* c actually be NULL here?

Well, it could be all bits zero if pdb-file-source is NULL and
line-source_offset, but that would be binary-identical-to-NULL-by-coincidence
rather than really NULL.

Without seeing any more than the code above, I'd guess that that's what the
Coverity tool actually triggered on, and so the question is should the guard
be on pdb-file-source ?

Nicholas Clark


Re: Parrot hackathon at OSCON

2007-07-18 Thread Patrick R. Michaud
On Tue, Jul 17, 2007 at 05:36:28PM -0700, Allison Randal wrote:
 Saturday, July 28th, we'll have a Parrot hackathon in Portland. The 
 location is to-be-determined (chromatic's house if there aren't more 
 than 10 of us). Drop me a note if you plan to join and I'll update you 
 with details.

I'll be there.

Pm


Pre-OSCON hackathon

2007-07-18 Thread Andy Lester
There's a p5 reposithon going on at Schwern's before OSCON.  I'd like  
to hook up with Jonathan and whoever else is around pre-OSCON there,  
and have our own little Parrot hackathon on the corner.  I'm sure  
Schwern will be fine with that.


--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: Pre-OSCON hackathon

2007-07-18 Thread Andy Lester


On Jul 18, 2007, at 9:41 AM, Michael G Schwern wrote:

Sure, the corner... the street corner outside.  One hackathon is  
enough of a

squeeze at my place, I can't fit two.

May I suggest the Doubletree lobby?


Yeah, that would prob'ly do, too.  Sorry to attempt to impose on  
you.  Most of all I wanted to be able to make it to both hackathons.  
Then again, if it's just me  Jonathan, how much of a hackathon is that?


--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






[perl #44025] Parrot_get_runtime_prefix shouldn't be dual-lived

2007-07-18 Thread via RT
# New Ticket Created by  Andy Lester 
# Please include the string:  [perl #44025]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44025 


The behavior of Parrot_get_runtime_prefix depends on if you pass a  
**prefix_str in.  If you do, then that's where the results go.  If  
not, you get back a malloced string.  Danger!

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






[perl #44027] In branch_branch, negative array indexes can happen

2007-07-18 Thread via RT
# New Ticket Created by  Andy Lester 
# Please include the string:  [perl #44027]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44027 


In function branch_branch, there's a line like this:

   ins-r[get_branch_regno(ins)] = next-r[0];

That call to get_branch_regno() can return -1.  That would make a  
negative array index, and stomp on who knows what.

xoa

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Coverity scan results

2007-07-18 Thread Andy Lester
Name  	   Uninspected   Bug  	 False  Ignore	Pending Resolved
Total

parrot-0.4.13   722  0  0   0   7  81

Those 7 are all from me, I believe.  The bugs are in RT.  The rest  
I'm not sure about yet.  I'm plodding through as I have time.


--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






[perl #41860] [CAGE] Run Parrot under Coverity Prevent

2007-07-18 Thread Paul Cochrane via RT
Parrot is now running under Coverity Prevent.  The address for access 
to its output is: http://scan2.coverity.com:9035/.  If you wish to get 
an account to be able to then access the scan page, you will need to 
send an email to [EMAIL PROTECTED]  I'm going to put this info 
up on the Parrot wiki as well.  Resolving the ticket.


Re: Pre-OSCON hackathon

2007-07-18 Thread Michael G Schwern
Andy Lester wrote:
 There's a p5 reposithon going on at Schwern's before OSCON.  I'd like to
 hook up with Jonathan and whoever else is around pre-OSCON there, and
 have our own little Parrot hackathon on the corner.  I'm sure Schwern
 will be fine with that.

Sure, the corner... the street corner outside.  One hackathon is enough of a
squeeze at my place, I can't fit two.

May I suggest the Doubletree lobby?


[perl #44039] in compact_pool, we can be doing null dereferences

2007-07-18 Thread via RT
# New Ticket Created by  Andy Lester 
# Please include the string:  [perl #44039]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44039 


Coverity Scan points out that in compact_pool(), it's possible for  
ref_count to be NULL and get dereferenced in two different places.   
Fix this.

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






[perl #44041] [CAGE] Verify all functions are used

2007-07-18 Thread via RT
# New Ticket Created by  Andy Lester 
# Please include the string:  [perl #44041]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44041 


I would not be surprised to find that we have at least a dozen  
functions in the codebase that aren't actually used any more.  I just  
now removed string_fill_from_buffer, for example.

Verify that all functions actually get used.  We could do this by  
either:

* Creating a tool that verifies that each function is used at least once

* Run splint with whatever flags necessary to do global reference  
matching.

--
Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance






Re: [perl #44041] [CAGE] Verify all functions are used

2007-07-18 Thread Mark Glines
On Wed, 18 Jul 2007 09:58:12 -0700
Andy Lester (via RT) [EMAIL PROTECTED] wrote:
 Verify that all functions actually get used.  We could do this by  
 either:
 
 * Creating a tool that verifies that each function is used at least
 once
 
 * Run splint with whatever flags necessary to do global reference  
 matching.

And then sift out the ones which get used for other configurations /
platforms than your own.

Mark


Re: Pre-OSCON hackathon

2007-07-18 Thread James E Keenan

Andy Lester wrote:


  Then
again, if it's just me  Jonathan, how much of a hackathon is that?



Jonathan's a great hacker.  Ergo, it would be a great hackathon.


PMC/GC help needed

2007-07-18 Thread Will Coleda
I am trying to write a PMC version of PGE::CodeString, and while I  
have a PMC now that passes all the old tests, I get GC errors during  
the build process for TGE  JSON.


I know they are GC related because running the affected steps with - 
G, and they complete normally.


I was unable to find a document describing what sorts of things I  
needed to do; Working with particle (on GC) and allison (on storage),  
I now have:


void init() {
PMC* counter;

PMC_str_val(SELF) =
string_make_empty(INTERP, enum_stringrep_one, 0);
PObj_custom_mark_SET(SELF);

/* initialized our counter that keeps track of register  
numbers */

counter = pmc_new(INTERP, enum_class_Integer);
VTABLE_set_integer_native(INTERP, counter, 10);
PMC_data(SELF) = counter;
}

and

void mark() {
if (PMC_str_val(SELF))
pobject_lives(INTERP, (PObj *)PMC_str_val(SELF));
if (PMC_data(SELF))
pobject_lives(INTERP, (PObj *) PMC_data(SELF));
}

Does that look at all reasonable?

However, the following command:

../../parrot ../../compilers/pge/pgc.pir --output=TGE/Parser.pir TGE/ 
Parser.pg


results in:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x000a
0xa59f in pobject_lives (interp=0x31003b0, obj=0x2) at src/gc/ 
dod.c:168

168 if (PObj_is_live_or_free_TESTALL(obj)) {
(gdb) bt
#0  0xa59f in pobject_lives (interp=0x31003b0, obj=0x2) at src/gc/ 
dod.c:168
#1  0x00030904 in mark_context (interp=0x31003b0, ctx=0x313f1c0) at  
src/sub.c:69
#2  0x001755fd in Parrot_Continuation_mark (interp=0x31003b0,  
pmc=0x186d4e8) at ./src/pmc/continuation.pmc:89
#3  0xac13 in Parrot_dod_trace_children (interp=0x31003b0,  
how_many=4294966916) at src/gc/dod.c:440
#4  0xa978 in trace_active_PMCs (interp=0x31003b0, trace_stack=1)  
at src/gc/dod.c:360
#5  0xb643 in Parrot_dod_ms_run (interp=0x31003b0, flags=1) at  
src/gc/dod.c:1002
#6  0xb72e in Parrot_do_dod_run (interp=0x31003b0, flags=1) at  
src/gc/dod.c:1052

...



--
Will Coke Coleda
[EMAIL PROTECTED]




[perl #43923] [TODO] Don't regenerate MANIFEST unnecessarily

2007-07-18 Thread James Keenan via RT
On Sun Jul 15 09:25:30 2007, coke wrote:
 The recently added functionality to not regen MANIFEST.SKIP should be  
 used when determining whether or not to regenerate MANIFEST as well.
 

Please review the attached.  Modifications to
tools/dev/mk_manifest_and_skip.pl and lib/Parrot/Manifest.pm.  Tso
additional test files in t/manifest/.

In reviewing the patch, I recommend that you first run
tools/dev/mk_manifest_and skip.pl before running t/manifest/*.t.  In
that way, you will be starting from a presumptively correct MANIFEST.

The interface to Parrot::Manifest has changed since last weekend. 
However, that will not matter assuming that all you ever do is call: 
perl tools/dev/mk_manifest_and_skip.pl.  *That* is unchanged.

Thank you very much.

kid51
Index: tools/dev/mk_manifest_and_skip.pl
===
--- tools/dev/mk_manifest_and_skip.pl   (revision 2)
+++ tools/dev/mk_manifest_and_skip.pl   (working copy)
@@ -7,14 +7,20 @@
 
 my $script = $0;
 
-my $mani = Parrot::Manifest-new($script);
+my $mani = Parrot::Manifest-new( {
+script  = $script,
+} );
 
 my $manifest_lines_ref = $mani-prepare_manifest();
-$mani-print_manifest($manifest_lines_ref);
+my $need_for_files = $mani-determine_need_for_manifest($manifest_lines_ref);
+$mani-print_manifest($manifest_lines_ref) if $need_for_files;
 
-my $ignore_ref = $mani-prepare_manifest_skip();
-$mani-print_manifest_skip($ignore_ref);
+my $print_str = $mani-prepare_manifest_skip();
+my $need_for_skip = $mani-determine_need_for_manifest_skip($print_str);
+$mani-print_manifest_skip($print_str) if $need_for_skip;
 
+ DOCUMENTATION 
+
 =head1 NAME
 
 tools/dev/mk_manifest_and_skip.pl - Recreate MANIFEST and MANIFEST.SKIP
Index: MANIFEST
===
--- MANIFEST(revision 2)
+++ MANIFEST(working copy)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jul 18 18:17:51 2007 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Jul 19 02:43:53 2007 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -2931,6 +2931,8 @@
 t/library/test_more.t   []
 t/library/yaml_parser_syck.t[]
 t/manifest/01-basic.t   []
+t/manifest/02-regenerate_file.t []
+t/manifest/03-regenerate_skip.t []
 t/manifest/README   []
 t/native_pbc/header.t   []
 t/native_pbc/integer.t  []
Index: lib/Parrot/Manifest.pm
===
--- lib/Parrot/Manifest.pm  (revision 2)
+++ lib/Parrot/Manifest.pm  (working copy)
@@ -3,26 +3,29 @@
 use strict;
 use warnings;
 use Carp;
+use Data::Dumper;
 
 sub new {
 my $class = shift;
-my $script = shift;
+my $argsref = shift;
 
 my $self = bless( {}, $class );
 
 my %data = (
-id  = '$' . 'Id$',
-time= scalar gmtime,
-cmd = -d '.svn' ? 'svn' : 'svk',
-script  = $script,
+id  = '$' . 'Id$',
+time= scalar gmtime,
+cmd = -d '.svn' ? 'svn' : 'svk',
+script  = $argsref-{script},
+file= $argsref-{file} ? $argsref-{file} : q{MANIFEST},
+skip= $argsref-{skip} ? $argsref-{skip} : q{MANIFEST.SKIP},
 );
 
-my @status_output = qx($data{cmd} status -v);
+my $status_output_ref = [ qx($data{cmd} status -v) ];
 
 # grab the versioned resources:
 my @versioned_files = ();
 my @dirs = ();
-my @versioned_output = grep !/^[?D]/, @status_output;
+my @versioned_output = grep !/^[?D]/, @{ $status_output_ref };
 for my $line (@versioned_output) {
 my @line_info = split( /\s+/, $line );
 
@@ -47,20 +50,36 @@
 
 sub prepare_manifest {
 my $self = shift;
-my @manifest_lines;
+my %manifest_lines;
 
 for my $file (@{ $self-{versioned_files} }) {
-push @manifest_lines, _get_manifest_entry($file);
+$manifest_lines{$file} = _get_manifest_entry($file);
 }
-return [EMAIL PROTECTED];
+return \%manifest_lines;
 }
 
+sub determine_need_for_manifest {
+my $self = shift;
+my $proposed_files_ref = shift;
+if  ( ! -f $self-{file} ) {
+return 1;
+} else {
+my $current_files_ref = $self-_get_current_files();
+my $different_patterns_count = 0;
+foreach my $cur (keys %{ $current_files_ref }) {
+$different_patterns_count++ unless $proposed_files_ref-{$cur};
+}
+foreach my $pro (keys %{ $proposed_files_ref }) {
+$different_patterns_count++ unless $current_files_ref-{$pro};
+}
+