Mailing List Archive

Re: Segmentation fault with 5.001m
In <9509050819.AA07655@dxmint.cern.ch>
On Tue, 5 Sep 1995 10:19:38 +0200
Just Another Perl Hacker <Lionel.Cons@cern.ch> writes:
>Here is a simple test program:
>
>-----------
>dbmopen(%x, "/tmp/x$$", 0644);
>$x{x} = 'y';
>$x{y}++;
>dbmclose(%x);
>unlink(</tmp/$$*>);
>-----------

SunOS4 perl5.001m + Gurusamy Sarathy's consiolidated patches.
Just says :

perl -w /tmp/x
Ambiguous use of {x} resolved to {"x"} at /tmp/x line 3.
Ambiguous use of {y} resolved to {"y"} at /tmp/x line 4.

Without extra patches $x{y}++ may be cause of core-dump.
Re: Segmentation fault with 5.001m [ In reply to ]
>From: Lionel Cons <cons@dxcern.cern.ch>

>dbmopen(%x, "/tmp/x$$", 0644);
>$x{x} = 'y';
>$x{y}++;

That's what I reported last week, here is (slightly edited, Ian :)
what Larry replied:


>This is NETaa14021, "can't increment dbm entry". It's probably related
>to NETaa14015, "append to dbm entry fails", which Gurusamy Sarathy sent a
>patch for that has not been installed yet.



andreas
Re: Segmentation fault with 5.001m [ In reply to ]
Nick Ing-Simmons writes:
> In <9509050819.AA07655@dxmint.cern.ch>
> On Tue, 5 Sep 1995 10:19:38 +0200
> Just Another Perl Hacker <Lionel.Cons@cern.ch> writes:
> >Here is a simple test program:
> >
> >-----------
> >dbmopen(%x, "/tmp/x$$", 0644);
> >$x{x} = 'y';
> >$x{y}++;
> >dbmclose(%x);
> >unlink(</tmp/$$*>);
> >-----------
>
> SunOS4 perl5.001m + Gurusamy Sarathy's consiolidated patches.
> Just says :
>
> perl -w /tmp/x
> Ambiguous use of {x} resolved to {"x"} at /tmp/x line 3.
> Ambiguous use of {y} resolved to {"y"} at /tmp/x line 4.
>
> Without extra patches $x{y}++ may be cause of core-dump.

I've applied the patches but this still does not work, at least on
HP-UX :-(

Lionel
Re: Segmentation fault with 5.001m [ In reply to ]
On Tue, 05 Sep 1995 13:01:11 +0200, Lionel Cons wrote:
>Nick Ing-Simmons writes:
> >
> > SunOS4 perl5.001m + Gurusamy Sarathy's consiolidated patches.
> > Just says :
> >
> > perl -w /tmp/x
> > Ambiguous use of {x} resolved to {"x"} at /tmp/x line 3.
> > Ambiguous use of {y} resolved to {"y"} at /tmp/x line 4.
> >
> > Without extra patches $x{y}++ may be cause of core-dump.
>
>I've applied the patches but this still does not work, at least on
>HP-UX :-(
>

I don't think my patchset addresses this specifically (it does
address string concatenation of magicals however). I don't
seem to get a coredump with your example though on SunOS 4.1.3.

Can you post a stack trace?

>Lionel
>

- Sarathy.
gsar@engin.umich.edu
Re: Segmentation fault with 5.001m [ In reply to ]
> I've applied the patches but this still does not work, at least on
> HP-UX :-(

However, if it is rewritten using a tie to NDBM_File, it does work properly.

#! /opt/perl5/bin/perl

require NDBM_File;

tie(%x,NDBM_File,"/tmp/x$$",O_RDWR|O_CREAT,0644);
$x{x} = 'y';
$x{y}++;
untie(%x);
unlink(</tmp/$$*>);

Jeff
Re: Segmentation fault with 5.001m [ In reply to ]
Gurusamy Sarathy writes:
>
> I don't think my patchset addresses this specifically (it does
> address string concatenation of magicals however). I don't
> seem to get a coredump with your example though on SunOS 4.1.3.
>
> Can you post a stack trace?

Here it is...

With Perl 5.001m + Gurusamy patches, on HP-UX 9.01 with many patches
:-(, with the simple test program x.pl:
---------------------
dbmopen(%x, "/tmp/x$$", 0644);
$x{x} = 'y';
$x{y}++;
dbmclose(%x);
unlink(</tmp/$$*>);
---------------------
I get:

~ xdb perl5.001m/perl
> r x.pl
Starting process 22844: "perl5.001m/perl x.pl"
Bad free() ignored at x.pl line 4.
[ repeated MANY times ]
Bad free() ignored at x.pl line 4.

segmentation violation (no ignore) at 0x00028b94
malloc.c: free: 274 +0x00000004: No Source
> T
0 free (mp = 0xff070000) [malloc.c: 274]
size = 1073876512
op = 0xff06fff8
cp = 0xff070000
1 mg_free (sv = 0x40010838) [mg.c: 206]
mg = 0x400353f0
moremagic = 00000000
vtbl = 00000000
2 sv_clear (sv = 0x40010838) [sv.c: 2145]
sp = 0x696c653a
destructor = 0x3a000000
ref = 0x00000003
3 sv_free (sv = 0x40010838) [sv.c: 2276]
4 free_tmps () [scope.c: 98]
sv = 0x40010838
5 pp_nextstate () [pp_hot.c: 36]
6 run () [run.c: 29]
7 perl_run (sv_interp = 0x40010008) [perl.c: 519]
sp = 0x40010008
8 main (argc = 2, argv = 0x7b033328, env = 0x7b033334) [perlmain.c: 34]
exitstatus = 0

Hope this helps...

Lionel Cons

+------- CERN - European Laboratory for Particle Physics -------+
| E-mail: Lionel.Cons@cern.ch |
| Earth-mail: CN/DCI/UWS, CERN, CH-1211 GENEVE 23, Switzerland |
| Phone: + (41 22) 767 49 13 Fax: + (41 22) 767 71 55 |
+---------------------------------------------------------------+

#!/usr/local/bin/perl -s-- -export-a-crypto-system-sig -RSA-in-3-lines-PERL
($k,$n)=@ARGV;$m=unpack(H.$w,$m."\0"x$w),$_=`echo "16do$w 2+4Oi0$d*-^1[d2%
Sa2/d0<X+d*La1=z\U$n%0]SX$k"[$m*]\EszlXx++p|dc`,s/^.|\W//g,print pack('H*'
,$_)while read(STDIN,$m,($w=2*$d-1+length($n||die"$0 [-d] k n\n")&~1)/2)