MantisBT - NetSurf
View Issue Details
0002787NetSurfGTK-specificpublic2020-08-09 04:302024-02-25 21:43
Reporterhappysmash27 
Assigned ToVincent Sanders 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSOS Version
Product Version3.10 
Target Version3.11Fixed in Version3.11 
Fixed in CI build #5196
Reported in CI build #
URL of problem page
Summary0002787: Unable to find resource pageinfo.gtk2.ui on resource path
DescriptionAfter running "make" on my system, running `./netsurf/nsgtk2 -v` fails with the following messages:

(0.000000) [INFO netsurf] frontends/gtk/gui.c:990 get_config_home: "/home/happysmash27/.config/netsurf"
(0.000027) [INFO netsurf] utils/log.c:268 nslog_init: NetSurf version '3.10 (24th May 2020)'
(0.000041) [INFO netsurf] utils/log.c:279 nslog_init: NetSurf on <Linux>, node <computer-pig.net>, release <5.7.8-gentoo>, version <#10 SMP Sun Jul 26 00:42:56 PDT 2020>, machine <x86_64>
(0.000216) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/netsurf.gtk2.ui
(0.000246) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/tabcontents.gtk2.ui
(0.000284) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/password.gtk2.ui
(0.000307) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/toolbar.gtk2.ui
(0.000335) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/downloads.gtk2.ui
(0.000355) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/globalhistory.gtk2.ui
(0.000374) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/localhistory.gtk2.ui
(0.000393) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/options.gtk2.ui
(0.000419) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/hotlist.gtk2.ui
(0.000451) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/cookies.gtk2.ui
(0.000481) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/viewdata.gtk2.ui
(0.000507) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/warning.gtk2.ui
(0.000551) [INFO netsurf] frontends/gtk/resources.c:261 init_resource: Unable to find resource pageinfo.gtk2.ui on resource path
GTK resources failed to initialise (NotFound)
Steps To ReproduceIf using Gentoo, try to install Netsurf in Portage (which will install all its dependencies).

