You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Stas Bekman <st...@stason.org> on 2001/06/28 05:20:45 UTC

make source_scan

Ok, here is the summary of the 'make source_scan' issue.

using the Scan.pm from Doug's site with the patch:

--- /home/dougm/tar/Scan.pm     Mon Jun 25 16:38:02 2001
+++ /home/dougm/perl/C-Scan-0.75/Scan.pm        Wed May  2 20:57:45 2001
@@ -914,7 +914,7 @@
   }
   my $stream = $class->new(@_);
   my $oh = select $stream;
-  $/ = undef;
+  local $/ = undef;
   select $oh;
   <$stream>;
 }


* works with:
Linux 2.2.16-22

* sort of works with:
Linux 2.4.3-20mdk

with this panic message:
panic: not expecting 'tcpi_rcv_wscale' after array bounds in '
  u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;'

I cannot really compare it with your file Doug to check whether the
scanning has been done correctly since the generated
xs/tables/current/Apache/FunctionTable.pm is sorted and written absolutely
differently, I get a huge diff.

So if I add a new feature and want to add it via source_scan, only you can
do that if don't want to overwrite each others version of
xs/tables/current/Apache/FunctionTable.pm. Do you think we should make
sourcescan produce an identical code, no matter what machine it's running
on ( I suppose this is just an issue of sorting the keys before dumping
the datastructures).

* sourcescan does not work with:
2.2.19-4.1mdk (as reported before)

Expecting parenth after identifier in `apr_sms_t **sms'
after `apr_sms_t ' at /home/stas/perl-bleed/lib/5.7.1/C/Scan.pm line 851.
        C::Scan::do_declaration1('apr_sms_t
**sms','HASH(0x84b1a08)','HASH(0x853b67c)',0) called at
/home/stas/perl-bleed/lib/5.7.1/C/Scan.pm line 808
        C::Scan::do_declaration('apr_status_t
apr_sms_blocks_create(apr_sms_t **sms,\x{a}
apr_sms_t *pms,\x{a}
apr_size_t block_size);','HASH(0x84b1a08)','HASH(0x853b67c)') called at
/home/stas/perl-bleed/lib/5.7.1/C/Scan.pm line 738

C::Scan::do_declarations('ARRAY(0x84923b4)','HASH(0x84b1a08)','HASH(0x853b67c)')called
at /home/stas/perl-bleed/lib/site_perl/5.7.1/Data/Flow.pm line 69
...

which means that I have to upgrade my kernel to make it work? :( or I
guess patch Scan.pm :)

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: make source_scan

Posted by Stas Bekman <st...@stason.org>.
On Thu, 28 Jun 2001, Stas Bekman wrote:

> On Wed, 27 Jun 2001, Doug MacEachern wrote:
>
> > On Thu, 28 Jun 2001, Stas Bekman wrote:
> >
> > > So if I add a new feature and want to add it via source_scan, only you can
> > > do that if don't want to overwrite each others version of
> > > xs/tables/current/Apache/FunctionTable.pm. Do you think we should make
> > > sourcescan produce an identical code, no matter what machine it's running
> > > on ( I suppose this is just an issue of sorting the keys before dumping
> > > the datastructures).
> >
> > if you can make that happen, that would be cool.  but i think it depends
> > on Data::Dumper, which doesn't have a sort option that i know of.
>
> First we can use Data::Denter which sorts the keys.
[snip]

> Alternatively, since we know what data we want to dump (only arrays,
> hashes and scalars), a simple function which generates the output like
> Dumper but sorted will do.

another two suggestions from
http://groups.google.com/groups?hl=en&safe=off&ic=1&th=55225b2ad56b3ef1,2&seekm=Pine.GSO.4.21.0005221010250.5201-100000%40mamba.cs.Virginia.EDU#p
are:
* to modify Dumper.pm
* to use Tie::LLHash

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: make source_scan

Posted by Stas Bekman <st...@stason.org>.
On Wed, 27 Jun 2001, Doug MacEachern wrote:

> On Thu, 28 Jun 2001, Stas Bekman wrote:
>
> > So if I add a new feature and want to add it via source_scan, only you can
> > do that if don't want to overwrite each others version of
> > xs/tables/current/Apache/FunctionTable.pm. Do you think we should make
> > sourcescan produce an identical code, no matter what machine it's running
> > on ( I suppose this is just an issue of sorting the keys before dumping
> > the datastructures).
>
> if you can make that happen, that would be cool.  but i think it depends
> on Data::Dumper, which doesn't have a sort option that i know of.

First we can use Data::Denter which sorts the keys. Now it's output is not
suitable for strightforward require(), so the manpage suggests:

       For example if you wanted to set up a config file with 3
       options, you might choose a format like this:

           option1 => value1
           option2 => value2
           option3 => @
               sub-value-a
               sub-value-b

       To read this into Perl you could say:

           use Data::Dumper;
           use Data::Denter;
           $Data::Denter::HashMode = 1;
           open CONFIG, 'config' or die $!;
           my %config = Undent join '', <CONFIG>;
           print Dumper \%config;

So we store the keys sorted and easily maintainable. And only need to
preprocess with Data::Dumper to deserialize.

Alternatively, since we know what data we want to dump (only arrays,
hashes and scalars), a simple function which generates the output like
Dumper but sorted will do.

> in the meantime, if you want to add a new feature to source_scan.pl you
> can do that without checking in the changed xs/tables

ok


_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:stas@stason.org   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: make source_scan

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 28 Jun 2001, Stas Bekman wrote:
 
> So if I add a new feature and want to add it via source_scan, only you can
> do that if don't want to overwrite each others version of
> xs/tables/current/Apache/FunctionTable.pm. Do you think we should make
> sourcescan produce an identical code, no matter what machine it's running
> on ( I suppose this is just an issue of sorting the keys before dumping
> the datastructures).

if you can make that happen, that would be cool.  but i think it depends
on Data::Dumper, which doesn't have a sort option that i know of.

in the meantime, if you want to add a new feature to source_scan.pl you
can do that without checking in the changed xs/tables


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org