-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dillo 3.1.0: Freeze on Nav_open_url in Cygwin #172
Comments
Does it also happen with Xorg? https://github.com/dillo-browser/dillo/blob/master/doc/install.md#windows-via-cygwin |
Yes it does, same issue after using startxwin and then connecting to the X server via a different cygwin terminal window. |
I cannot reproduce it when using mbedTLS 2.23.0, I will try with OpenSSL too. |
I can reproduce it with OpenSSL 3.0.13. I will take a look and see if I can find the problem, thanks for reporting. In the meanwhile, you can install mbedTLS (mbedtls-devel) and configure Dillo with |
Thank you for looking into this and confirming! |
There seems to be a problem which only occurs with OpenSSL and when the threaded DNS resolver is enabled. When building with OpenSSL, you can disable the threaded DNS resolver by configuring Dillo with I cannot see where the problem is coming from, as the stack seems corrupted from GDB:
|
So, I took a look and what seems to be happening is that after a thread is spawned to resolve a host, the thread finishes and exits by returning NULL. The control is returned to cygwin, at which point the
Causing a SEGFAULT in the next push instruction. I'm not sure if this is a problem on Cygwin or on Dillo side. I cannot enable Asan on Cygwin, as it doesn't seem to be supported. With the stack protector enabled, there is no warning of any kind. |
Well, it seems the rbp register is not the problem, as it enters the Dns_server function with value zero. The problem seems to be the detached state:
When that line is removed, the thread works fine. But when it is set, the alloca call done by cywgin after the thread finishes is failing. This starts to look like a bug in Cygwin. As a workaround, disabling DNS threads seems to be the best solution for now. |
I don't know if this information is useful in determining whether Cygwin is the issue or not, but interestingly when I compile the links2 browser: http://links.twibright.com/, I need to run with -async-dns disabled otherwise the browser crashes after loading more than one page - also using same openssl. |
Here is a reproducer which causes a SEGFAULT with OpenSSL only:
This is likely a bug in Cygwin triggered by OpenSSL, so I will report it to them. In the meanwhile I will modify the documentation for Windows to disable the threaded DNS resolver, |
Cygwin doesn't seem to support detached threads used by the threaded DNS resolver at the same time the dynamic OpenSSL library is used. As a workaround we suggest disabling the threaded DNS (will use the same thread) if building with OpenSSL on Cygwin. Fixes: #172
Thank you again for looking into this so quickly and keeping me updated on this! Appreciate your work. Let me know if appropriate to close now. |
Don't worry, it will be closed automatically when I merge #173 :-) |
In updated Cygwin, using 3.1.0 release of Dillo, I am encountering process freezes when attempting to open Urls:
Windows 11, 64 bit
Cygwin64 terminal
VcXsrv 1.20.14.0
Console:
$ DISPLAY=:0.0 dillo
paths: Cannot open file '/home/someuser/.dillo/dillorc': No such file or directory
paths: Using /usr/local/etc/dillo/dillorc
paths: Cannot open file '/home/someuser/.dillo/keysrc': No such file or directory
paths: Using /usr/local/etc/dillo/keysrc
paths: Cannot open file '/home/someuser/.dillo/domainrc': No such file or directory
paths: Using /usr/local/etc/dillo/domainrc
Domain: Default accept.
dillo_dns_init: Here we go! (threaded)
TLS library: OpenSSL 3.0.13 30 Jan 2024
Disabling cookies.
paths: Cannot open file '/home/someuser/.dillo/hsts_preload': No such file or directory
paths: Using /usr/local/etc/dillo/hsts_preload
Nav_open_url: new url='about:splash'
Nav_open_url: new url='https://dillo-browser.github.io/'
Dns_server [0]: dillo-browser.github.io is 185.199.108.153 185.199.110.153 185.199.109.153 185.199.111.153
Connecting to 185.199.108.153:443
dillo-browser.github.io: TLSv1.3, cipher TLS_AES_128_GCM_SHA256
sha256 2048-bit RSA: /C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=*.github.io
sha256 2048-bit RSA: /C=US/O=DigiCert Inc/CN=DigiCert Global G2 TLS RSA SHA256 2020 CA1
root: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert Global Root G2
Nav_open_url: new url='https://www.fltk.org/'
At this point the application becomes unresponsive and I need to kill via Task Manager.
The text was updated successfully, but these errors were encountered: