Opened 3 years ago

Closed 8 months ago

#18614 closed defect (worksforme)

tor uses full cpu when unplugged

Reported by: zqcxobbe Owned by: ahf
Priority: High Milestone: Tor: unspecified
Component: Core Tor/Tor Version:
Severity: Normal Keywords: tor, cpu, hang, tor-client, sponsor8-maybe, resource-management, 034-triage-20180328, 034-deferred-20180602, 035-removed-20180711
Cc: Actual Points:
Parent ID: #25500 Points:
Reviewer: Sponsor: Sponsor8-can

Description

Hi. Here goes another stupid report of mine. I'm sorry:

When I unplug my network cord, tor starts using my full cpu. If I run service tor stop, it loops and never kills it. I have to kill it with a SIGPWR. I don't know if it's related, but I use wicd.

How do I debug this to provide useful information? If we can prevent disclosing my OS, that would be nice.

Child Tickets

Change History (25)

comment:1 in reply to:  description Changed 3 years ago by zqcxobbe

Replying to zqcxobbe:

Hi. Here goes another stupid report of mine. I'm sorry:

When I unplug my network cord, tor starts using my full cpu. If I run service tor stop, it loops and never kills it. I have to kill it with a SIGPWR. I don't know if it's related, but I use wicd.

How do I debug this to provide useful information? If we can prevent disclosing my OS, that would be nice.

I forgot to say that I am using torsocks with another application when this happens. I built torsocks by myself in this way: https://trac.torproject.org/projects/tor/ticket/8398#comment:9

comment:2 Changed 3 years ago by zqcxobbe

I managed to solve it, and I cannot reproduce anymore. What I did was to install torsocks from official repositories, and re-install it with my own version. The problem is gone, and I cannot make it happen again. I tried to remove the official version before reinstalling, but that did not bring back the problem. I don't know what happened.

comment:3 Changed 3 years ago by zqcxobbe

Resolution: fixed
Status: newclosed

comment:4 in reply to:  2 Changed 3 years ago by zqcxobbe

Resolution: fixed
Status: closedreopened

Replying to zqcxobbe:

I managed to solve it, and I cannot reproduce anymore. What I did was to install torsocks from official repositories, and re-install it with my own version. The problem is gone, and I cannot make it happen again. I tried to remove the official version before reinstalling, but that did not bring back the problem. I don't know what happened.

It's still there. How it happened: suspended the computer, unplugged network and power cords, started the computer (came back from suspension) without power cord (laptop), worked a little on unrelated stuff (no torsocks running) and after a couple of minutes, tor started using up to 98% of the CPU.

comment:5 Changed 3 years ago by cypherpunks

Keywords: hang added

What tor version? (what configure options used?) What libevent version?

How do I debug this to provide useful information?

To debug, it would be good to know where we're actually freezing. Try running with "DisableDebuggerAttachment 0", then if it locks up again, attach a debugger with "gdb -p {PID of tor}", and use "bt" to get a stack trace and figure out where Tor is stalled?

comment:6 in reply to:  5 Changed 3 years ago by zqcxobbe

Replying to cypherpunks:

What tor version? (what configure options used?) What libevent version?

Tor version 0.2.7.6 (git-605ae665009853bd).
2.0.21-stable-1ubuntu1 libevent-2.0-5_2.0.21-stable-1ubuntu1_amd64.deb

However, and I'm really sorry, I haven't been able to reproduce this. I swear by all that is free that this happened to me at least three times. If it happens again, I will use your instructions and report. Double apologies if this was a duplicate. I did search for something similar (freezing is not really what happened; it started to again as soon as I plugged back the cord).

Thank you again for my getting my privacy back.

comment:7 Changed 3 years ago by zqcxobbe

Status: reopenedneeds_information

comment:8 in reply to:  5 Changed 3 years ago by zqcxobbe

Replying to cypherpunks:

To debug, it would be good to know where we're actually freezing. Try running with "DisableDebuggerAttachment 0", then if it locks up again, attach a debugger with "gdb -p {PID of tor}", and use "bt" to get a stack trace and figure out where Tor is stalled?

It happened again. I tried the suggestion above, but I only got "No stack" in gdb. Any ideas of how to get some useful information?

comment:9 Changed 3 years ago by cypherpunks

I only got "No stack" in gdb

"Could not attach to process." and/or "ptrace: Operation not permitted." too?

comment:10 in reply to:  9 ; Changed 3 years ago by zqcxobbe

Replying to cypherpunks:

