home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5347 < prev    next >
Encoding:
Internet Message Format  |  1992-08-17  |  1.9 KB

  1. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!swrinde!sdd.hp.com!usc!news!netlabs!lwall
  2. From: lwall@netlabs.com (Larry Wall)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: array bug (not infinite recursion)
  5. Message-ID: <1992Aug17.174512.13975@netlabs.com>
  6. Date: 17 Aug 92 17:45:12 GMT
  7. References: <Bt1rC8.E6J.1@cs.cmu.edu> <Bt3F0D.G3K.1@cs.cmu.edu>
  8. Sender: news@netlabs.com
  9. Organization: NetLabs, Inc.
  10. Lines: 34
  11. Nntp-Posting-Host: scalpel.netlabs.com
  12.  
  13. In article <Bt3F0D.G3K.1@cs.cmu.edu> jfriedl@cs.cmu.edu writes:
  14. : |> The following (contrived) program dumps core with 4.035
  15. : |> 
  16. : |>     &foo;
  17. : |>     sub foo {
  18. : |>         ($a, $b) = &foo('fi','b');
  19. : |>     }
  20. : Ok,ok, I guess I should have been more verbose and not assumed I would
  21. : be taken for a two-year-old (no, even a two-year old knows infinite
  22. : recursion is a no-no :-)  I made the mistake of assuming the perl.gods would
  23. : actually try the program.
  24.  
  25. Well, I did, and it didn't fail the way you said.  But that was with my
  26. current copy.  I just tried it with stock perl4.035 and it does fail the
  27. way you say.  Paint me sorry.
  28.  
  29. : Perl dumps core before &foo is called a 2nd time (i.e. before it is
  30. : called even once recursively).
  31. : It seems to die when it's trying to save local variables. There are none,
  32. : so some pointer is zero. This pointer isn't being checked before being
  33. : dereferenced [see code snippet at end of message].  I don't have enough
  34. : of a global understanding of the internals to know exactly what's wrong
  35. : (i.e. that the pointer isn't being checked, or that it shouldn't be null
  36. : to begin with).
  37.  
  38. The problem isn't actually the null pointer.  The problem is that the
  39. other argument says there are entries when there aren't, because the
  40. earlier analysis code was being overly gullible.  Turns out someone
  41. already sent me a patch for it, and I installed it on my copy.  It just
  42. hasn't made its way out yet.
  43.  
  44. Larry
  45.