Loading ...
Sorry, an error occurred while loading the content.
 

Re: Prototype mismatch (solved??)

Expand Messages
  • Csongor Fagyal
    ... Well I kind of figured out the problem... partially. First, the code I copy-pasted was not the one I wanted to :-) Well, partially it was.... Ehhh, it
    Message 1 of 3 , Dec 19, 2002
      >
      >
      >> Hi,
      >>
      >> I have solved the previoud error, but I am not exactly sure how :-)
      >>
      >
      > Your solution looks like it has nothing to do with the original
      > problem reported by perl. This might be the case of this being just
      > some odd perl bug type thing that you worked around. Every now and
      > then ( maybe once a year ), I run into one such bug that I
      > can isolate down to a line, and if I just tweak that line
      > of code somewhat things start to work again mysteriously.
      >
      > Maybe this was one of those mystery bugs? :)

      Well I kind of figured out the problem... partially. First, the code I
      copy-pasted was not the one I wanted to :-) Well, partially it was....
      Ehhh, it would be too difficult to explain ... whatever. Let me explain!

      First, this is the real error (in the logs):
      "Attempt to free non-existent shared string '...string...string...'"
      After this, everything goes out of the window.

      It looks like this error is not a random one: it can be reproduced. I
      have faced this error in a previous install (with Perl 5.6) too. Now I
      have a completely new install with Perl 5.8 - still the same problem. To
      me it looks like passing a reference back from a subroutine is sometimes
      not OK in a mod_perl environment. When I do this:

      return \%hash

      it does not work. When I do this

      return %hash

      it does work! And the miracle now: if I use

      return \%hash

      then in the caller

      my $ref = &get_langfile($file);
      my $regain = Dumper($ref);
      eval ($regain); # Dumper return $VAR1
      my $hs = $VAR1;

      it works again.

      Unbelievable :-) You know what? It looks like an error that you can have
      when you return a pointer in C which points to a local variable. Maybe
      PERL garbage-collects the variable I return? return %hash returns a list
      (AFAIK), which always returns values, not references, which work.

      Argh :-)


      Here, I have found another interesting thing:
      http://www.geocrawler.com/archives/3/182/2000/3/0/3535096/

      > Hello all.
      > > What exactly means this error (from my error_log )
      > > "Attempt to free non-existent shared string during global destruction. "
      > > It is from a big CGI ported in mod_perl. Unfortunately i haven`t written it
      > (the CGI, not mod_perl :-) ) and i`d like to have some more explication on
      > this error to search it in the source.

      that error can only be triggered during child_exit(), which calls
      perl_destruct(). what version of Perl are you running? any xs modules in
      the mix?
      "


      This might help. Other than that... it works now, and I am happy - but also a bit scared :-)))

      - Cs.



      "



      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    Your message has been successfully submitted and would be delivered to recipients shortly.