termux / x11-packages

A set of packages using X11 Windows System.
Other
548 stars 145 forks source link

HexChat package does not resolve valid server hostnames #163

Closed KoraggKnightWolf closed 5 years ago

KoraggKnightWolf commented 5 years ago

Problem description When attempting to connect to a correctly configured IRC server (correct and valid IRC hostname/servername, correct port and settings for it (SSL or not, etc), HexChat hangs at the Connecting to irc.server.com line and does not ever succeed in resolving it. This loop continues for minutes, and must be manually aborted by canceling the connect attempt e.g. via using /quit . This occurs with all networks, also large, well-established ones with their given defaults, for example Rizon.

Steps to reproduce 1) use vncserver -localhost (to start up a vncserver instance) and have it also start up xfwm4 and startxfce4 2) use VNCViewer (standalone google play store app) to connect to the vncserver session 3) open up HexChat e.g. via typing hexchat into the aterm terminal 4) have HexChat attempt to connect to any network 5) observe how it just says Connecting to irc.server.com (where this is a valid servername that resolves, the servere/network is configured correctly etc)

Expected behavior HexChat connects to the network or at least attempts to fully establish the TCP connection (the IRC server/network rejecting the client for various possible reasons, e.g. banned from the network, requiring valid identd response, etc is also considered Expected behaviour)

System information Updatable packages: All packages up to date Subscribed repositories: https://dl.bintray.com/xeffyr/x11-packages-24 x11/main https://dl.bintray.com/grimler/science-packages-24 science/stable https://dl.bintray.com/grimler/game-packages-24 games/stable https://dl.bintray.com/termux/termux-packages-24 stable/main System information: Linux localhost 4.4.111-16070901 #1 SMP PREEMPT Tue Aug 27 19:16:00 KST 2019 aarch64 Android Termux-packages arch: aarch64 Android version: 9 Device manufacturer: samsung Device model: SM-A750FN

ghost commented 5 years ago

Just connected to freenode:

Screenshot of localhost:1 () at 2019-10-19 16:17:36

ghost commented 5 years ago

Quite strange issue where DNS resolution hangs. Maybe even something OS or device -specific as DNS resolution typically done by libc (maybe even network-specific).

KoraggKnightWolf commented 5 years ago

I have attempted with mobile data as well, which also leads to the same result of it never resolving the hostname. Also just using fluxbox instead of the xfce4 desktop environment has also lead to no changes. The issue is also not limited to networks as chat.freenode.net refuses to resolve as well. You mentioned the libc package, I have libc++ installed but Termux does not list just a libc package, am I lacking a dependency perhaps? It is also perhaps of interest that other IRC clients have no issues and can connect immediately to networks. pkg install irssi and having irssi connect functions as expected, so it is a bit strange just HexChat is effected by this.

ghost commented 5 years ago

Will also check on other device and AVD.

You mentioned the libc package Termux does not list just a libc package

libc is a /system/lib(64)?/libc.so. You can't install/uninstall it because it is a system component.

KoraggKnightWolf commented 5 years ago

I can confirm that /system/lib64/ contains a libc.so file on my device

KoraggKnightWolf commented 5 years ago

The only other GUI IRC client, loqui, has no issues connecting to networks. This seems to be specifically limited to HexChat on Termux.

KoraggKnightWolf commented 5 years ago

When running proot hexchat it will connect just fine, this will serve as a workaround, but what is the root cause of this issue?

ghost commented 5 years ago

Unreproducible on Android 8.0 aarch64 device with selinux/stock rom.

but what is the root cause of this issue?

SELinux or seccomp on Android 9. Maybe even ROM bug.

ghost commented 5 years ago

I'll try on Android 9 emulator to check whether issue is due to selinux/seccomp.

ghost commented 5 years ago

Yes, this is a seccomp-related issue. Strace detected following:

7008  --- SIGSYS {si_signo=SIGSYS, si_code=SYS_SECCOMP, si_call_addr=0xf39bfb39, si_syscall=__NR_setuid32, si_arch=0 /* AUDIT_ARCH_??? */} ---

Whole application doesn't crash since probably due to several threads/processes.

This is also answer why it works under proot.

ghost commented 5 years ago

Added fix https://github.com/termux/x11-packages/commit/6b355919525acf5c309a47032e52cb9d8b9a2823. Version 2.14.2-5 should work better.

KoraggKnightWolf commented 5 years ago

I can confirm with testing that his fix resolves the issue so I will mark this issue as closed. Thanks a lot for taking the time to look into and fixing this!