After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722360 - make check fails
make check fails
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: build
2.38.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2014-01-16 18:09 UTC by toddsh88
Modified: 2014-02-23 05:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test-suite.log file from 'make check' (829 bytes, text/plain)
2014-01-16 18:09 UTC, toddsh88
  Details
tests: mappedfile: allow ENOENT error (1.12 KB, patch)
2014-02-04 09:46 UTC, Allison Karlitskaya (desrt)
none Details | Review
mappedfile test: permit ENODEV on /dev/null (967 bytes, patch)
2014-02-23 05:47 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description toddsh88 2014-01-16 18:09:54 UTC
Created attachment 266494 [details]
test-suite.log file from 'make check'

============================================================================
Testsuite summary for glib 2.38.2
============================================================================
# TOTAL: 76
# PASS:  75
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See glib/tests/test-suite.log
Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=glib
============================================================================
make[7]: *** [test-suite.log] Error 1
make[7]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[6]: *** [check-TESTS] Error 2
make[6]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[5]: *** [check-am] Error 2
make[5]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[4]: *** [check] Error 2
make[4]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/todds/dist/glib-2.38.2'
make: *** [check] Error 2
[todds@voyager2]# pwd
/home/todds/dist/glib-2.38.2
Comment 1 Allison Karlitskaya (desrt) 2014-01-16 21:10:07 UTC
Comment on attachment 266494 [details]
test-suite.log file from 'make check'

hi.  Thanks for the report.  Can you please provide a bit more information about the environment under which this failure occurred?  (OS type, version, etc.)  Thanks in advance.
Comment 2 toddsh88 2014-01-17 00:31:59 UTC
(In reply to comment #0)
> Created an attachment (id=266494) [details]
> test-suite.log file from 'make check'
> 
> ============================================================================
> Testsuite summary for glib 2.38.2
> ============================================================================
> # TOTAL: 76
> # PASS:  75
> # SKIP:  0
> # XFAIL: 0
> # FAIL:  1
> # XPASS: 0
> # ERROR: 0
> ============================================================================
> See glib/tests/test-suite.log
> Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=glib
> ============================================================================
> make[7]: *** [test-suite.log] Error 1
> make[7]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
> make[6]: *** [check-TESTS] Error 2
> make[6]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
> make[5]: *** [check-am] Error 2
> make[5]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
> make[4]: *** [check] Error 2
> make[4]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
> make[3]: *** [check-recursive] Error 1
> make[3]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
> make[2]: *** [check] Error 2
> make[2]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
> make[1]: *** [check-recursive] Error 1
> make[1]: Leaving directory `/home/todds/dist/glib-2.38.2'
> make: *** [check] Error 2
> [todds@voyager2]# pwd
> /home/todds/dist/glib-2.38.2

===============================================================================
Hi Ryan,

Here's the additional information that you requested:

My system is a VERY "stock" CentOS v5.10 with all of the updates applied.

[todds@voyager2]# cat /etc/redhat-release 
CentOS release 5.10 (Final)

[todds@voyager2]# uname -a
Linux voyager2 2.6.18-371.3.1.el5 #1 SMP Thu Dec 5 12:47:01 EST 2013 i686 i686 i386 GNU/Linux

gcc: no input files
[todds@voyager2]# gcc --version
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I was trying to compile pidgin and it said that I needed a version of glib 
2.16 or newer so I compiled all of the dependencies for glib-2.38.2 and then I compiled glib-2.38.2 by running:

./configure
make
make check

I hope this information helps.
Comment 3 Allison Karlitskaya (desrt) 2014-01-17 00:51:38 UTC
(In reply to comment #2)
> Linux voyager2 2.6.18-371.3.1.el5 #1 SMP Thu Dec 5 12:47:01 EST 2013 i686 i686

Quite an old kernel there...

GLib:ERROR:mappedfile.c:54:test_device: assertion failed: (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) || g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM))

I bet it's returning an error code other than one of those two.  Can you find out what error it's returning by adding g_assert_no_error() just before line 54 in mappedfile.c?  That should cause it to print the error message.

Thanks in advance.
Comment 4 toddsh88 2014-01-17 02:01:14 UTC
(In reply to comment #3)
> (In reply to comment #2)
> > Linux voyager2 2.6.18-371.3.1.el5 #1 SMP Thu Dec 5 12:47:01 EST 2013 i686 i686
> 
> Quite an old kernel there...
> 
> GLib:ERROR:mappedfile.c:54:test_device: assertion failed: (g_error_matches
> (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) || g_error_matches (error,
> G_FILE_ERROR, G_FILE_ERROR_NOMEM))
> 
> I bet it's returning an error code other than one of those two.  Can you find
> out what error it's returning by adding g_assert_no_error() just before line 54
> in mappedfile.c?  That should cause it to print the error message.
> 
> Thanks in advance.

==============================================================================
Do you want me to add:

g_assert_no_error();

OR

g_assert_no_error( error ); ???


==============================================================================
Comment 5 toddsh88 2014-01-17 02:06:28 UTC
I couldn't get it to compile with 'g_assert_no_error();' just before line 54.

With 'g_assert_no_error( error );' inserted just before line 54, I get the following ERROR message: 

Modification (excerpt) to glib/tests/mappedfile.c file:


  file = g_mapped_file_new ("/dev/null", FALSE, &error);
  /* g_assert_no_error(); */
  g_assert_no_error (error);
  g_assert (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) ||
            g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM));



============================================
   glib 2.38.2: glib/tests/test-suite.log
============================================

# TOTAL: 76
# PASS:  75
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: mappedfile
================

# random seed: R02Sca36e601dd0c61f36f6d5ab542031abc
# Start of mappedfile tests
ok 1 /mappedfile/basic
ok 2 /mappedfile/empty
**
GLib:ERROR:mappedfile.c:54:test_device: assertion failed (error == NULL): Failed to map /dev/null' /dev/null': mmap() failed: No such device (g-file-error-quark, 7)
# GLib:ERROR:mappedfile.c:54:test_device: assertion failed (error == NULL): Failed to map /dev/null' /dev/null': mmap() failed: No such device (g-file-error-quark, 7)
../../tap-test: line 5: 12419 Aborted                 $1 -k --tap
Comment 6 Matthias Clasen 2014-01-18 16:06:24 UTC
hmm, not sure we really want to add code to our testsuite to deal with situations like 'no /dev/null'
Comment 7 Allison Karlitskaya (desrt) 2014-01-18 16:19:46 UTC
It may not be missing /dev/null but rather /dev/null (being a character device) not supporting mmap with that kernel version and reporting that fact using a strange error code...

Indeed, reading the code shows that this message comes from a branch where mmap() returns MAP_FAILED.

Weird kernel...
Comment 8 toddsh88 2014-01-23 00:38:33 UTC
(In reply to comment #7)
> It may not be missing /dev/null but rather /dev/null (being a character device)
> not supporting mmap with that kernel version and reporting that fact using a
> strange error code...
> 
> Indeed, reading the code shows that this message comes from a branch where
> mmap() returns MAP_FAILED.
> 
> Weird kernel...


There's definitely a '/dev/null' file:

[root@voyager2]# l /dev/null
crw-rw-rw- 1 root root 1, 3 Dec 12 20:22 /dev/null

[root@voyager2]# cat /etc/passwd > /dev/null
Comment 9 Allison Karlitskaya (desrt) 2014-02-04 09:46:08 UTC
Created attachment 268045 [details] [review]
tests: mappedfile: allow ENOENT error

mmap() on /dev/null returns ENOENT on old Linux versions, so accept that
in our testcase.

This is not a case of open() returning that "/dev/null" is missing.
This is the mmap() syscall returning ENOENT.  We don't have a way to
check the difference, unfortunately.
Comment 10 Allison Karlitskaya (desrt) 2014-02-04 09:46:24 UTC
Can you test this patch please?
Comment 11 toddsh88 2014-02-04 16:50:51 UTC
Hi Ryan,

I'm in no way an expert at this, and since I didn't see any well defined procedure from you, here's what I did:

cd glib-2.38.2/glib/tests

vi patch_mappedfile.c and added the following lines

[todds@voyager2]# cat patch_mappedfile.c
---
 glib/tests/mappedfile.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c
index 99c26c9..cc93a78 100644
--- a/glib/tests/mappedfile.c
+++ b/glib/tests/mappedfile.c
@@ -54,6 +54,7 @@ test_device (void)
 
   file = g_mapped_file_new ("/dev/null", FALSE, &error);
   g_assert (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) ||
+            g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT) || /* Old Linux kernels... */
             g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM));
   g_assert (file == NULL);
   g_error_free (error);
-- 
1.8.5.3

[todds@voyager2]# cat patch_mappedfile.c | patch
[todds@voyager2]# diff mappedfile.c_orig mappedfile.c
53a54
>             g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT) || /* Old Linux kernels... */

[todds@voyager2]# cd ../..

[todds@voyager2]# pwd
/home/todds/dist/glib-2.38.2

[todds@voyager2]# make check


Results
-------
...

PASS: mainloop
FAIL: mappedfile
PASS: markup-parse

...
============================================================================
Testsuite summary for glib 2.38.2
============================================================================
# TOTAL: 76
# PASS:  75
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See glib/tests/test-suite.log
Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=glib
============================================================================
make[7]: *** [test-suite.log] Error 1
make[7]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[6]: *** [check-TESTS] Error 2
make[6]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[5]: *** [check-am] Error 2
make[5]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[4]: *** [check] Error 2
make[4]: Leaving directory `/home/todds/dist/glib-2.38.2/glib/tests'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/home/todds/dist/glib-2.38.2/glib'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/todds/dist/glib-2.38.2'
make: *** [check] Error 2

------------------------------------------------------------------------------
vi glib/tests/test-suite.log

============================================
   glib 2.38.2: glib/tests/test-suite.log
============================================

# TOTAL: 76
# PASS:  75
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: mappedfile
================

# random seed: R02Seaaf48aadcb226fb66365caf41a22295
# Start of mappedfile tests
ok 1 /mappedfile/basic
ok 2 /mappedfile/empty
**
GLib:ERROR:mappedfile.c:55:test_device: assertion failed: 
  (g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL)
|| g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)
|| g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM))

# GLib:ERROR:mappedfile.c:55:test_device: assertion failed: 
(g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_INVAL) 
|| g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT) 
|| g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOMEM))
../../tap-test: line 5:  1315 Aborted                 $1 -k --tap

I hope this information helps.



I'll also run the following commands and see if the results are any different and update the bug accordingly.

./configure
make
make check
Comment 12 toddsh88 2014-02-04 17:04:12 UTC
After running the following commands:

./configure
make
make check

It resulted in the same exact test failure and error message.

FYI
Comment 13 Allison Karlitskaya (desrt) 2014-02-04 17:44:44 UTC
I'm sorry -- my mistake.  Can you try with the _NOENT changed to _NODEV?
Comment 14 Allison Karlitskaya (desrt) 2014-02-23 05:47:56 UTC
Created attachment 270035 [details] [review]
mappedfile test: permit ENODEV on /dev/null

mmap() on /dev/null returns ENODEV on old Linux versions and also on
Hurd, so accept that in the testcase.
Comment 15 Allison Karlitskaya (desrt) 2014-02-23 05:48:18 UTC
Attachment 270035 [details] pushed as 4af9b8e - mappedfile test: permit ENODEV on /dev/null