"Could not attach to process." and/or "ptrace: Operation not permitted." too?

I don't remember any of that, but I'll check when it happens again.

comment:11 in reply to:  10 Changed 3 years ago by zqcxobbe

Replying to zqcxobbe:

Replying to cypherpunks:

"Could not attach to process." and/or "ptrace: Operation not permitted." too?

I don't remember any of that, but I'll check when it happens again.

I hope that this helps

$ sudo gdb -p 2369

GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Attaching to process 2369
Reading symbols from /usr/bin/tor...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libz.so.1
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libm-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libm.so.6
Reading symbols from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
Reading symbols from /lib/x86_64-linux-gnu/libssl.so.1.0.0...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libssl.so.1.0.0
Reading symbols from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
Reading symbols from /usr/lib/x86_64-linux-gnu/libseccomp.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libseccomp.so.2
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libpthread-2.19.so...done.
done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Loaded symbols for /lib/x86_64-linux-gnu/libpthread.so.0
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libc.so.6
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libdl.so.2
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.19.so...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libgcc_s.so.1
Reading symbols from /lib/x86_64-linux-gnu/libnss_compat.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnss_compat-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libnss_compat.so.2
Reading symbols from /lib/x86_64-linux-gnu/libnsl.so.1...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnsl-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libnsl.so.1
Reading symbols from /lib/x86_64-linux-gnu/libnss_nis.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnss_nis-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libnss_nis.so.2
Reading symbols from /lib/x86_64-linux-gnu/libnss_files.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnss_files-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libnss_files.so.2
0x000056505b2d65b0 in circuit_get_global_list ()
(gdb) bt
#0  0x000056505b2d65b0 in circuit_get_global_list ()
#1  0x000056505b2e27fa in circuit_stream_is_being_handled ()
#2  0x000056505b2d0878 in ?? ()
#3  0x000056505b2d429c in circuit_establish_circuit ()
#4  0x000056505b2e5051 in circuit_launch_by_extend_info ()
#5  0x000056505b2e5b75 in ?? ()
#6  0x000056505b2e6422 in connection_ap_handshake_attach_circuit ()
#7  0x000056505b306cf8 in connection_ap_handshake_rewrite_and_attach ()
#8  0x000056505b336d3f in ?? ()
#9  0x00007feed8b0efd3 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#10 0x00007feed8b0f0a9 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#11 0x00007feed8af2f24 in event_base_loop ()
   from /usr/lib/x86_64-linux-gnu/libevent-2.0.so.5
#12 0x000056505b25e49d in do_main_loop ()
#13 0x000056505b2625ad in tor_main ()
#14 0x000056505b25b7e9 in main ()

comment:12 Changed 3 years ago by nickm

Milestone: Tor: 0.2.???

move some milestone-free tickets into 0.2.???

comment:13 Changed 3 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:14 Changed 3 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:15 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:16 Changed 2 years ago by nickm

Keywords: tor-client sponsor8-maybe resource-management added
Priority: MediumHigh

comment:17 Changed 2 years ago by nickm

Milestone: Tor: unspecifiedTor: 0.3.2.x-final
Sponsor: Sponsor8-can

comment:18 Changed 22 months ago by nickm

Milestone: Tor: 0.3.2.x-finalTor: 0.3.4.x-final

comment:19 Changed 17 months ago by nickm

Keywords: 034-triage-20180328 added

comment:20 Changed 16 months ago by ahf

Owner: set to ahf
Status: needs_informationassigned

Began looking into this last week, marking myself as assigned.

comment:21 Changed 15 months ago by nickm

Keywords: 034-deferred-20180602 added
Milestone: Tor: 0.3.4.x-finalTor: 0.3.5.x-final

Deferring non-must tickets to 0.3.5

comment:22 Changed 15 months ago by arma

See also #25461 and #24857 for other profiling / cpu load tickets. Should we merge them, or pick our favorite and close the others?

comment:23 Changed 15 months ago by teor

Parent ID: #25500

comment:24 Changed 14 months ago by nickm

Keywords: 035-removed-20180711 added
Milestone: Tor: 0.3.5.x-finalTor: unspecified

These tickets are being triaged out of 0.3.5. The ones marked "035-roadmap-proposed" may return.

comment:25 Changed 8 months ago by nickm

Resolution: worksforme
Status: assignedclosed

We've made a lot of progress since this was opened, and rewritten most of the periodic event code. Please reopen if this is still happening with 0.3.5.x or later.

Note: See TracTickets for help on using tickets.