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 780081 - libgdata 0.17.7 fails streams tests (unable to set up SSL cert)
libgdata 0.17.7 fails streams tests (unable to set up SSL cert)
Status: RESOLVED FIXED
Product: libgdata
Classification: Platform
Component: General
0.17.x
Other Linux
: Normal normal
: ---
Assigned To: libgdata-maint
libgdata-maint
Depends on:
Blocks:
 
 
Reported: 2017-03-15 08:57 UTC by Mart Raudsepp
Modified: 2017-03-15 12:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Mart Raudsepp 2017-03-15 08:57:21 UTC
=================================================
   libgdata 0.17.7: gdata/tests/test-suite.log
=================================================

# TOTAL: 301
# PASS:  299
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 2

.. contents:: :depth: 2

ERROR: streams
==============


(/tmp/portage/dev-libs/0.17.7/work/libgdata-0.17.7/gdata/tests/.libs/streams:32544): GLib-CRITICAL **: g_file_get_contents: assertion 'filename != NULL' failed
# random seed: R02Sa71eca03d2972286d152b3af20a850dc
1..46
# Start of download-stream tests
Trace/breakpoint trap (core dumped)
# GLib-FATAL-CRITICAL: g_file_get_contents: assertion 'filename != NULL' failed
ERROR: streams - too few tests run (expected 46, got 0)
ERROR: streams - exited with status 133 (terminated by signal 5?)



0.17.7 added code like:

	cert_path = g_test_build_filename (G_TEST_DIST, "cert.pem", NULL);
	key_path = g_test_build_filename (G_TEST_DIST, "key.pem", NULL);

	soup_server_set_ssl_cert_file (server, cert_path, key_path, &error);

It errors from this now somehow for me.

  • #0 _g_log_abort
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gmessages.c line 509
  • #1 g_logv
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gmessages.c line 1318
  • #2 g_log
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gmessages.c line 1359
  • #3 g_return_if_fail_warning
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gmessages.c line 2536
  • #4 g_file_get_contents
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gfileutils.c line 978
  • #5 g_tls_certificate_new_from_files
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/gio/gtlscertificate.c line 573
  • #6 soup_server_set_ssl_cert_file
    at /tmp/portage/net-libs/libsoup-2.54.1-r1/work/libsoup-2.54.1/libsoup/soup-server.c line 1018
  • #7 create_server
    at streams.c line 185
  • #8 test_download_stream_download_content_length
    at streams.c line 268
  • #9 test_case_run
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gtestutils.c line 2160
  • #10 g_test_run_suite_internal
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gtestutils.c line 2243
  • #11 g_test_run_suite_internal
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gtestutils.c line 2255
  • #12 g_test_run_suite
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gtestutils.c line 2331
  • #13 g_test_run
    at /tmp/portage/dev-libs/glib-2.50.3/work/glib-2.50.3/glib/gtestutils.c line 1598
  • #14 __libc_start_main
    at ../csu/libc-start.c line 289
  • #15 _start

Comment 1 Mart Raudsepp 2017-03-15 08:58:46 UTC
btw, G_TEST_DIST is new in 2.38 iirc, while for the overall libgdata non-tests part the dependency is lower in configure.ac. By my understanding new in 2.38 G_TEST_DIST is needed to properly support tests in out of sourcedir settings.
Comment 2 Mart Raudsepp 2017-03-15 09:03:52 UTC
adding g_print's for printing out key_path and cert_path points to the existing test cert files properly, so thoroughly confused what's going wrong here.
Comment 3 Philip Withnall 2017-03-15 11:24:10 UTC
(In reply to Mart Raudsepp from comment #1)
> btw, G_TEST_DIST is new in 2.38 iirc, while for the overall libgdata
> non-tests part the dependency is lower in configure.ac. By my understanding
> new in 2.38 G_TEST_DIST is needed to properly support tests in out of
> sourcedir settings.

Whoops, thanks for pointing that out. Fixed on master:

192bcf3 build: Bump minimum GLib dependency to 2.38.0

(In reply to Mart Raudsepp from comment #2)
> adding g_print's for printing out key_path and cert_path points to the
> existing test cert files properly, so thoroughly confused what's going wrong
> here.

This doesn’t make any sense to me either: the assertion failure is due to passing a NULL path in to g_file_get_contents(), but the rest of the backtrace is showing the paths set correctly to some string value. (The code would fail differently if g_file_get_contents() was receiving a non-NULL path which pointed to a non-existent file.)

Can you run under gdb and print out all the relevant variables in soup_server_set_ssl_cert_file() to see if something’s going wrong there (although I’m not sure how it can)?

Maybe running under valgrind first would be a good idea, to see if this is a memory corruption issue.
Comment 4 Philip Withnall 2017-03-15 12:14:15 UTC
After some discussion on IRC, it’s become apparent that the problem was a bug in libsoup, fixed in 2.55.90:

* Fixed soup_server_set_ssl_cert_file(), which was added in
          2.48 but didn't actually work... [patch on libsoup-list from
          Sean DuBois]

I’ll push a patch which ups libgdata’s dependency check on libsoup for the test code (but not for the core of libgdata). It currently checks for libsoup 2.47.3 — I’ll increase that to 2.55.90.
Comment 5 Philip Withnall 2017-03-15 12:17:31 UTC
Fixed on master; the fix will be in the 0.17.8 release (which I’ll make after I get time to fix bug #780067). Thanks!

commit 25225e375ec64a0e4b822c4db8bace07deea78d4
Author: Philip Withnall <withnall@endlessm.com>
Date:   Wed Mar 15 12:14:53 2017 +0000

    build: Bump libsoup dependency for streams test to 2.55.90
    
    Previously the streams test depended on new API added in libsoup 2.47.3.
    It still depends on that API, but it’s become apparent that there was a
    bug in libsoup which rendered soup_server_set_ssl_cert_file() useless
    until libsoup 2.55.90.
    
    Bump the dependency (for the test code only) to 2.55.90.
    
    Thanks to Mart Raudsepp for their help in debugging.
    
    Signed-off-by: Philip Withnall <withnall@endlessm.com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780081

 configure.ac          | 11 ++++++-----
 gdata/tests/streams.c | 42 +++++++++++++++++++++---------------------
 2 files changed, 27 insertions(+), 26 deletions(-)