Superbil / tunnelblick

Automatically exported from code.google.com/p/tunnelblick
1 stars 0 forks source link

Tunnelblick consumes too much CPU time #211

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start Tunnelblick
2. start e.g. top(1)
3. Tunnelblick consumes ~17% CPU time - without any connection being 
established!

What is the expected output?

Tunnelblick should consume less CPU time. Other idle apps on this MacBook Pro 
consume almost no CPU time.

What do you see instead?

$ top
ID     COMMAND         %CPU     TIME
270-   Tunnelblick     17.9 08:29:43
[...]

What version of Tunnelblick are you using? On what version of OS X?

Tunnelblick 3.2.6 (build 2891.3007)  -  OpenVPN 2.2.1
MacOS 10.7.4

As stated above, no connection has been established yet. dtruss(1m) shows the 
following:

$ sudo dtruss -elfda -p `pgrep Tunnelblick`
Password:
        PID/THRD  RELATIVE  ELAPSD    CPU SYSCALL(args)                  = return
  270/0x4e2:  30547926146     214      0 gettimeofday(0xBFFFE628, 0x0, 0x3)              = 1344406755 0
  270/0x4e2:  30547930889     160      0 gettimeofday(0xBFFFE738, 0x0, 0x3)              = 1344406755 0
  270/0x521cc:    809698 5000961      9 kevent(0x13, 0x0, 0x0)           = 0 0
  270/0x555:   1240968 5000645     10 kevent(0x4, 0x0, 0x0)              = 0 0
  270/0x4e2:  30549461438      17      3 gettimeofday(0xBFFFE628, 0x0, 0x3)              = 1344406764 0
[...]
^C
CALL                                        COUNT
kevent                                          4
gettimeofday                                   33

Original issue reported on code.google.com by ckujau on 8 Aug 2012 at 6:28

GoogleCodeExporter commented 9 years ago
Sample from Tunnelblick.app (via "Activity Monitor")

Original comment by ckujau on 8 Aug 2012 at 6:32

Attachments:

GoogleCodeExporter commented 9 years ago
Thanls for your report.

From the sample, it looks like Tunnelblick is displaying the "Info" view. 

Is that the situation?

What is the CPU use when you click on some other panel, that doesn't do 
anything?

Original comment by jkbull...@gmail.com on 8 Aug 2012 at 10:35

GoogleCodeExporter commented 9 years ago
Hah! Good catch! I had to reboot the box (for other reasons) and wondered why 
the higher CPU usage from Tunnelblick is now gone and was tempted to file it 
under "Heisenbug" :-)

But indeed, when I click "VPN Details" -> "Info" and the credits start to 
scroll by, CPU usage is at 31%, even when I put the window in the background.

When I close the "VPN Details -> Info" Window, CPU usage from Tunnelblick is 
still at ~17%.

I have to open "VPN Details" again and per default it displays the 
"Configurations" tab and CPU usage is gone. Clicking "Info" again and CPU usage 
is back up when the credits start to scroll.

Workaround:

Before closing the "VPN Details -> Info" Window, switch to a different tab 
(e.g. "Preferences") and then close the "VPN Details" window. Now CPU usage 
from Tunnelblick is not noticable.

Original comment by ckujau on 13 Aug 2012 at 12:54

GoogleCodeExporter commented 9 years ago
Thanks for looking into this and providing something I can work with to fix it.

This was fixed in 3.2beta30 (2011-08-31), but there must have been a regression 
by 3.2.6.

It does not seem to happen in 3.3beta18.

I don't think it is worth trying to fix in the 3.2 branch.

I am marking this as "Fixed" because it is fixed in the source code for 
3.3beta18. (Well, long before that, but I don't feel the need to pinpoint 
exactly when it was fixed.)

Thanks again for publishing the workaround; it will help others using the 3.2 
branch.

Original comment by jkbull...@gmail.com on 13 Aug 2012 at 1:10

GoogleCodeExporter commented 9 years ago
I haven't upgraded to the 3.3 branch yet, but thanks for the fix!

Original comment by ckujau on 13 Aug 2012 at 2:34