On Tue, Jan 15, 2008 at 03:46:59PM -0800, Mark Schoonover wrote:
> On Jan 15, 2008 3:35 PM, Gus Wirth <[EMAIL PROTECTED]> wrote:
> > As they say in Missouri, show me. What you are saying is that Perl
> > allows you to escape the virtual machine and directly reference
> > memory from the OS, thus causing segfaults when you go to a wrong
> > location.
> 
> Well, Perl doesn't segfault. It'll  print out the actual memory
> location in hex to the screen if it hasn't been properly dereferenced.

Not really.  Two separate runs:

[EMAIL PROTECTED] cgrau]$ perl -MDevel::Peek -e 'Dump($foo = 42)'
SV = IV(0x64d5d8) at 0x64bcb0
  REFCNT = 1
  FLAGS = (IOK,pIOK)
  IV = 42
[EMAIL PROTECTED] cgrau]$ perl -MDevel::Peek -e 'Dump($foo = 42)'
SV = IV(0x64d5d8) at 0x64bcb0
  REFCNT = 1
  FLAGS = (IOK,pIOK)
  IV = 42

The memory location (at 0x64bcb0) is the memory location within the Perl
virtual machine's address space and only maps to physical memory
in-so-much as you happen to know where the Perl virtual machine has
allocated it.

That's possible, of course (hey, it's Perl, right?), but to do so, one
would need to delve into the black magic that is XS.  However, then we'd
be using C, not Perl, and we all already know that C supports such
things so we're back where we started.

Attachment: pgpAvBc7FmAW6.pgp
Description: PGP signature

-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to