[comp.lang.perl] recv doesn't widen the read in buffer...

eichin@milo.mit.edu (Mark W. Eichin) (03/24/91)

I've been writing some UDP services... and I keep running into
problems with recv. I seem to have missed reporting it. It happens on
at least a few architectures.
	If I have something like:
    local($data)="";
    $addr = recv($service,$data,2000,0); # crashes
I get a core dump out of perl. (3.044 and previous crash just about on
this line; 4.000beta crashes a few lines later.

    local($data)="\0" x 2000;
    $addr = recv($service,$data,2000,0); # works fine...
This seems to work, presumably because data is already allocated with
enough space. 
	Since I'm giving recv a length, shouldn't it know to grow
$data enough to fit?
	Shouldn't perl *never* core dump?
				_Mark_ <eichin@athena.mit.edu>
				MIT Student Information Processing Board

merlyn@iwarp.intel.com (Randal L. Schwartz) (03/25/91)

In article <1991Mar24.035130.16585@uvaarpa.Virginia.EDU>, eichin@milo (Mark W. Eichin) writes:
| 	Shouldn't perl *never* core dump?

To quote from The Book (Glossary, page 411):

	DUMP
		A Perl statement that is one of the many ways to get a
		Perl program to produce a core file.  Most of the other
		ones are undocumented.

print "Just another Perl hacker,"
-- 
/=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\
| on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III      |
| merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn |
\=Cute Quote: "Intel: putting the 'backward' in 'backward compatible'..."====/