crosswire / xiphos

Xiphos is a Bible study tool written for Linux, UNIX, and Windows using GTK, offering a rich and featureful environment for reading, study, and research using modules from The SWORD Project and elsewhere.
http://xiphos.org
GNU General Public License v2.0
208 stars 51 forks source link

Slow startup of application on AMD platform #971

Open RepentAndBelieveTheGospel opened 4 years ago

RepentAndBelieveTheGospel commented 4 years ago

After I've changed the architecture of my PC from Intel to AMD (Ryzen 2700X), I've noticed Xiphos takes very long to start. I run the same version (4.1.0 x64) on an Intel computer at work, and it starts very fast.

It looks like it's hanging at one point. I have a video of the issue posted at the following link: http://s.go.ro/ogthzs3t.

ildar commented 4 years ago

Did you try with clean Xiphos config? (I though don't really know how to do that in Windows nowadays).

RepentAndBelieveTheGospel commented 4 years ago

Did you try with clean Xiphos config? (I though don't really know how to do that in Windows nowadays).

I did a clean install of Windows, so it can't get any cleaner than that :D.

karlkleinpaste commented 4 years ago

we have a recurring problem of xiphos seeming to hang for a while (a minute, sometimes 2, perhaps even 3) on its very first start. we have been unable for years to find this problem. it is very hard to diagnose because it happens exactly once on any single computer. without literally re-installing windows repeatedly to hunt for this probem, we simply can't find it.

suggestions from others seeing this report are welcome.

karlkleinpaste commented 4 years ago

closing for now, due to not having any new information with which to pursue the problem. someday, perhaps we'll get an indication of what it is that xiphos is (not) doing when it sits on 1st run. i'm guessing (and only that) there is some firewall-related foolishness going on. but i can't prove it, and nobody has any data to support any particular direction of analysis.

alerque commented 4 years ago

If it consistently happens, you could debug this using a virtual machine with anything that supports snapshots. Install a fresh Windows and get it to just before the failure, then snapshot it. Now it's a matter of seconds to revert to the pristine pre-failure condition and you can experiment with debugging to figure out what it is.

No I'm not volunteering. :stuck_out_tongue:

RepentAndBelieveTheGospel commented 4 years ago

The issue reproduces every time I start Xiphos on my current installation of Windows. I can offer you all you need in terms of diagnostics to help you debug this issue.

This is not the same issue as reported elsewhere, as the application doesn't hang indefinitely on its first run, but hangs for about 10 seconds every time I open it. I had a video upload of this issue when I opened the ticket, but removed it since; I can record another if you would like.

ildar commented 4 years ago

If that's a network-related problem, i'd advise:

  1. Try setting dns to 8.8.8.8 and see if it helps
  2. Record the network traffic with Wireshark

Or as an ultimate way running the ’gprof’ build...

karlkleinpaste commented 4 years ago

reproduces every time I start Xiphos on my current installation

well, that's new. reopen to give it consideration. but might not get to it right away.

RepentAndBelieveTheGospel commented 4 years ago

If that's a network-related problem, i'd advise: 1. Try setting dns to 8.8.8.8 and see if it helps 2. Record the network traffic with Wireshark Or as an ultimate way running the ’gprof’ build...

I don't believe it's network related.

I turned off the firewall to see if it starts faster than before, but to no avail. I turned off the internet connection and started the app; the same. I thought the app should have a check for an active internet connection and, if it had something to do with the network, then turning off the connection should cause it to skip over the troublemaking part.

I also set the repository to local, in case there were some background processes running at startup that could be related to this.

Any other ideas?

karlkleinpaste commented 4 years ago

because of a perversity in the windows version of webkit (responsible for display of all text widgets), in which an "abundance of caution" led the implementors to disallow access to files within a text source's directory, access to images and other potential inline content is done by xiphos creating a tiny web server inside itself, that listens on port 7878 and operates only on 127.0.0.1. yes, really, i'm not kidding. i didn't write it, but i helped debug it 10+ years ago. it was the only way to get embedded image content, which is prevalent in many modules.

so even with your external network access disconnected, xiphos is still staring at your system's net.navel (loopback network device).

xiphos doesn't care about (isn't even aware of) external network access unless you use the mod.mgr or start biblesync.

i'm not sure whether this has any bearing on xiphos' startup slowness, but i thought i'd mention it for completeness.

RepentAndBelieveTheGospel commented 4 years ago

xiphos creating a tiny web server inside itself

That's a pretty nifty solution, given the encountered limitations. I understand from your comment that there is no need to check anything network related when dealing with such an issue as a slow startup, since Xiphos isn't running any checks that have to do with it.

Looking forward to one of your suggestions in debugging this annoyance.

marawuti commented 4 years ago

This sounds somehow correlated with what I've been experiencing for quite some time - now with 4.2.1. To wit, if I haven't used xiphos in some time the startup hangs. I superstitiously started shutting down when it became "unresponsive" then eventually it would start up. I, as others, thought there was some remote config check that was getting hung.

So, here's the question: Can Microsoft Defender's firewall (Windows 10) be configured somehow to allow the loopback connection specifically - addr, port and all? I've taken a quick look at the initially provided checkboxes public vs. private networks. No joy, but that may be because it has only been a short time since my last usage.

This feels like there is a cache issue from my big systems experience, but I can't figure why there would be a cache or queue affecting a loopback connection.