After the package manager build fails (that's a separate bug, I think), download the Netsurf 3.10 source and run `make` in the root of the source.

Run `./netsurf/nsgtk2` or `./netsurf/nsgtk2 -v` while in Sway (a Wayland compositor).
Additional InformationGCC version: 8.4.0

GTK+ 2 version: 2.24.32-r1
TagsNo tags attached.
Attached Files

Notes
(0002279)
happysmash27   
2020-08-09 04:35   
The crash also occurs in i3wm, so I don't think it is a Wayland-specific problem.
(0002280)
happysmash27   
2020-08-09 04:46   
The same error also appears if I move ~/.config/netsurf to ~/.config/netsurf_old to get a fresh config:

% ./netsurf/nsgtk2 -v
(0.000000) [INFO netsurf] frontends/gtk/gui.c:1003 create_config_home: Attempting to create configuration directory
(0.000028) [INFO netsurf] frontends/gtk/gui.c:1039 create_config_home: "/home/happysmash27/.config/netsurf"
(0.000037) [INFO netsurf] utils/log.c:268 nslog_init: NetSurf version '3.10 (24th May 2020)'
(0.000052) [INFO netsurf] utils/log.c:279 nslog_init: NetSurf on <Linux>, node <computer-pig.net>, release <5.7.8-gentoo>, version <#10 SMP Sun Jul 26 00:42:56 PDT 2020>, machine <x86_64>
(0.000250) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/netsurf.gtk2.ui
(0.000285) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/tabcontents.gtk2.ui
(0.000316) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/password.gtk2.ui
(0.000346) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/toolbar.gtk2.ui
(0.000377) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/downloads.gtk2.ui
(0.000406) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/globalhistory.gtk2.ui
(0.000435) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/localhistory.gtk2.ui
(0.000463) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/options.gtk2.ui
(0.000488) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/hotlist.gtk2.ui
(0.000561) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/cookies.gtk2.ui
(0.000607) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/viewdata.gtk2.ui
(0.000639) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/warning.gtk2.ui
(0.000684) [INFO netsurf] frontends/gtk/resources.c:261 init_resource: Unable to find resource pageinfo.gtk2.ui on resource path
GTK resources failed to initialise (NotFound)

Looking at the source code, the error appears to be related to pageinfo.gtk2.ui not being found in the respath variable to init_resource... but what is the respath variable that is passed to the init_resource function? I'm not sure whether to try to find whichever file links to it, or to just use printf. Maybe I should try printf first.
(0002281)
happysmash27   
2020-08-09 04:51   
On second thought, maybe changing the log entry to the following might work:

NSLOG(netsurf, INFO, "Unable to find resource %s on resource path %s",
          resource->name, respath);

And... it seems to work!

(0.000000) [INFO netsurf] frontends/gtk/gui.c:990 get_config_home: "/home/happysmash27/.config/netsurf"
(0.000026) [INFO netsurf] utils/log.c:268 nslog_init: NetSurf version '3.10 (24th May 2020)'
(0.000034) [INFO netsurf] utils/log.c:279 nslog_init: NetSurf on <Linux>, node <computer-pig.net>, release <5.7.8-gentoo>, version <#10 SMP Sun Jul 26 00:42:56 PDT 2020>, machine <x86_64>
(0.000217) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/netsurf.gtk2.ui
(0.000246) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/tabcontents.gtk2.ui
(0.000268) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/password.gtk2.ui
(0.000289) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/toolbar.gtk2.ui
(0.000320) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/downloads.gtk2.ui
(0.000343) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/globalhistory.gtk2.ui
(0.000367) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/localhistory.gtk2.ui
(0.000390) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/options.gtk2.ui
(0.000407) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/hotlist.gtk2.ui
(0.000430) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/cookies.gtk2.ui
(0.000452) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/viewdata.gtk2.ui
(0.000470) [INFO netsurf] frontends/gtk/resources.c:240 init_resource: Found gresource path /org/netsurf/warning.gtk2.ui
(0.000503) [INFO netsurf] frontends/gtk/resources.c:261 init_resource: Unable to find resource pageinfo.gtk2.ui on resource path /home/happysmash27/.config/netsurf
GTK resources failed to initialise (NotFound)

Now the question is: How exactly is it supposed to find resources in ~/.config/netsurf? Or am I understanding this wrong?
(0002282)
happysmash27   
2020-08-09 05:01   
Correction:

NSLOG(netsurf, INFO, "Unable to find resource %s on resource path %s",
          resource->name, respath);

does not work. I forgot to edit it, but the actual line of code that works for logging is the following:

NSLOG(netsurf, INFO, "Unable to find resource %s on resource path %s",
          resource->name, *respath);
(0002283)
happysmash27   
2020-08-09 05:08   
Apparently, the entrypoint for this error is approximately line 1263 of gui.c:

/* initialise the gtk resource handling */
ret = nsgtk_init_resources(respaths);
if (ret != NSERROR_OK) {
    fprintf(stderr, "GTK resources failed to initialise (%s)\n",
        messages_get_errorcode(ret));
    return 1;
}

nsgtk_init_resources is, of course, on line 430 of resources.c.
(0002284)
happysmash27   
2020-08-09 05:11   
I think I just figured out what I was understanding wrong. respath is a pointer to a pointer of chars (i.e, an array of strings), not a pointer to chars (i.e, just one string). So of course that logging method doesn't work to give the full picture. Now the question is: where can I find the amount of strings to get a more full debug output?
(0002285)
Vincent Sanders   
2020-08-15 08:54   
This occurs because the gtk compiled in resource file was missing a reference to the gtk2 pageinfo ui template resulting in the resource being unavailable at runtime.

fixed with commit http://git.netsurf-browser.org/netsurf.git/commit/?id=410cb9a8fd9354b4c3b95824e135b64cc002986f on master, this could also be applied to the 3.10 release files to solve the runtime issue.
(0002437)
Vincent Sanders   
2024-02-25 21:43   
Issue resolved in 3.11 release

Issue History
2020-08-09 04:30happysmash27New Issue
2020-08-09 04:35happysmash27Note Added: 0002279
2020-08-09 04:46happysmash27Note Added: 0002280
2020-08-09 04:51happysmash27Note Added: 0002281
2020-08-09 05:01happysmash27Note Added: 0002282
2020-08-09 05:08happysmash27Note Added: 0002283
2020-08-09 05:11happysmash27Note Added: 0002284
2020-08-15 08:54Vincent SandersAssigned To => Vincent Sanders
2020-08-15 08:54Vincent SandersReproducibilityhave not tried => always
2020-08-15 08:54Vincent SandersStatusnew => resolved
2020-08-15 08:54Vincent SandersResolutionopen => fixed
2020-08-15 08:54Vincent SandersFixed in Version => 3.11
2020-08-15 08:54Vincent SandersTarget Version => 3.11
2020-08-15 08:54Vincent SandersFixed in CI build # => 5196
2020-08-15 08:54Vincent SandersNote Added: 0002285
2024-02-25 21:43Vincent SandersStatusresolved => closed
2024-02-25 21:43Vincent SandersNote Added: 0002437