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

Environment issues in init_postdump_symbols() in 5.005_03 #2763

Closed
p5pRT opened this issue Oct 26, 2000 · 7 comments
Closed

Environment issues in init_postdump_symbols() in 5.005_03 #2763

p5pRT opened this issue Oct 26, 2000 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 26, 2000

Migrated from rt.perl.org#4520 (status was 'rejected')

Searchable as RT4520$

@p5pRT
Copy link
Author

p5pRT commented Oct 26, 2000

From drbob@cmg.fcnbd.com

Dear Perl Folks,
  This is a bug report on Perl 5.005_03 and regards the manipulation of
the 'environ' (char **) array in init_postdump_symbols().
  Part of init_postdump_symbols() scans the environment array - either
'environ' or the passed in (char **) array, and makes a list of the
key/value pairs. This is nice, but the way in which this is done needs
to be fixed for certain platforms.
  Specifically, on Solaris/SPARC, some of the elements in the 'environ'
array are (const char *) elements so that in the parsing when the '=' is
replaced by '\0' to create two NULL-terminated strings for the variable
name and it's value, there can be a segmentation fault because the
(const char *) elements are in a read-only memory block.
  The better method would be to use something like strdup() of the
environment element and then edit that copy. This guarantees that the
element will be mutable and not reside in a read-only segment. There are
a number of other ways to solve this problem but solving it is very
important for those platforms such as Solaris/SPARC that have this
issue.
  If you need any more detailed information, please feel free to write
me and ask. I've dug very deeply into this issue as it has bitten me
rather hard.

  Thanks,
  Bob (drbob@​cmg.fcnbd.com)
  Commercial Bank - Electronic Delivery
  We will write no code before it's designed.

@p5pRT
Copy link
Author

p5pRT commented Apr 13, 2010

@chorny - Status changed from 'open' to 'stalled'

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2012

From @jkeenan

On Thu Oct 26 04​:32​:54 2000, drbob@​cmg.fcnbd.com wrote​:

Dear Perl Folks,
This is a bug report on Perl 5.005_03 and regards the manipulation of
the 'environ' (char **) array in init_postdump_symbols().
Part of init_postdump_symbols() scans the environment array - either
'environ' or the passed in (char **) array, and makes a list of the
key/value pairs. This is nice, but the way in which this is done needs
to be fixed for certain platforms.
Specifically, on Solaris/SPARC, some of the elements in the 'environ'
array are (const char *) elements so that in the parsing when the '=' is
replaced by '\0' to create two NULL-terminated strings for the variable
name and it's value, there can be a segmentation fault because the
(const char *) elements are in a read-only memory block.
The better method would be to use something like strdup() of the
environment element and then edit that copy. This guarantees that the
element will be mutable and not reside in a read-only segment. There are
a number of other ways to solve this problem but solving it is very
important for those platforms such as Solaris/SPARC that have this
issue.
If you need any more detailed information, please feel free to write
me and ask. I've dug very deeply into this issue as it has bitten me
rather hard.

    Thanks\,
      Bob   \(drbob@​cmg\.fcnbd\.com\) 
    Commercial Bank \- Electronic Delivery
    We will write no code before it's designed\.

There has been no response to this ticket in twelve years. The Perl
version referenced has long been unsupported. And I can't find the
string 'init_postdump_symbols' anywhere in the blead source code.

So I'm closing this ticket, which had been in the Stalled queue since 2010.

Thank you very much.
Jim Keenan

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2012

The RT System itself - Status changed from 'stalled' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2012

@jkeenan - Status changed from 'open' to 'rejected'

@p5pRT p5pRT closed this as completed Oct 8, 2012
@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2012

From @iabyn

On Sun, Oct 07, 2012 at 06​:28​:58PM -0700, James E Keenan via RT wrote​:

And I can't find the
string 'init_postdump_symbols' anywhere in the blead source code.

I don't think you tried hard enough :-)

  $ grep init_postdump_symbols perl.c
  init_postdump_symbols(argc,argv,env);
  /* init_postdump_symbols not currently designed to be called */
  init_postdump_symbols(argc,argv,env);
  S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register char **env)

But from quick code inspection, this looks to have been fixed in 5.8.0

--
Red sky at night - gerroff my land!
Red sky at morning - gerroff my land!
  -- old farmers' sayings #14

@p5pRT
Copy link
Author

p5pRT commented Oct 8, 2012

From @jkeenan

On 10/8/12 5​:19 AM, Dave Mitchell wrote​:

On Sun, Oct 07, 2012 at 06​:28​:58PM -0700, James E Keenan via RT wrote​:

And I can't find the
string 'init_postdump_symbols' anywhere in the blead source code.

I don't think you tried hard enough :-)

 $ grep init\_postdump\_symbols perl\.c
    init\_postdump\_symbols\(argc\,argv\,env\);
/\* init\_postdump\_symbols not currently designed to be called \*/
    init\_postdump\_symbols\(argc\,argv\,env\);
 S\_init\_postdump\_symbols\(pTHX\_ register int argc\, register char \*\*argv\, register char \*\*env\)

But from quick code inspection, this looks to have been fixed in 5.8.0

Ugh! I was looking in my *parrot* checkout, not my perl checkout.
Thanks for catching this.

jimk

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

No branches or pull requests

1 participant