termux / termux-root-packages

Termux packages that are only usable by root users.
Other
1.04k stars 293 forks source link

tshark segmentation fault #220

Closed vjancik closed 3 years ago

vjancik commented 3 years ago

Problem description Tshark reports a segmentation fault in dumpcap on usage.

Steps to reproduce sudo provided by tsu

sudo tshark -i wlan0

Output:

Running as user "root" and group "root". This could be dangerous. 
Capturing on 'wlan0' 
tshark: Child dumpcap process died: Segmentation violation
0 packets captured

Additionally: sudo dumpcap outputs

Capturing on 'wlan0'
Segmentation fault

Additional information Output of tshark --version:

~ $ tshark --version                            
TShark (Wireshark) 3.4.2 (Git commit a889cf1b1bf9)                                              
Copyright 1998-2020 Gerald Combs <gerald@wireshark.org> and contributors.
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/gpl-2.0.html>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiled (64-bit) with libpcap, without POSIX capabilities, without libnl, with
GLib 2.66.1, with zlib 1.2.11, without SMI, with c-ares 1.17.0, without Lua,
with GnuTLS 3.6.15, with Gcrypt 1.8.7, without Kerberos, without MaxMind DB
resolver, without nghttp2, without brotli, without LZ4, without Zstandard, 
without Snappy, with libxml2 2.9.10.
Running on Linux 3.18.120-perf-g51b110d, with 3577 MB of physical memory, with
locale C.UTF-8, with libpcap version 1.10.0 (with TPACKET_V3), with GnuTLS 
3.6.15, with Gcrypt 1.8.7, with zlib 1.2.11, binary plugins supported (0
loaded).                                        
Built using clang 4.2.1 Compatible Android (6454773 based on r365631c2) Clang
9.0.8 (https://android.googlesource.com/toolchain/llvm-project
98c855489587874b2a325e7a516b99d838599c6f).

Output of termux-info

Packages CPU architecture:
aarch64 
Subscribed repositories:
# sources.list deb https://termux.org/packages/ stable main    
# root-repo (sources.list.d/root.list)          deb https://dl.bintray.com/grimler/termux-root-packages-24 root stable 
# science-repo (sources.list.d/science.list)    deb https://dl.bintray.com/grimler/science-packages-24 science stable 
# game-repo (sources.list.d/game.list)          deb https://dl.bintray.com/grimler/game-packages-24 games stable   
Updatable packages:                             All packages up to date
Android version:                                9
Kernel build information: 
Linux localhost 3.18.120-perf-g51b110d #1 SMP PREEMPT Mon Aug 10 20:10:31 WIB 2020 aarch64 Android  
Device manufacturer:                            Xiaomi
Device model:                                   Mi A1
Grimler91 commented 3 years ago

Could you please try:

sudo TMPDIR=$PREFIX/tmp tshark -i wlan0

I don't get a seg fault, but I do get an error that $TMPDIR (that tsu sets to ~/.suroot/.tmp) does not exist. I'll patch it to always use $PREFIX/tmp if this fixes it for you as well.

vjancik commented 3 years ago

I can confirm this fixes the issue! Thank you!

On Fri, Jan 8, 2021, 09:00 Henrik Grimler notifications@github.com wrote:

Could you please try:

sudo TMPDIR=$PREFIX/tmp tshark -i wlan0

I don't get a seg fault, but I do get an error that $TMPDIR (that tsu sets to ~/.suroot/.tmp) does not exist. I'll patch it to always use $PREFIX/tmp if this fixes it for you as well.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/termux/termux-root-packages/issues/220#issuecomment-756610101, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAH6MJOISA6KEK5UNKD24DSY23QBANCNFSM4VZVEV3Q .

Grimler91 commented 3 years ago

Fixed it in tsu, should work out of the box after doing a pkg upgrade in 10 minutes or so.

Thanks for reporting!

jborme commented 2 years ago

The crash was fixed in wireshark. https://gitlab.com/wireshark/wireshark/-/issues/17828

Grimler91 commented 2 years ago

@jborme cool, thanks for investigating and fixing it!