Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in with perl_eval_sv API #6117

Closed
p5pRT opened this issue Dec 4, 2002 · 3 comments
Closed

Memory leak in with perl_eval_sv API #6117

p5pRT opened this issue Dec 4, 2002 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Dec 4, 2002

Migrated from rt.perl.org#18860 (status was 'resolved')

Searchable as RT18860$

@p5pRT
Copy link
Author

p5pRT commented Dec 4, 2002

From amprasad@hss.hns.com

Hi ,
  I found memory leak with the perl API "perl_eval_sv" .
  Iam attaching the c code that i used as a sample to come to the
conclusion that the
  api "perl_eval_sv" has got memory leaks .
  Iam stuck with this .
  Could you suggest some way out of this ?

#include <EXTERN.h>
#include <perl.h>

static PerlInterpreter *my_perl;
int main (int argc, char **argv, char **env)
  {
  char *embedding[] = { "", "-e", "0" };

  my_perl = perl_alloc();
  perl_construct( my_perl );

  perl_parse(my_perl, NULL, 3, embedding, NULL);
  perl_run(my_perl);
  SV* sv = newSVpv("Hello",0);
  while(1)
  {
  perl_eval_sv(sv, G_VOID | G_DISCARD);
  }
  perl_destruct(my_perl);
  perl_free(my_perl);
  }

The above code leaks memory which increases by 8k in every 5 minutes .

thanks
Ambika

DISCLAIMER​: This message is proprietary to Hughes Software Systems
Limited (HSS) and is intended solely for the use of the individual
to whom it is addressed. It may contain privileged or confidential
information and should not be circulated or used for any purpose other
than for what it is intended. If you have received this message in error,
please notify the originator immediately. If you are not the intended
recipient, you are notified that you are strictly prohibited from using,
copying, altering, or disclosing the contents of this message. HSS accepts
no responsibility for loss or damage arising from the use of the information
transmitted by this email including damage from virus.

@p5pRT
Copy link
Author

p5pRT commented May 26, 2003

From @iabyn

This small leak has been fixed in the latest development versions of
Perl, by patch #18599. This fix will appear in Perl 5.8.1 and 5.10.0
when they are released.

Regards,

Dave M.

@p5pRT p5pRT closed this as completed May 26, 2003
@p5pRT
Copy link
Author

p5pRT commented May 26, 2003

@iabyn - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant