public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/33722]  New: putenv() is made posix-conformant on FreeBSD 7.x
@ 2007-10-10  8:14 kostikbel at ukr dot net
  2007-10-10  8:16 ` [Bug ada/33722] " kostikbel at ukr dot net
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: kostikbel at ukr dot net @ 2007-10-10  8:14 UTC (permalink / raw)
  To: gcc-bugs

The putenv() in the FreeBSD 7.x is made posix-conforming, that means
that the function does not make the copy of the argument string for entering
it into the environment.

As consequence, gcc/ada/env.c, __gnat_setenv() function shall not call
free() on the malloc'ed string. Otherwise, memory of the environment
strings become corrupted. In particular, bootstrap cannot proceed because
gnat tools segfaults.


-- 
           Summary: putenv() is made posix-conformant on FreeBSD 7.x
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kostikbel at ukr dot net
 GCC build triplet: i386-pc-freebsd7
  GCC host triplet: i386-pc-freebsd7
GCC target triplet: i386-pc-freebsd7


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
@ 2007-10-10  8:16 ` kostikbel at ukr dot net
  2007-10-10  8:18   ` Arnaud Charlet
  2007-10-10  8:18 ` charlet at adacore dot com
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: kostikbel at ukr dot net @ 2007-10-10  8:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kostikbel at ukr dot net  2007-10-10 08:16 -------
Created an attachment (id=14335)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14335&action=view)
Fix for free() after putenv() on FreeBSD 7.x

The patch allowed me to bootstrap gcc 4.2.2 on the FreeBSD 7.x with
gnat enabled.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
  2007-10-10  8:16 ` [Bug ada/33722] " kostikbel at ukr dot net
@ 2007-10-10  8:18 ` charlet at adacore dot com
  2007-12-01 11:53 ` sam at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: charlet at adacore dot com @ 2007-10-10  8:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from charlet at adacore dot com  2007-10-10 08:18 -------
Subject: Re:  putenv() is made posix-conformant on FreeBSD 7.x

> Created an attachment (id=14335)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14335&action=view)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14335&action=view)
> Fix for free() after putenv() on FreeBSD 7.x
> 
> The patch allowed me to bootstrap gcc 4.2.2 on the FreeBSD 7.x with
> gnat enabled.

Patch looks good to me. OK for 4.2 branch and trunk.

Arno


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:16 ` [Bug ada/33722] " kostikbel at ukr dot net
@ 2007-10-10  8:18   ` Arnaud Charlet
  0 siblings, 0 replies; 7+ messages in thread
From: Arnaud Charlet @ 2007-10-10  8:18 UTC (permalink / raw)
  To: kostikbel at ukr dot net; +Cc: gcc-bugs, gcc-patches

> Created an attachment (id=14335)
>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14335&action=view)
> Fix for free() after putenv() on FreeBSD 7.x
> 
> The patch allowed me to bootstrap gcc 4.2.2 on the FreeBSD 7.x with
> gnat enabled.

Patch looks good to me. OK for 4.2 branch and trunk.

Arno


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
  2007-10-10  8:16 ` [Bug ada/33722] " kostikbel at ukr dot net
  2007-10-10  8:18 ` charlet at adacore dot com
@ 2007-12-01 11:53 ` sam at gcc dot gnu dot org
  2007-12-01 12:04 ` sam at gcc dot gnu dot org
  2007-12-01 12:05 ` sam at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2007-12-01 11:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from sam at gcc dot gnu dot org  2007-12-01 11:52 -------
Subject: Bug 33722

Author: sam
Date: Sat Dec  1 11:52:42 2007
New Revision: 130555

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130555
Log:
2007-12-01  Kostik Belousov  <kostikbel@ukr.net>

    gcc/ada/
        PR ada/33722
        * env.c (__gnat_setenv): FreeBSD 7 has a POSIX conformant putenv()
        and its argument must not be free()ed.


Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/env.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
                   ` (2 preceding siblings ...)
  2007-12-01 11:53 ` sam at gcc dot gnu dot org
@ 2007-12-01 12:04 ` sam at gcc dot gnu dot org
  2007-12-01 12:05 ` sam at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2007-12-01 12:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from sam at gcc dot gnu dot org  2007-12-01 12:03 -------
Subject: Bug 33722

Author: sam
Date: Sat Dec  1 12:03:42 2007
New Revision: 130556

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130556
Log:
2007-12-01  Kostik Belousov  <kostikbel@ukr.net>

    gcc/ada/
        PR ada/33722
        * env.c (__gnat_setenv): FreeBSD 7 has a POSIX conformant putenv()
        and its argument must not be free()ed.


Modified:
    branches/gcc-4_2-branch/gcc/ada/ChangeLog
    branches/gcc-4_2-branch/gcc/ada/env.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug ada/33722] putenv() is made posix-conformant on FreeBSD 7.x
  2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
                   ` (3 preceding siblings ...)
  2007-12-01 12:04 ` sam at gcc dot gnu dot org
@ 2007-12-01 12:05 ` sam at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: sam at gcc dot gnu dot org @ 2007-12-01 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from sam at gcc dot gnu dot org  2007-12-01 12:04 -------
The patch has been committed in SVN trunk and in the 4.2 branch.


-- 

sam at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33722


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-01 12:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-10  8:14 [Bug ada/33722] New: putenv() is made posix-conformant on FreeBSD 7.x kostikbel at ukr dot net
2007-10-10  8:16 ` [Bug ada/33722] " kostikbel at ukr dot net
2007-10-10  8:18   ` Arnaud Charlet
2007-10-10  8:18 ` charlet at adacore dot com
2007-12-01 11:53 ` sam at gcc dot gnu dot org
2007-12-01 12:04 ` sam at gcc dot gnu dot org
2007-12-01 12:05 ` sam at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).