[Bug 709] putenv with environ==NULL causes access fault

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Tue Aug 5 16:55:30 UTC 2008


http://www.rtems.org/bugzilla/show_bug.cgi?id=709


norume at aps.anl.gov changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

Joel Sherrill <joel.sherrill at oarcorp.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
           Platform|                            |All
         Resolution|                            |FIXED
   Target Milestone|---                         |4.9


Calling putenv causes access fault (reference to location 0).
newlib putenv doesn't appear to work when environ==NULL.

Release:
CVS trunk, newlib-1.11.0, rtems newlib patch 20030614

Environment:
Likely all host/target combinations

--- Comment #1 from norume at aps.anl.gov  2004-10-25 15:23:02 ---
Fix:
My present work-around is to add the following at the beginning of my application startup task:

    /*
     * Work around newlib bug
     */
    if (environ == NULL) {
        static char *dummy = NULL;
        environ = &dummy;
    }

The real fix would be to set envirion to a non-NULL value as part of the RTEMS startup sequence, or to fix newlib so that a NULL environ does not break things.

--- Comment #2 from norume at aps.anl.gov  2004-10-26 09:21:14 ---
State-Changed-From-To: open->feedback
State-Changed-Why: Changes committed


--- Comment #3 from Joel Sherrill <joel.sherrill at oarcorp.com>  2008-08-05 11:55:30 ---
Last comment says patch committed.  Closing.


-- 
Configure bugmail: http://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the bugs mailing list