bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#16756: Errors in LFS 5.18


From: Bernhard Voelker
Subject: bug#16756: Errors in LFS 5.18
Date: Sat, 15 Feb 2014 15:56:13 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

tag 16756 +moreinfo
thanks

On 02/14/2014 08:54 PM, Prasad Kumbhar wrote:
> Respected Sir,
> 
>  I was performing the coreutils chapter and gave the command make 
> RUN_EXPENSIVE_TESTS=yes check and in result i got this 
> ======================================1 of 281 tests failed(36 tests were not 
> run)See gnulib-tests/test-suite.logPlease report to address@hidden
> I am attaching the test-suite.log file.Please have a look on it and please 
> guide me to overcome this error.
> if any other thing is required then please let me know i would like to help.

Thank you for bug report.
This error occured in the gnulib part of the tests.

  FAIL: test-getlogin (exit: 134)
  ===============================

  test-getlogin.c:69: assertion failed

Looking at the code of that test ...

    38    /* Test value.  */
    39    buf = getlogin ();
    ...
    61    /* Compare against the value from the environment.  */
    62  #if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
    63    /* Unix platform */
    64    {
    65      const char *name = getenv ("LOGNAME");
    66      if (name == NULL || name[0] == '\0')
    67        name = getenv ("USER");
    68      if (name != NULL && name[0] != '\0')
    69        ASSERT (strcmp (buf, name) == 0);
    70    }
    71  #endif

Maybe the values of the environment variables LOGNAME and
USER were set to something the test does not expect.

This situation can happen e.g. if you used "su -p" to change
the user:

  $ id -nu ; su -pc 'echo "USER=$USER, LOGNAME=$LOGNAME"' root
  berny
  Password:
  USER=berny, LOGNAME=berny

or when in a chroot where the $USER is not setup.

This issue seems related to http://bugs.gnu.org/11150
and http://bugs.gnu.org/12729. Maybe we have to skip the
test under another condition, too.

Can you please find out what the values of 'buf' and 'name' are?
If you change the line 69 like that:

     if (name != NULL && name[0] != '\0')
-      ASSERT (strcmp (buf, name) == 0);
+      {
+        fprintf (stdout, "buf='%s', name='%s'\n", buf, name);
+        ASSERT (strcmp (buf, name) == 0);
+      }

... what does the program print?

  $ gnulib-tests/test-getlogin
  buf='berny', name='berny'

Thanks & have a nice day,
Berny






reply via email to

[Prev in Thread] Current Thread [Next in Thread]