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 791042 - Critical warnings on startup
Critical warnings on startup
Status: RESOLVED FIXED
Product: libhttpseverywhere
Classification: Other
Component: general
0.6.x
Other Linux
: Normal normal
: ---
Assigned To: libhttpseverywhere maintainer(s)
libhttpseverywhere maintainer(s)
Depends on:
Blocks: 775575
 
 
Reported: 2017-11-30 20:06 UTC by Michael Catanzaro
Modified: 2018-01-24 18:42 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2017-11-30 20:06:45 UTC
I'm trying to get Epiphany to work using libhttpseverywhere once again. But I'm seeing a bunch of criticals inside HTTPSEverywhere.Context.init. Here's a backtrace taken with G_DEBUG=fatal-criticals. Notice that Looks like parser.get_root() is returning null in Context.load_rulesets()... I assume that's bad.

  • #0 _g_log_abort
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmessages.c line 583
  • #1 g_logv
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmessages.c line 1391
  • #2 g_log
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmessages.c line 1432
  • #3 g_return_if_fail_warning
  • #4 json_node_get_node_type
    at ../../../../Projects/GNOME/json-glib/json-glib/json-node.c line 1221
  • #5 https_everywhere_context_load_rulesets
    at /home/mcatanzaro/Projects/GNOME/libhttpseverywhere/src/context.vala line 263
  • #6 https_everywhere_context_init_co
    at /home/mcatanzaro/Projects/GNOME/libhttpseverywhere/src/context.vala line 136
  • #7 https_everywhere_context_init_ready
    at /home/mcatanzaro/Projects/GNOME/libhttpseverywhere/src/context.vala line 115
  • #8 g_task_return_now
    at /home/mcatanzaro/Projects/GNOME/glib/gio/gtask.c line 1148
  • #9 complete_in_idle_cb
    at /home/mcatanzaro/Projects/GNOME/glib/gio/gtask.c line 1162
  • #10 g_idle_dispatch
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmain.c line 5555
  • #11 g_main_dispatch
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmain.c line 3185
  • #12 g_main_context_dispatch
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmain.c line 3850
  • #13 g_main_context_iterate
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmain.c line 3923
  • #14 g_main_loop_run
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gmain.c line 4119
  • #15 ephy_uri_tester_load_sync
    at ../../../../Projects/GNOME/epiphany/embed/web-extension/ephy-uri-tester.c line 739
  • #16 g_task_thread_pool_thread
    at /home/mcatanzaro/Projects/GNOME/glib/gio/gtask.c line 1331
  • #17 g_thread_pool_thread_proxy
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gthreadpool.c line 307
  • #18 g_thread_proxy
    at /home/mcatanzaro/Projects/GNOME/glib/glib/gthread.c line 784
  • #19 start_thread
    from /lib64/libpthread.so.0
  • #20 clone
    from /lib64/libc.so.6

Comment 1 grindhold 2018-01-19 21:19:42 UTC
i observed that passing
 a) empty files
 b) files consisting only of whitespace
cause these errors in json-glib

i added a check for file sizes of 0 bytes. if this happens, they are yield a simple warning, too.

see commit 7264476 for this. 

all other checks i would have to perform to mitigate the critical would require me to read the file before passing it, doubling the time reading from disk. i'd rather hand this issue upstream to json-glib where this could probably be handled better.

for libhttpseverywhere (and epiphany) it is now to decide how chances are that this happens in reallife and how bad it would be.
the case we are checking for is an update that went wrong. either it unpacked no data. 0-length rulefiles are now checked correctly for. a corrupted download may put some incorrectly decoded data into the file which will also trigger a warning. i think unpacking a string that consists only of whitespace from corrupted data is not likely.
Comment 2 Michael Catanzaro 2018-01-19 23:32:22 UTC
(In reply to grindhold from comment #1)
> i think unpacking a string that consists only
> of whitespace from corrupted data is not likely.

Yeah, I wouldn't worry about that.

The question is: why was libhttpseverywhere creating zero-byte files? :/
Comment 3 grindhold 2018-01-24 18:42:47 UTC
ultimately fixed as of f45b0dc