public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31299]  New: getlog returns blanks when not run from the command prompt
@ 2007-03-21 16:31 michael dot a dot richmond at nasa dot gov
  2007-03-21 16:50 ` [Bug fortran/31299] " pinskia at gcc dot gnu dot org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2007-03-21 16:31 UTC (permalink / raw)
  To: gcc-bugs

The following program prints my login name when I run it with the command:

./a.out

but it prints only blanks when I run it with nohup:

nohup ./a.out
cat nohup.out

PROGRAM test_getlog
CHARACTER(LEN=8) :: cname
CALL GETLOG(cname)
PRINT *, cname
END


-- 
           Summary: getlog returns blanks when not run from the command
                    prompt
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: michael dot a dot richmond at nasa dot gov


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
@ 2007-03-21 16:50 ` pinskia at gcc dot gnu dot org
  2007-03-21 17:00 ` michael dot a dot richmond at nasa dot gov
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-21 16:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-21 16:49 -------
This works for me:
apinski@debian:~$ nohup ./a.out
nohup: appending output to `nohup.out'
apinski@debian:~$ !c
cat nohup.out
 Hello
 apinski


What OS are you running with?


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
  2007-03-21 16:50 ` [Bug fortran/31299] " pinskia at gcc dot gnu dot org
@ 2007-03-21 17:00 ` michael dot a dot richmond at nasa dot gov
  2007-03-21 17:28 ` burnus at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2007-03-21 17:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from michael dot a dot richmond at nasa dot gov  2007-03-21 16:59 -------
Subject: Re:  getlog returns blanks when not run
  from the command prompt

I am running SuSE Linux 10.2

At 12:49 PM 3/21/2007, you wrote:


>------- Comment #1 from pinskia at gcc dot gnu dot org  2007-03-21 
>16:49 -------
>This works for me:
>apinski@debian:~$ nohup ./a.out
>nohup: appending output to `nohup.out'
>apinski@debian:~$ !c
>cat nohup.out
>  Hello
>  apinski
>
>
>What OS are you running with?
>
>
>--
>
>
>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31299
>
>------- You are receiving this mail because: -------
>You reported the bug, or are watching the reporter.


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
  2007-03-21 16:50 ` [Bug fortran/31299] " pinskia at gcc dot gnu dot org
  2007-03-21 17:00 ` michael dot a dot richmond at nasa dot gov
@ 2007-03-21 17:28 ` burnus at gcc dot gnu dot org
  2007-03-21 17:31 ` pinskia at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-21 17:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from burnus at gcc dot gnu dot org  2007-03-21 17:27 -------
I can reproduce this. With g95 it shows also with nohup the login, whereas with
gfortran, sunf95 and ifort it does not.

gfortran calls: char *getlogin(void)
g95 calls: getpwuid(getuid())->pw_name


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (2 preceding siblings ...)
  2007-03-21 17:28 ` burnus at gcc dot gnu dot org
@ 2007-03-21 17:31 ` pinskia at gcc dot gnu dot org
  2007-03-21 17:35 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-21 17:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2007-03-21 17:31 -------
The only thing I can think of this is really a glibc issue and/or a shell issue
as it works for me with debian.

Ok, I can reproduce it with bash on FC5 (I think it is FC5) but it works with
csh as the shell.


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (3 preceding siblings ...)
  2007-03-21 17:31 ` pinskia at gcc dot gnu dot org
@ 2007-03-21 17:35 ` pinskia at gcc dot gnu dot org
  2007-03-21 18:02 ` burnus at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-21 17:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-03-21 17:34 -------
This is not a shell issue either, it is just csh/tcsh has nohup as a builtin
:).

Anyways this is a bug with coreutils.
coreutils 5.2.1's nohup works
coreutils 5.93's nohup does not.

You should report this bug to them.


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (4 preceding siblings ...)
  2007-03-21 17:35 ` pinskia at gcc dot gnu dot org
@ 2007-03-21 18:02 ` burnus at gcc dot gnu dot org
  2007-03-22  4:46 ` ebb9 at byu dot net
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-21 18:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from burnus at gcc dot gnu dot org  2007-03-21 18:02 -------
(In reply to comment #5)
> Anyways this is a bug with coreutils.
> coreutils 5.2.1's nohup works
> coreutils 5.93's nohup does not.
> You should report this bug to them.

I reported it now, cf.
http://lists.gnu.org/archive/html/bug-coreutils/2007-03/index.html
(archive refreshed every 12h)

As gfortran (ifort,sunf95) correctly call the POSIX function getlogin(), I
think one can close this bug.

Or does anyone think that we should work around this bug?


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (5 preceding siblings ...)
  2007-03-21 18:02 ` burnus at gcc dot gnu dot org
@ 2007-03-22  4:46 ` ebb9 at byu dot net
  2007-03-22  7:42 ` burnus at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ebb9 at byu dot net @ 2007-03-22  4:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ebb9 at byu dot net  2007-03-22 04:46 -------
According to POSIX, "The getlogin() function shall return a pointer to a
string containing the user name associated by the login activity with the
controlling terminal of the current process."  The behavior of nohup was
intentionally changed in 5.90, as permitted by POSIX: "If stdin is a
terminal, nohup now redirects it from /dev/null to prevent the command
from tying up an OpenSSH session after you logout."  The difference in
behavior, then, is explainable by the fact that the child app no longer
has a controlling terminal, therefore there is no login user to be found.
 In my mind, this is considered a feature of coreutils' nohup and not a
bug.  And since POSIX permits either behavior (preserving stdin and
keeping a controlling terminal, vs. redirecting stdin and thereby
disassociating from a terminal), it means that getlogin() is not portable
in a nohup environment.


-- 


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


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

* [Bug fortran/31299] getlog returns blanks when not run from the command prompt
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (6 preceding siblings ...)
  2007-03-22  4:46 ` ebb9 at byu dot net
@ 2007-03-22  7:42 ` burnus at gcc dot gnu dot org
  2007-03-22  9:36 ` [Bug fortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() burnus at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-22  7:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from burnus at gcc dot gnu dot org  2007-03-22 07:42 -------
Close as Won't Fix


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (7 preceding siblings ...)
  2007-03-22  7:42 ` burnus at gcc dot gnu dot org
@ 2007-03-22  9:36 ` burnus at gcc dot gnu dot org
  2007-03-22 13:54 ` [Bug fortran/31299] I can produce the bug without using nohup michael dot a dot richmond at nasa dot gov
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-22  9:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from burnus at gcc dot gnu dot org  2007-03-22 09:36 -------
Bob Proulx wrote at bugs-coreutils@
> Regardless of that I think it would be better if the program calling
> getlogin() avoided using it since using the utmp file for this
> accounting is often a source of troublesome errors.  The login user is
> rarely the right answer.  Usually the current effective id provided by
> getpwuid(geteuid()) would be better.  I expect that use of getlogin()
> in the original case that motivated this example is actually a bug by
> itself.

Thus: We should consider using getpwuid(geteuid()) which is also what g95 does,
maybe guarded by "#ifdef" (or maybe not, both are part of IEEE
1003.1-2001/POSIX):
       #include <pwd.h>
       struct passwd *getpwuid(uid_t uid);
and
       #include <unistd.h>
       uid_t geteuid(void);

(I somehow missed initially the clause "getlogin() function shall return a
pointer to a string containing the user name associated by the login activity
with the *controlling terminal* of the current process.")

One should probably also update the manual together with this change?!?


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|WONTFIX                     |
            Summary|getlog returns blanks when  |Use getpwuid(geteuid())
                   |not run from the command    |instead of getlogin() for
                   |prompt                      |GETLOG()


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


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

* [Bug fortran/31299] I can produce the bug without using nohup
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (8 preceding siblings ...)
  2007-03-22  9:36 ` [Bug fortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() burnus at gcc dot gnu dot org
@ 2007-03-22 13:54 ` michael dot a dot richmond at nasa dot gov
  2007-03-22 15:20 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: michael dot a dot richmond at nasa dot gov @ 2007-03-22 13:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from michael dot a dot richmond at nasa dot gov  2007-03-22 13:53 -------
Several commenters believe the problem is with nohup rather than gfortran. I
can produce the bug without using nohup. I redirect the input to a file:

gfortran test_getlog.f90
./a.out <carriage_return

Modifying the program to read from the file has no effect.


-- 

michael dot a dot richmond at nasa dot gov changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Use getpwuid(geteuid())     |I can produce the bug
                   |instead of getlogin() for   |without using nohup
                   |GETLOG()                    |


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


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

* [Bug fortran/31299] I can produce the bug without using nohup
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (9 preceding siblings ...)
  2007-03-22 13:54 ` [Bug fortran/31299] I can produce the bug without using nohup michael dot a dot richmond at nasa dot gov
@ 2007-03-22 15:20 ` pinskia at gcc dot gnu dot org
  2007-03-23 21:29 ` [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() fxcoudert at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-22 15:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pinskia at gcc dot gnu dot org  2007-03-22 15:19 -------
I say GETLOG should have the same behavior as getlogin which is what this
behavior is comming from.

Considering the documentation says:
On systems where the getlogin(3) function is not implemented, this will return
a blank string.


-- 


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (10 preceding siblings ...)
  2007-03-22 15:20 ` pinskia at gcc dot gnu dot org
@ 2007-03-23 21:29 ` fxcoudert at gcc dot gnu dot org
  2007-03-26  9:33 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-23 21:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from fxcoudert at gcc dot gnu dot org  2007-03-23 21:28 -------
Confirming this as a low-priority enhancement. After all, even though we have
historical reasons to implement GETLOG using getlogin(), if the information
returned by another scheme is more relevant *in all cases*, we should change
it.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|fortran                     |libfortran
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-23 21:28:54
               date|                            |


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (11 preceding siblings ...)
  2007-03-23 21:29 ` [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() fxcoudert at gcc dot gnu dot org
@ 2007-03-26  9:33 ` fxcoudert at gcc dot gnu dot org
  2007-04-18 16:26 ` dfranke at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-26  9:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from fxcoudert at gcc dot gnu dot org  2007-03-26 10:33 -------
Below is a patch to use geteuid() and getpwuid(). One minor thing is that
linking with glibc now warns at compile time for static linking:

../../../../trunk/libgfortran/intrinsics/getlog.c:97: warning: Using 'getpwuid'
in statically linked applications requires at runtime the shared libraries from
the glibc version used for linking

I find this warning a bit annoying, as it's not clear for users where it comes
from. Anyway, the patch itself is:

Index: intrinsics/getlog.c
===================================================================
--- intrinsics/getlog.c (revision 123093)
+++ intrinsics/getlog.c (working copy)
@@ -37,8 +37,13 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif

-
 /* Windows32 version */
 #if defined __MINGW32__ && !defined  HAVE_GETLOGIN
 #define WIN32_LEAN_AND_MEAN
@@ -66,7 +71,18 @@
    process.
    CHARACTER(len=*), INTENT(OUT) :: LOGIN  */

-#ifdef HAVE_GETLOGIN
+#if (defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)) ||
defined(HAVE_GETLOGIN)
+
+#if defined(HAVE_GETPWUID) && defined(HAVE_GETEUID)
+# define GETLOG (getpwuid(geteuid())->pw_name)
+#else
+# ifdef HAVE_GETLOGIN
+#  define GETLOG (getlogin())
+# else
+#  error "How on earth did we get here?"
+# endif
+#endif
+
 void PREFIX(getlog) (char *, gfc_charlen_type);
 export_proto_np(PREFIX(getlog));

@@ -78,7 +94,7 @@

   memset (login, ' ', login_len); /* Blank the string.  */

-  p = getlogin ();
+  p = GETLOG;
   if (p == NULL)
     return;

Index: configure.ac
===================================================================
--- configure.ac        (revision 123094)
+++ configure.ac        (working copy)
@@ -164,7 +164,7 @@
 AC_HAVE_HEADERS(stdlib.h stdio.h string.h stddef.h math.h unistd.h signal.h)
 AC_CHECK_HEADERS(time.h sys/params.h sys/time.h sys/times.h sys/resource.h)
 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/wait.h floatingpoint.h ieeefp.h)
-AC_CHECK_HEADERS(fenv.h fptrap.h float.h execinfo.h)
+AC_CHECK_HEADERS(fenv.h fptrap.h float.h execinfo.h pwd.h)
 AC_CHECK_HEADER([complex.h],[AC_DEFINE([HAVE_COMPLEX_H], [1], [complex.h
exists])])
 GCC_HEADER_STDINT(gstdint.h)

@@ -177,7 +177,7 @@
 AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
 AC_CHECK_FUNCS(sleep time ttyname signal alarm ctime clock access fork execl)
 AC_CHECK_FUNCS(wait setmode execvp pipe dup2 close fdopen strcasestr
getrlimit)
-AC_CHECK_FUNCS(gettimeofday)
+AC_CHECK_FUNCS(gettimeofday getpwuid)

 # Check for glibc backtrace functions
 AC_CHECK_FUNCS(backtrace backtrace_symbols)
@@ -190,6 +190,7 @@
 AC_CHECK_LIB([c],[getpid],[AC_DEFINE([HAVE_GETPID],[1],[libc includes
getpid])])
 AC_CHECK_LIB([c],[getppid],[AC_DEFINE([HAVE_GETPPID],[1],[libc includes
getppid])])
 AC_CHECK_LIB([c],[getuid],[AC_DEFINE([HAVE_GETUID],[1],[libc includes
getuid])])
+AC_CHECK_LIB([c],[geteuid],[AC_DEFINE([HAVE_GETEUID],[1],[libc includes
geteuid])])

 # Check for C99 (and other IEEE) math functions
 # ??? This list seems awful long. Is there a better way to test for these?


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (12 preceding siblings ...)
  2007-03-26  9:33 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-18 16:26 ` dfranke at gcc dot gnu dot org
  2007-04-18 16:57 ` fxcoudert at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-04-18 16:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from dfranke at gcc dot gnu dot org  2007-04-18 17:26 -------
As FX kindly provided a patch in comment #13, are there any plans to pick it up
and commit it?


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (13 preceding siblings ...)
  2007-04-18 16:26 ` dfranke at gcc dot gnu dot org
@ 2007-04-18 16:57 ` fxcoudert at gcc dot gnu dot org
  2007-04-18 18:16 ` dfranke at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 16:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from fxcoudert at gcc dot gnu dot org  2007-04-18 17:57 -------
(In reply to comment #14)
> As FX kindly provided a patch in comment #13, are there any plans to pick it up
> and commit it?

As I said, I'm not sure it's the best thing to do, because it gives a warning
for static linking:

../../../../trunk/libgfortran/intrinsics/getlog.c:97: warning: Using 'getpwuid'
in statically linked applications requires at runtime the shared libraries from
the glibc version used for linking

I wonder if there's any way to avoid this warning by using other functions. (I
tried the reentrant ones, but it gives the same warning.)

I'll handle this.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-23 21:28:54         |2007-04-18 17:57:14
               date|                            |


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (14 preceding siblings ...)
  2007-04-18 16:57 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-18 18:16 ` dfranke at gcc dot gnu dot org
  2007-04-18 18:21 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-04-18 18:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from dfranke at gcc dot gnu dot org  2007-04-18 19:15 -------
FX, which version of glibc do you have installed?

I applied your patch to an otherwise unpatched tree and do not get any
warnings, neither at compile time of libgfortran(*) nor while compiling/linking
a binary (a hello-world in this case, glibc-2.5).

When exactly do you get that warning?

(*) `rm getlog.*; make` in the build directory to make sure I didn't miss
anything.


-- 


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (15 preceding siblings ...)
  2007-04-18 18:16 ` dfranke at gcc dot gnu dot org
@ 2007-04-18 18:21 ` fxcoudert at gcc dot gnu dot org
  2007-04-18 18:39 ` dfranke at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-18 18:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from fxcoudert at gcc dot gnu dot org  2007-04-18 19:21 -------
(In reply to comment #16)
> nor while compiling/linking
> a binary (a hello-world in this case, glibc-2.5)

It happens when you compile and link statically a Fortran code that uses
GETLOG().

I've ended up convincing myself that this was still the right thing to do. I'll
test and commit the patch soon.


-- 


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (16 preceding siblings ...)
  2007-04-18 18:21 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-18 18:39 ` dfranke at gcc dot gnu dot org
  2007-04-25  7:36 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-04-18 18:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from dfranke at gcc dot gnu dot org  2007-04-18 19:39 -------
> It happens when you compile and link statically a Fortran code 
> that uses GETLOG().

Confirmed. But if and only if it uses GETLOG(). Thus, it's not too bad. From
comment #13, I assumed that the warning is issued all the time, whenever
linking is done.


> I'll test and commit the patch soon.

The docs should be updated accordingly, especially the part referring to
getlogin(3) ...


-- 


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (17 preceding siblings ...)
  2007-04-18 18:39 ` dfranke at gcc dot gnu dot org
@ 2007-04-25  7:36 ` fxcoudert at gcc dot gnu dot org
  2007-04-25  7:37 ` fxcoudert at gcc dot gnu dot org
  2007-04-25  7:39 ` fxcoudert at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from fxcoudert at gcc dot gnu dot org  2007-04-25 08:36 -------
Subject: Bug 31299

Author: fxcoudert
Date: Wed Apr 25 08:36:20 2007
New Revision: 124143

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124143
Log:
        PR libfortran/31299
        * intrinsics/getlog.c: Use getpwuid and geteuid instead of
        getlogin if they are available.
        * configure.ac: Add checks for getpwuid and geteuid.
        * configure: Regenerate.
        * config.h.in: Regenerate.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/config.h.in
    trunk/libgfortran/configure
    trunk/libgfortran/configure.ac
    trunk/libgfortran/intrinsics/getlog.c


-- 


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (18 preceding siblings ...)
  2007-04-25  7:36 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-25  7:37 ` fxcoudert at gcc dot gnu dot org
  2007-04-25  7:39 ` fxcoudert at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from fxcoudert at gcc dot gnu dot org  2007-04-25 08:37 -------
Fixed on mainline.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

* [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG()
  2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
                   ` (19 preceding siblings ...)
  2007-04-25  7:37 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-25  7:39 ` fxcoudert at gcc dot gnu dot org
  20 siblings, 0 replies; 22+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from fxcoudert at gcc dot gnu dot org  2007-04-25 08:39 -------
Subject: Bug 31299

Author: fxcoudert
Date: Wed Apr 25 08:38:59 2007
New Revision: 124144

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124144
Log:
        PR libfortran/31299
        * intrinsic.texi (GETLOG): Update documentation to reflect
        library changes.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.texi


-- 


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


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

end of thread, other threads:[~2007-04-25  7:39 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-21 16:31 [Bug fortran/31299] New: getlog returns blanks when not run from the command prompt michael dot a dot richmond at nasa dot gov
2007-03-21 16:50 ` [Bug fortran/31299] " pinskia at gcc dot gnu dot org
2007-03-21 17:00 ` michael dot a dot richmond at nasa dot gov
2007-03-21 17:28 ` burnus at gcc dot gnu dot org
2007-03-21 17:31 ` pinskia at gcc dot gnu dot org
2007-03-21 17:35 ` pinskia at gcc dot gnu dot org
2007-03-21 18:02 ` burnus at gcc dot gnu dot org
2007-03-22  4:46 ` ebb9 at byu dot net
2007-03-22  7:42 ` burnus at gcc dot gnu dot org
2007-03-22  9:36 ` [Bug fortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() burnus at gcc dot gnu dot org
2007-03-22 13:54 ` [Bug fortran/31299] I can produce the bug without using nohup michael dot a dot richmond at nasa dot gov
2007-03-22 15:20 ` pinskia at gcc dot gnu dot org
2007-03-23 21:29 ` [Bug libfortran/31299] Use getpwuid(geteuid()) instead of getlogin() for GETLOG() fxcoudert at gcc dot gnu dot org
2007-03-26  9:33 ` fxcoudert at gcc dot gnu dot org
2007-04-18 16:26 ` dfranke at gcc dot gnu dot org
2007-04-18 16:57 ` fxcoudert at gcc dot gnu dot org
2007-04-18 18:16 ` dfranke at gcc dot gnu dot org
2007-04-18 18:21 ` fxcoudert at gcc dot gnu dot org
2007-04-18 18:39 ` dfranke at gcc dot gnu dot org
2007-04-25  7:36 ` fxcoudert at gcc dot gnu dot org
2007-04-25  7:37 ` fxcoudert at gcc dot gnu dot org
2007-04-25  7:39 ` fxcoudert 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).