Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • T Torsocks
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 36
    • Issues 36
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • Torsocks
  • Issues
  • #15584
Closed
Open
Created Apr 04, 2015 by Trac@tracbot

Linking libtorsocks with libtcmalloc results in SIGSEGV

Any application that is linked against libtcmalloc gets SISEGV if it's being run with libtorsocks preloaded. However, it depends on preloading order.

If libtorsocks is preloaded first, app segfaults:

[~]$ LD_PRELOAD="/usr/lib64/torsocks/libtorsocks.so /usr/lib64/libtcmalloc_debug.so" uname -a
[1]    7817 segmentation fault (core dumped)  LD_PRELOAD= uname -a

If, instead, libtcmalloc is preloaded first, everything is OK:

[~]$ LD_PRELOAD="/usr/lib64/libtcmalloc_debug.so /usr/lib64/torsocks/libtorsocks.so" uname -a
Linux spock 3.19.0-pf3 #1 SMP PREEMPT Tue Mar 24 17:14:04 EET 2015 x86_64 GNU/Linux

The problem is that if an app in question is linked against libtcmalloc, torifying it via "torify" or "torsocks" wrapper always leads to segfault because libtorsocks is loaded before libtcmalloc.

Attempt made to debug any app leads to non-informative backtrace:

#0  0x0000000000000000 in ?? ()
#1  0x00007ffff725e40c in ?? () from /usr/lib/libtcmalloc_debug.so.4
#2  0x00007ffff725ed3f in ?? () from /usr/lib/libtcmalloc_debug.so.4
#3  0x00007ffff725ef49 in NumCPUs() () from /usr/lib/libtcmalloc_debug.so.4
#4  0x00007ffff723b439 in ?? () from /usr/lib/libtcmalloc_debug.so.4
#5  0x00007ffff7dea1fa in call_init.part () from /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7dea30b in _dl_init () from /lib64/ld-linux-x86-64.so.2
#7  0x00007ffff7ddbdba in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8  0x0000000000000003 in ?? ()
#9  0x00007fffffffe47a in ?? ()
#10 0x00007fffffffe4aa in ?? ()
#11 0x00007fffffffe4af in ?? ()
#12 0x0000000000000000 in ?? ()

I use torsocks v2.0.0 and libtcmalloc v2.4.

So my questions are:

  1. should this be libtorsocks or libtcmalloc issue?
  2. how should I get more info on this bug?
  3. what should be done to fix the issue?

Trac:
Username: post-factum

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking