2019-09-21 15:04 BST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002676NetSurf[All Projects] Generalpublic2019-09-13 20:42
Reportervincent 
Assigned To 
SeveritymajorReproducibilityalways 
StatusacknowledgedResolutionopen 
PlatformAthlon 2600+OSLinux Lite OS Version3.8
Product Version 
Target VersionFixed in Version 
Summary0002676: [NetSurf] 3.9-dev crash while download a file.
DescriptionHello,

I'm trying to find a non sse2 browser for this old machine. I've ever tried severals but all crash at startup except Opera 12 and Netsurf 3.x.
By following instruction to get last stable version (3.8 : https://source.netsurf-browser.org/netsurf.git/plain/docs/quick-start.md).
I've installed 3.9-dev.
With this version, NetSurf crash (seg fault) each time I try to download a file. I've tested with differents files from differents websites.

Kind regards,

Tiki
TagsNo tags attached.
Fixed in CI build #
Reported in CI build #
URL of problem page
Attached Files
  • ? file icon netsurf_crash_backtrace (2,098 bytes) 2019-09-10 19:26 -
    (67.706329) content/fetchers/curl.c:910 fetch_curl_process_headers: HTTP status code 200
    (67.708464) content/urldb.c:690 urldb__host_is_ip_address: WARNING: called with non-host 'www.netsurf-browser.org/downloads/source/'
    (70.733451) content/fs_backing_store.c:988 set_store_entry: url:https://www.netsurf-browser.org/downloads/source/
    (70.815399) content/fs_backing_store.c:1705 store_write_block: Wrote 6656 bytes from 0x10bb950 at 0x102000 block 129
    (70.815467) content/fs_backing_store.c:988 set_store_entry: url:https://www.netsurf-browser.org/downloads/source/
    (70.816790) content/fs_backing_store.c:1705 store_write_block: Wrote 266 bytes from 0xf9cf50 at 0x2c400 block 177
    (70.816844) content/fs_backing_store.c:898 get_store_entry: url:https://www.netsurf-browser.org/downloads/source/
    (70.816895) content/fs_backing_store.c:1817 entry_release_alloc: freeing 0xf9cf50
    
    Thread 1 "nsgtk" received signal SIGSEGV, Segmentation fault.
    0x005dcc54 in nsgtk_download_gsourcefunc__nsgtk_download_update (user_data=0x0) at frontends/gtk/download.c:755
    755             return nsgtk_download_update(*force_update);
    (gdb) bt
    #0  0x005dcc54 in nsgtk_download_gsourcefunc__nsgtk_download_update (user_data=0x0) at frontends/gtk/download.c:755
    #1  0xb7071f81 in g_timeout_dispatch (source=0xcad2a0, callback=0x5dcc50 <nsgtk_download_gsourcefunc__nsgtk_download_update>, user_data=0x0) at ../glib/gmain.c:4668
    #2  0xb707137c in g_main_dispatch (context=0xb6d94d60) at ../glib/gmain.c:3179
    #3  0xb707137c in g_main_context_dispatch (context=0xb6d94d60) at ../glib/gmain.c:3844
    #4  0xb7071749 in g_main_context_iterate (context=context@entry=0xb6d94d60, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/gmain.c:3917
    #5  0xb70717f4 in g_main_context_iteration (context=0xb6d94d60, context@entry=0x0, may_block=may_block@entry=1) at ../glib/gmain.c:3978
    #6  0xb7804702 in IA__gtk_main_iteration () at gtkmain.c:1358
    #7  0x005e0749 in nsgtk_main () at frontends/gtk/gui.c:431
    #8  0x0045bd8c in main (argc=<optimized out>, argv=<optimized out>) at frontends/gtk/gui.c:1206
    (gdb)
    
    ? file icon netsurf_crash_backtrace (2,098 bytes) 2019-09-10 19:26 +
  • patch file icon netsurf-3.9_download_callback_crash.patch (661 bytes) 2019-09-11 23:58 -
    --- netsurf/frontends/gtk/download.c.orig	2019-09-11 17:40:47.000000000 -0400
    +++ netsurf/frontends/gtk/download.c	2019-09-11 17:41:19.000000000 -0400
    @@ -751,7 +751,7 @@
     static gboolean nsgtk_download_gsourcefunc__nsgtk_download_update(
     		gpointer user_data)
     {
    -	bool *force_update = user_data;
    - 	return nsgtk_download_update(*force_update);
    +	bool force_update = (bool)user_data;
    + 	return nsgtk_download_update(force_update);
     }
     
    @@ -838,7 +838,7 @@
     		g_timeout_add(
     			UPDATE_RATE,
     			nsgtk_download_gsourcefunc__nsgtk_download_update,
    -			FALSE);
    +			(gpointer)FALSE);
     	}
     
     	nsgtk_downloads_list = g_list_prepend(nsgtk_downloads_list, download);
    
    patch file icon netsurf-3.9_download_callback_crash.patch (661 bytes) 2019-09-11 23:58 +

-Relationships
+Relationships

-Notes
Daniel Silverstone

~0002039

Daniel Silverstone (administrator)

Could you please attempt to capture such a crash in a debugger so that we have some clue as to what is going on when it crashes?
Stefan

~0002094

Stefan (reporter)

Hi, I'm having the same exact problem. I'm running a custom Linux distribution with kernel version 4.19.59, curl version 7.65.3, glib version 2.61.3, gtk+2 version 2.24.32, and netsurf 3.9.

I ran netsurf-gtk with the -v option (not much information there), and got the attached backtrace. I build everything with "-g -O2". Not sure how to get netsurf to include more information in the backtrace, though.

Let me know if you need more info.
Stefan

~0002095

Stefan (reporter)

I did some poking around the file where this Seg fault occurs, and noticed that on line 839 (from git) g_timeout_add is being called with the 3rd argument = FALSE. However, glib documentation states this is a gpointer. So essentially, the user_data bit is being set to 0x0, not a pointer to FALSE, as it looks like it should.

A very hacky way to solve this problem would be to stop a boolean value (FALSE or TRUE) in the gpointer, and case it to bool in the callback function. Something like:
return nsgtk_download_update ((bool)user_data);
Stefan

~0002096

Stefan (reporter)

I can confirm that this is the problem. The very trivial patch attached fixes it for me.
Pest Control Mississauga

~0002097

Pest Control Mississauga (reporter)

Great Work!
Try to visit our site: http://pestcontrol-mississauga.com/
+Notes

-Issue History
Date Modified Username Field Change
2019-06-18 16:42 vincent New Issue
2019-08-01 10:58 Daniel Silverstone Note Added: 0002039
2019-08-01 10:59 Vincent Sanders Project Buildsystem => NetSurf
2019-08-01 11:26 Michael Drake Status new => acknowledged
2019-09-10 19:26 Stefan File Added: netsurf_crash_backtrace
2019-09-10 19:26 Stefan Note Added: 0002094
2019-09-11 22:35 Stefan Note Added: 0002095
2019-09-11 23:58 Stefan File Added: netsurf-3.9_download_callback_crash.patch
2019-09-11 23:58 Stefan Note Added: 0002096
2019-09-13 20:42 Pest Control Mississauga Note Added: 0002097
+Issue History