MantisBT - NetSurf
View Issue Details
0002676NetSurfGTK-specificpublic2019-06-18 15:422020-05-27 08:17
Reportervincent 
Assigned ToVincent Sanders 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformAthlon 2600+OSLinux Lite OS Version3.8
Product Version3.8 
Target VersionFixed in Version3.10 
Fixed in CI build #
Reported in CI build #
URL of problem page
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.
Attached Files? netsurf_crash_backtrace (2,098) 2019-09-10 18:26
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=618&type=bug
patch netsurf-3.9_download_callback_crash.patch (661) 2019-09-11 22:58
https://bugs.netsurf-browser.org/mantis/file_download.php?file_id=619&type=bug

Notes
(0002039)
kinnison   
2019-08-01 09:58   
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?
(0002094)
Stefan   
2019-09-10 18:26   
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.
(0002095)
Stefan   
2019-09-11 21:35   
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);
(0002096)
Stefan   
2019-09-11 22:58   
I can confirm that this is the problem. The very trivial patch attached fixes it for me.
(0002104)
Vincent Sanders   
2019-10-16 20:52   
resolved in a slightly different way to that suggested and cleaned up the code for future improvement.
(0002240)
Vincent Sanders   
2020-05-27 08:17   
Thankyou for reporting this issue.
We believe this is fixed in the 3.10 release.
If this is not the case please feel free to reopen the issue with additional details.

Issue History
2019-06-18 15:42vincentNew Issue
2019-08-01 09:58kinnisonNote Added: 0002039
2019-08-01 09:59Vincent SandersProjectBuildsystem => NetSurf
2019-08-01 10:26Michael DrakeStatusnew => acknowledged
2019-09-10 18:26StefanFile Added: netsurf_crash_backtrace
2019-09-10 18:26StefanNote Added: 0002094
2019-09-11 21:35StefanNote Added: 0002095
2019-09-11 22:58StefanFile Added: netsurf-3.9_download_callback_crash.patch
2019-09-11 22:58StefanNote Added: 0002096
2019-10-15 12:55Vincent SandersCategoryGeneral => GTK-specific
2019-10-15 13:00Vincent SandersAssigned To => Vincent Sanders
2019-10-15 13:00Vincent SandersStatusacknowledged => confirmed
2019-10-15 13:00Vincent SandersProduct Version => 3.8
2019-10-16 20:52Vincent SandersStatusconfirmed => resolved
2019-10-16 20:52Vincent SandersResolutionopen => fixed
2019-10-16 20:52Vincent SandersFixed in Version => 3.10
2019-10-16 20:52Vincent SandersNote Added: 0002104
2020-05-27 08:17Vincent SandersStatusresolved => closed
2020-05-27 08:17Vincent SandersNote Added: 0002240