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 693278 - make check run-assert-msg-test.sh fails
make check run-assert-msg-test.sh fails
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.34.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-02-06 20:00 UTC by hete2
Modified: 2013-03-13 15:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description hete2 2013-02-06 20:00:48 UTC
make check gives the following result:

PASS: run-collate-tests.sh
Aborted (core dumped)
Test failed: __glib_assert_msg does not have assertion message
FAIL: run-assert-msg-test.sh
=====================================================================
1 of 30 tests failed
Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=glib
=====================================================================
Comment 1 Dan Winship 2013-02-06 20:14:44 UTC
what version of glib? there was a bug in that test a little while ago, but i think we fixed it.

and what os/distro/version?
Comment 2 hete2 2013-02-07 18:43:44 UTC
I used glib version 2.34.3.
Os: Linux / Xubuntu / 12.04
gcc 4.7.2
Comment 3 Roman Žilka 2013-03-13 00:39:33 UTC
Same problem here. 32b Gentoo, glib 2.32.4, gcc 4.6.3, gdb 7.5.1, libtool 2.4, grep 2.14. To sort of "force" the check to succeed I have to change the bottom of tests/run-assert-msg-test.sh to this:

echo_v "Running gdb on assert-msg-test"
OUT=$(libtool --mode=execute gdb --batch --ex run --ex "set print elements 0" --ex "print (char*) __glib_assert_msg" .libs/$msg_test 2>&1) || \
  fail "failed to run gdb"

echo_v "Checking if assert message is in __glib_assert_msg"
if ! echo "$OUT" | grep -q '^.*ERROR:.*assert-msg-test.c:.*:.*main.*: assertion failed: (42 < 0)'; then
  fail "__glib_assert_msg does not have assertion message"
fi

Change 1: redirection 2>&1 instead of 2>/dev/null. gdb prints what I believe is exactly the desired message to stderr.
Change 2: removing double-quotes and $1 from grep. I have no idea why either is there, but without them, the regexp matches.

Please confirm/deny that these changes actually fix the script and do not destroy its purpose.
Comment 4 Roman Žilka 2013-03-13 01:15:15 UTC
glib 2.34.3 has got run-assert-msg-test.sh of the same content as 2.32.4 (which I'm testing on).
Comment 5 Dan Winship 2013-03-13 13:54:32 UTC
(In reply to comment #3)
> Please confirm/deny that these changes actually fix the script and do not
> destroy its purpose.

They destroy its purpose. If you run the gdb command by hand, you see:

  **
  ERROR:assert-msg-test.c:5:main: assertion failed: (42 < 0)

  Program received signal SIGABRT, Aborted.
  0x0000003ed6e35ba5 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:63
  63	  return INLINE_SYSCALL (tgkill, 3, pid, selftid, sig);
  $1 = 0x602090 "ERROR:assert-msg-test.c:5:main: assertion failed: (42 < 0)"

With your changes, the regexp is matching the assertion message that assert-msg-test prints to stderr at the beginning, but that's not what we want to match; we want to match the output of the "print (char*) __glib_assert_msg" in the gdb script, which is the last line of the output, and is printed to stdout.


Anyway, the fixes I mentioned above happened in 2.35; can you download https://git.gnome.org/browse/glib/plain/tests/assert-msg-test.gdb and save it as "assert-msg-test.gdb" in that directory, and then download https://git.gnome.org/browse/glib/plain/tests/run-assert-msg-test.sh to replace "run-assert-msg-test.sh", and run that new run-assert-msg-test.sh and see if it works?
Comment 6 Roman Žilka 2013-03-13 14:40:12 UTC
OK, I switched to vanilla 2.34.3 and downloaded your two files. The test passes now.

# ./run-assert-msg-test.sh -v
Running assert-msg-test
Running gdb on assert-msg-test
warning: Could not load shared library symbols for linux-gate.so.1.
Do you need "set solib-search-path" or "set sysroot"?
**
ERROR:assert-msg-test.c:5:main: assertion failed: (42 < 0)
Checking if assert message is in __glib_assert_msg
All tests passed.

Shall I recommend my distro to switch to 2.34.3 + this patch?
Comment 7 Dan Winship 2013-03-13 15:08:02 UTC
(In reply to comment #6)
> Shall I recommend my distro to switch to 2.34.3 + this patch?

If you want to be able to pass this test, then sure. You could also just patch Makefile to not run this test though; if it passed at "make dist" time (which it did), and the rest of glib's "make check" passes, then there's no way that the functionality being tested by this test could fail.