develooper Front page | perl.perl5.porters | Postings from February 2003

odd (or not so odd?) segmentation fault in 5.8.0

Thread Next
From:
Mark Mielke
Date:
February 12, 2003 21:31
Subject:
odd (or not so odd?) segmentation fault in 5.8.0
Message ID:
20030213053859.GA8286@mark.mielke.cc
I haven't seen this reported yet. I'll try to track it down tomorrow,
but in case anybody in the know can point out the problem immediately:

$ perl -e 'sub TIESCALAR {bless[]} sub FETCH {*a=\1;1}
> tie($a,__PACKAGE__); print $a'
zsh: segmentation fault  perl -e

Of course, this is an odd thing to do, and therefore, I'm not
surprised that there are no regression tests to catch this. My goal
was to use a tie() to provide demand loading of an object. The first
time through, access is through a tie() that initializes the object,
removes the tie, and returns the object. The second time through, and
later, the object itself is referenced, and the tie() is gone.

mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About