Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-06-03 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by cypherpunks):

 its a win32 builds code bug (x64 too)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-21 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by bolvan):

 It doesnt seem to be related to the compiler. Its a bug in the windows
 specific code.
 I compiled in recent wingw-w64 on windows and bug was there

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-21 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by cypherpunks):

 Is this reproducible with MinGW-W64 trunk?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-21 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by ahf):

 It is serious and we plan on fixing this bug. Right now (end of May 2019)
 we are finishing off a sponsor and trying to get 0.4.1 shipped. Once we
 are done with that work, we will get to this. The priority of this bug is
 still considered high.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-21 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by bolvan):

 This bugs makes tor relay unusable under windows.
 All windows relay operators should stop their nodes.
 Is it serious enough ?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-16 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---

Comment (by nickm):

 (This is worth doing, but it is not in scope for stable.)

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-05-16 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
---+---
 Reporter:  bolvan |  Owner:  ahf
 Type:  defect | Status:  assigned
 Priority:  High   |  Milestone:  Tor:
   |  unspecified
Component:  Core Tor/Tor   |Version:  Tor:
   |  0.3.5.8
 Severity:  Normal | Resolution:
 Keywords:  windows 035-backport 042-proposed  |  Actual Points:
Parent ID: | Points:
 Reviewer: |Sponsor:
---+---
Changes (by nickm):

 * keywords:  windows 035-backport => windows 035-backport 042-proposed
 * milestone:  Tor: 0.4.0.x-final => Tor: unspecified


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-17 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  High  |  Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows 035-backport  |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+

Comment (by bolvan):

 You can use gdb. I'm not too good in gdb so I used
 [https://github.com/rainers/cv2pdb/releases]  to convert dwarf debug info
 to pdb and then used visual studio.
 It will ask source file location first. It will be able to set breakpoint
 although it could not watch vars. I used disassemble and register window
 to read value

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-17 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  High  |  Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows 035-backport  |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+

Comment (by cypherpunks):

 can you describe howto trace this down or link to info about howto? i also
 have a reproduceable  "100% cpu all cores" problem. thanks and thanks for
 running relay.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  High  |  Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows 035-backport  |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+

Comment (by nickm):

 One possible fix here would be to use ConditionVariable instead; it's been
 in Windows since Vista.

 If we don't that route, here is a part that looks suspicious to me: the
 generation count getting stuck at 28 suggests to me that we are using
 generation wrong.  In any case, we should really be either waking up or
 sleeping with each time through the loop, I think.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  High  |  Milestone:  Tor: 0.4.0.x-final
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows 035-backport  |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+
Changes (by nickm):

 * priority:  Medium => High
 * keywords:  windows => windows 035-backport
 * milestone:   => Tor: 0.4.0.x-final


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  Medium|  Milestone:
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--

Comment (by bolvan):

 only worker_thread_main  calls tor_cond_wait
 personally i dont run as a client but another person who does  reports
 client mode do not cause problem, only relay does

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  Medium|  Milestone:
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--

Comment (by ahf):

 Have you been able to debug which call to `tor_cond_wait()` that is being
 problematic?

 And this is only when running as a relay, right? You have not seen this
 condition when running as a client?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  Medium|  Milestone:
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--

Comment (by bolvan):

 Yes, 0.4.0.4-rc   same bug

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  Medium|  Milestone:
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--

Comment (by bolvan):

 For me it never happened in linux. Problem seem to be winthreads specific.
 I'll build 0.4.x and check

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  ahf
 Type:  defect| Status:  assigned
 Priority:  Medium|  Milestone:
Component:  Core Tor/Tor  |Version:  Tor: 0.3.5.8
 Severity:  Normal| Resolution:
 Keywords:  windows   |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--
Changes (by ahf):

 * status:  new => assigned
 * owner:  (none) => ahf
 * keywords:  winthreads tor_cond_wait => windows


Comment:

 Interesting, I have not seen this yet myself, but I also never ran a Tor
 relay on Windows.

 Have you been able to reproduce this with 0.4.x/master?

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

[tor-bugs] #30187 [Core Tor/Tor]: 100% cpu usage in winthreads tor_cond_wait

2019-04-15 Thread Tor Bug Tracker & Wiki
#30187: 100% cpu usage in winthreads tor_cond_wait
--+--
 Reporter:  bolvan|  Owner:  (none)
 Type:  defect| Status:  new
 Priority:  Medium|  Component:  Core Tor/Tor
  Version:  Tor: 0.3.5.8  |   Severity:  Normal
 Keywords:  winthreads tor_cond_wait  |  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--
 For years I run relay using self-compiled win64 version of tor.
 Compiler mingw64.
 Relay runs well for some time but suddenly starts using 100% cpu all
 cores.
 I traced where it happens. The following loop never ends :

 {{{

   do {
 DWORD res;
 res = WaitForSingleObject(cond->event, ms);
 EnterCriticalSection(>lock);
 if (cond->n_to_wake &&
 cond->generation != generation_at_start) {
   --cond->n_to_wake;
   --cond->n_waiting;
   result = 0;
   waiting = 0;
   goto out;
 } else if (res != WAIT_OBJECT_0) {
   result = (res==WAIT_TIMEOUT) ? 1 : -1;
   --cond->n_waiting;
   waiting = 0;
   goto out;
 } else if (ms != INFINITE) {
   endTime = GetTickCount();
   if (startTime + ms_orig <= endTime) {
 result = 1; /* Timeout */
 --cond->n_waiting;
 waiting = 0;
 goto out;
   } else {
 ms = startTime + ms_orig - endTime;
   }
 }
 /* If we make it here, we are still waiting. */
 if (cond->n_to_wake == 0) {
   /* There is nobody else who should wake up; reset
* the event. */
   ResetEvent(cond->event);
 }
   out:
 LeaveCriticalSection(>lock);
   } while (waiting);

 }}}


 res = WAIT_OBJECT_0;
 ms = INFINITE;
 cond->n_to_wake=0x11
 cond->generation=0x28
 generation_at_start=0x28


 it means no path with "goto out" ever execute
 more than one thread run this loop and each one eat separate core

 Some people I shared binaries with report same problem.
 Pls check

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs