[Bug 1574270] Re: applications segfault systematically with tsocks
All, Thanks to the testers; thanks to the up-voters! It feels good not to be alone! ;-) However, I'm not sure what to do with this bug report now... The maintainer is in Cc, the Ubuntu Review Team is in Cc, the last uploader is in Cc. Yet, no reply so far. I know the tsocks code base is, to say the least, not the best I had to deal with; yet the reasons are pretty well explained and the patch itself pretty simple. It's a wonder the bug did not get exposed until only recently; it's been latent for all those years. I *am* ready to rework the patch if it is deemed to be not correct, but I can't do that without feedback. Heck, I would even consider volunteering to handle this package for the foreseable future if that would help (but I am not used to packaging; I'd need directions quite often). Quid? Regards, Yann E. MORIN. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Markus, All, Weird that it did not work for you. I retested it just right now, and it worked for me. Note however that I did a mistake when typing the command in the report: dpkg-buildpacakge is misspelled, it should be dpkg-buildpackage. Regards, Yann E. MORIN. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Dear Tamas, Dear Ubuntu Review Team, It's been more than a month that I have posted a proposal to fix this bug. In the meantime, I have tested this extensively (as *everything* gets out of my machine via tsocks) and I have had no issue at all. with the proposed patch. Can we at least get a status on this bug, even it is just a "won't fix" or "don't care" or whatever, please? ;-) Thanks! Regards, Yann E. MORIN PS. Adding Logan, as I see he pushed an update for yakkety not so long ago... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
** Attachment added: "Be sure to always intialise function pointers v2" https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+attachment/4655719/+files/07_always_init_function_pointers.dpatch ** Patch removed: "Be sure to always intialise function pointers" https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+attachment/4653856/+files/07_init.dpatch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Brendan, That's because the attached patch expects the bundled patches are already applied. Here's how I did (as non-root): $ sudo apt-get build-dep tsocks [--snip--] $ apt-get source tsocks [--snip--] $ cp 07_init.dpatch tsocks-1.8beta5/debian/patches/ $ cd tsocks-1.8beta5/ $ dpkg-buildpacakge -us -uc [--snip--] $ cd .. $ sudo apt-get purge tsocks $ sudo dpkg --install tsocks_1.8beta5-9.3_amd64.deb Also, to avoid tsocks being re-installed from the repository every time I run "make dist-upgrade", I simply uninstalled it before installing my locally-built tsocks (hence the "apt-get purge tsocks in the commands above). -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Oh, by the way, I just noticed that the description in the patch itself is wrong. I just copy-pasted the one from an existing patch to get the layout, but forgot to edit it afterward. I'll post an upated version of the patch shortly... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Mario, The "official" upstream tsocks has not done any release since October 2002, that is almost 14 years ago. Besides, there does nto seem to be any publicly available repository of any kind (no svn, no cvs or anything that was current at the time). I'm not sure it makes sense to send a patch to a dead project. If we were to consider Debian as the new upstream, I can't really report a bug there, as I don't use Debian so can't check if the bug also applies to them... However, the maintainer for this package in Ubuntu is also the maintainer for the same package in Debian. So, hopefully, he'd notice this bug! ;-) (Cc-ing Tamas now, so he does notice it.) In the meantime, it would be nice if you could also test on your side with your use-cases, so as to get a bit more confidence in the patch (which I only tested in my own use-case, and only lightly tested at that...). Cheers! -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
** Bug watch removed: Debian Bug tracker #576301 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576301 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
I managed to make it work with the attached patch. This is probably not a correct patch, but it at least makes it work, and can serve as a base for a correct patch. In the end, it happens that some libraries (like openssl) are initialised before those in LD_PRELOAD (which is really weird as ld.so does not document this behaviour). So, tsocks not being initialised, the wrapper functions were calling functions via un-initialised function pointers. ** Attachment added: "Be sure to always intialise function pointers" https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+attachment/4653856/+files/07_init.dpatch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
After a bit more investigation, I hacked tsocks to spit out debug log in its _init() function: FILE *f = fopen( "/home/me/tsocks.msg", "a+" ); fprintf( "[%s] Hello world\n", program_invocation_name ); fclose( f ); However, when running: $ tsocks ssh machine Segmentation fault The .msg file is *not* created at all! So, it seems something is trying to initialise openSSL before calling the _init() from tsocks... So, I tried with another program *not* linked with openSSL. I used curl, which is linked with GnuTLS: $ curl https://example.com/ [works!] Conclusion: openSSL does get initialised before tsocks. That's really weird, as tsocks is in LD_PRELOAD, so should come before any shared library from a NEEDED tag. /me is now investigating the linker documentation to understand what's goign on... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
After testing, it appears that neither patch fix the issue. There still are segfaults... -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
There is a (vey old!) related bug in the Debian bug tracker: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576301 There are two patches floating in that bug report, but they were never made part of any tsocks relase: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;att=1;filename=tsocks_fixpoll.patch;bug=576301 https://bugs.debian.org/cgi-bin/bugreport.cgi?filename=fix_poll.patch;att=1;bug=576301;msg=15 However, of the two patches, it is not obvious which is the correct solution; besides, they touch the exact same part of the code... I'll try to test each and will report back (soonish...) ** Bug watch added: Debian Bug tracker #576301 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576301 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] Re: applications segfault systematically with tsocks
Varga, Please don't replace the description. Add a comment if you need to. Thanks. ;-) ** Description changed: - i have a same problem with tsocks and ssh. + + On Xenial, when an application is used through tsocks, it will + systematically segfqult: + + $ ssh machine + [connection OK] + $ wget http://example.com/some/path + [download succeeds] + $ tsocks ssh machine + Segmentation fault + $ tsocks wget http://example.com/some/path + Segmentation fault + + $ lsb_release -rd + Description: Ubuntu 16.04 LTS + Release: 16.04 + + $ apt-cache policy tsocks + tsocks: + Installed: 1.8beta5-9.3 + Candidate: 1.8beta5-9.3 + Version table: + *** 1.8beta5-9.3 500 + 500 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages + 100 /var/lib/dpkg/status + + Expected: connections through tsocks succeed + + What happens: connections through tsocks systematically segfault + + Here's my tsocks.conf: + + $ cat /etc/tsocks.conf + local = 192.168.0.0/255.255.0.0 + server = 127.0.0.1 + server_port = 8083 + server_type = 5 + + Running through gdb: + + $ gdb ssh machine + [...] + (gdb) run + Starting program: /usr/bin/ssh + [Thread debugging using libthread_db enabled] + Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". + + Program received signal SIGSEGV, Segmentation fault. + 0x in ?? () + (gdb) bt + #0 0x in ?? () + #1 0x77670e77 in poll (__timeout=10, __nfds=1, __fds=0x7fffdb70) + at /usr/include/x86_64-linux-gnu/bits/poll2.h:46 + #2 RAND_poll () at rand_unix.c:325 + #3 0x7766fbd5 in ssleay_rand_bytes (buf=0x55804010 "\212\003", num=num@entry=60, + pseudo=pseudo@entry=0, lock=lock@entry=0) at md_rand.c:398 + #4 0x77670603 in drbg_get_entropy (ctx=, pout=0x7fffdec0, + entropy=, min_len=60, max_len=) at rand_lib.c:199 + #5 0x776e6278 in fips_get_entropy (dctx=dctx@entry=0x779a9960 , + pout=pout@entry=0x7fffdf30, entropy=, min_len=, + max_len=2147483632) at fips_drbg_lib.c:151 + #6 0x776e6904 in FIPS_drbg_instantiate (dctx=dctx@entry=0x779a9960 , + pers=pers@entry=0x7fffdf80 "OpenSSL DRBG2.0", perslen=perslen@entry=32) + at fips_drbg_lib.c:223 + #7 0x77670993 in RAND_init_fips () at rand_lib.c:302 + #8 0x775b3f7a in OPENSSL_init_library () at o_init.c:119 + #9 0x77de74ea in call_init (l=, argc=argc@entry=1, + argv=argv@entry=0x7fffe078, env=env@entry=0x7fffe088) at dl-init.c:72 + #10 0x77de75fb in call_init (env=0x7fffe088, argv=0x7fffe078, argc=1, + l=) at dl-init.c:30 + #11 _dl_init (main_map=0x77ffe168, argc=1, argv=0x7fffe078, env=0x7fffe088) + at dl-init.c:120 + #12 0x77dd7cfa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 + #13 0x0001 in ?? () + #14 0x7fffe4da in ?? () + #15 0x in ?? () + + Since Xenial does not have debugging symbols for tsocks, I can't provide much more (although + I'd gladly follow a quick and simple tutorial on doing so). + + For the record, it was working in Wily (15.10) and all previous + versions. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1574270] [NEW] applications segfault systematically with tsocks
Public bug reported: On Xenial, when an application is used through tsocks, it will systematically segfqult: $ ssh machine [connection OK] $ wget http://example.com/some/path [download succeeds] $ tsocks ssh machine Segmentation fault $ tsocks wget http://example.com/some/path Segmentation fault $ lsb_release -rd Description:Ubuntu 16.04 LTS Release:16.04 $ apt-cache policy tsocks tsocks: Installed: 1.8beta5-9.3 Candidate: 1.8beta5-9.3 Version table: *** 1.8beta5-9.3 500 500 http://fr.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages 100 /var/lib/dpkg/status Expected: connections through tsocks succeed What happens: connections through tsocks systematically segfault Here's my tsocks.conf: $ cat /etc/tsocks.conf local = 192.168.0.0/255.255.0.0 server = 127.0.0.1 server_port = 8083 server_type = 5 Running through gdb: $ gdb ssh machine [...] (gdb) run Starting program: /usr/bin/ssh [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Program received signal SIGSEGV, Segmentation fault. 0x in ?? () (gdb) bt #0 0x in ?? () #1 0x77670e77 in poll (__timeout=10, __nfds=1, __fds=0x7fffdb70) at /usr/include/x86_64-linux-gnu/bits/poll2.h:46 #2 RAND_poll () at rand_unix.c:325 #3 0x7766fbd5 in ssleay_rand_bytes (buf=0x55804010 "\212\003", num=num@entry=60, pseudo=pseudo@entry=0, lock=lock@entry=0) at md_rand.c:398 #4 0x77670603 in drbg_get_entropy (ctx=, pout=0x7fffdec0, entropy=, min_len=60, max_len=) at rand_lib.c:199 #5 0x776e6278 in fips_get_entropy (dctx=dctx@entry=0x779a9960 , pout=pout@entry=0x7fffdf30, entropy=, min_len=, max_len=2147483632) at fips_drbg_lib.c:151 #6 0x776e6904 in FIPS_drbg_instantiate (dctx=dctx@entry=0x779a9960 , pers=pers@entry=0x7fffdf80 "OpenSSL DRBG2.0", perslen=perslen@entry=32) at fips_drbg_lib.c:223 #7 0x77670993 in RAND_init_fips () at rand_lib.c:302 #8 0x775b3f7a in OPENSSL_init_library () at o_init.c:119 #9 0x77de74ea in call_init (l=, argc=argc@entry=1, argv=argv@entry=0x7fffe078, env=env@entry=0x7fffe088) at dl-init.c:72 #10 0x77de75fb in call_init (env=0x7fffe088, argv=0x7fffe078, argc=1, l=) at dl-init.c:30 #11 _dl_init (main_map=0x77ffe168, argc=1, argv=0x7fffe078, env=0x7fffe088) at dl-init.c:120 #12 0x77dd7cfa in _dl_start_user () from /lib64/ld-linux-x86-64.so.2 #13 0x0001 in ?? () #14 0x7fffe4da in ?? () #15 0x in ?? () Since Xenial does not have debugging symbols for tsocks, I can't provide much more (although I'd gladly follow a quick and simple tutorial on doing so). For the record, it was working in Wily (15.10) and all previous versions. ** Affects: tsocks (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1574270 Title: applications segfault systematically with tsocks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/tsocks/+bug/1574270/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 1082906] [NEW] hibernate item does not show up in menu when no swap active
Public bug reported: When no swap is active, the 'hibernate' item does not show up in the /system/ menu. I manually verified that hibernation works on my machine (using pm- hibernate), and it does. As I am using an SSD, I do not use any swap at all (I have enough RAM). However, I have an inactive swap partition that gets activated by a pm hook: cat /etc/pm/sleep.d/00-swap #!/bin/sh swap_device=$( awk '$0 ~ /^#/ { next; } $3==swap { printf( %s\n, $1 ); }' /etc/fstab ) case ${1} in hibernate) # Create and activate a clean swap mkswap ${swap_device} swapon ${swap_device} ;; thaw) swapoff ${swap_device} # Forget the old SWSUSP image after resuming dd if=/dev/zero of=${swap_device} bs=1048576 count=4 ;; esac Note: I need to cleanup the previous SWSUSP image, so the kernel does not pick it up after a normal, non-hibernate boot. If I manually activate the swap partition, then 'hibernate' shows up in the system menu. If the swap partition is not active, but only formatted, hibernate is not available; the swap has to be active. It somehow makes sense to disable hibernate if there is no swap, but using swap on an SSD risks wearing out the SSD very fast. ProblemType: Bug DistroRelease: Ubuntu 12.10 Package: policykit-1 0.104-2ubuntu1 ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7 Uname: Linux 3.5.0-18-generic i686 ApportVersion: 2.6.1-0ubuntu6 Architecture: i386 Date: Sun Nov 25 16:18:49 2012 InstallationDate: Installed on 2012-04-26 (212 days ago) InstallationMedia: Ubuntu 12.04 LTS Precise Pangolin - Release i386 (20120423) MarkForUpload: True ProcEnviron: SHELL=/bin/bash TERM=xterm PATH=(custom, no user) LANG=en_US.UTF-8 XDG_RUNTIME_DIR=set SourcePackage: policykit-1 UpgradeStatus: Upgraded to quantal on 2012-11-24 (0 days ago) ** Affects: policykit-1 (Ubuntu) Importance: Undecided Status: New ** Tags: apport-bug i386 quantal running-unity -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1082906 Title: hibernate item does not show up in menu when no swap active To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/policykit-1/+bug/1082906/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs