aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2] 3

Author Topic: rc7: aMule stalls if i get a high id  (Read 15025 times)

lionel77

  • Provider of Mac builds, Forum Mod
  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 1107
  • Mac OS X 10.4 (Power Mac G5)
Re: rc7: aMule stalls if i get a high id
« Reply #15 on: October 22, 2004, 03:18:05 AM »

do you mean just disabling udp transfers in the preferences (->connections)?
i tried that but it didn't seem to make a difference.
btw, while testing this i managed to get the freeze effect on the two servers that i mentioned above as freeze-free...


iirc you said somewhere else that you are running amule under os x now, too, but apparently you are not experiencing the same problems that we do. so another strategy could be to try to figure out what makes your setup differerent from ours: do you use a newer version of wxWidgets than 2.5.3 and do you use wxCocoa instead of wxMac?
Logged
Current aMule CVS builds for OS X can be found here.

EvoErik

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 7
Re: rc7: aMule stalls if i get a high id
« Reply #16 on: October 22, 2004, 11:30:30 AM »

Quote
Originally posted by phoenix

Sorry, but I disagree. If you just wait for rc8, you will get the same problem in rc8. We must fix that.
Agreed! What can I/we do to help you?

Regards,
Erik
Logged

m2kio

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 152
    • http://little-bat.de
Re: rc7: aMule stalls if i get a high id
« Reply #17 on: October 22, 2004, 01:36:44 PM »

hi,
i also disabled UDP and restarted aMule for security. Still stalling.
i disconnected from server and waited: still stalling.

btw: set statistics refresh to 1 sec. this is the best way to detect stalling.

it runs for some secs, and stalls for some secs. running and stalling period is from 1 sec to 1 minute. no pattern to see here.

i suspect, also taking into consideration the "sample amule 1" output, that its always hanging in GSocket.
Quote
98 GSocket::WaitConnection()
98 GSocket::Input_Timeout()
98 select
98 select

Is there anybody for whom aMule does not behave like this? - please raise your hand! Do you have a dual processor Mac? (just guessing..)

    ... kio !
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: rc7: aMule stalls if i get a high id
« Reply #18 on: October 22, 2004, 02:33:39 PM »

me, and yes: dual
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: rc7: aMule stalls if i get a high id
« Reply #19 on: October 22, 2004, 03:09:33 PM »

I am not on Mac. This can be a Mac specific socket issue.

Kry, I was thinking, maybe we could for 2.1 remove that wx socket code, i dont know. It is a hell of a change, but do you think that normal socket api would cause multiplatform trouble?
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: rc7: aMule stalls if i get a high id
« Reply #20 on: October 22, 2004, 03:55:00 PM »

I agree wxSocket creates more problems than any other thing, but we assure multiplatform in the most important thing on a p2p app....


What about fixing wxSocket instead :P they're short on devs ;)
Logged

giliii

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Re: rc7: aMule stalls if i get a high id
« Reply #21 on: October 24, 2004, 11:13:16 AM »

A Funny thing I noticed when using gdb was..

With default settings or udp disabled:

Initialising aMule
Userhash loaded: AB27BB14370EF6F558DE854185BE6F04
*** UDP socket at 4670
*** UDP socket at 4670
Reading symbols for shared libraries . done
… (AICH work)
*** TCP socket at 4667
ListenSocket: Ok.


When I change tcp and udp (to 4674 )ports

Userhash loaded: AB27BB14370EF6F558DE854185BE6F04
*** UDP socket at 4672
*** UDP socket at 4674
Reading symbols for shared libraries . done
….
*** TCP socket at 4669
ListenSocket: Ok.


Changed once more to.. udp (6453):

*** UDP socket at 4672
*** UDP socket at 6453

It’s strange...


Another thing I noticed is when UDP is disabled it still opens the UDP socket, I guess if it’s disabled it wasn’t supposed to open it!(saw this using a the network utility)
« Last Edit: October 24, 2004, 11:14:34 AM by giliii »
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: rc7: aMule stalls if i get a high id
« Reply #22 on: October 24, 2004, 07:19:50 PM »

giliii,

Watch out! You have two udp sockets at the same address:

Quote
Userhash loaded: AB27BB14370EF6F558DE854185BE6F04
*** UDP socket at 4670
*** UDP socket at 4670
Reading symbols for shared libraries . done
& (AICH work)
*** TCP socket at 4667
ListenSocket: Ok.

One of the UDP sockets is always the aMule TCP socket plus 3, so take care with that.
Logged

ken

  • Hero Member
  • *****
  • Karma: 4
  • Offline Offline
  • Posts: 825
Re: rc7: aMule stalls if i get a high id
« Reply #23 on: October 26, 2004, 01:36:41 AM »

Quote
Originally posted by m2kio
Is there anybody for whom aMule does not behave like this? - please raise your hand! Do you have a dual processor Mac? (just guessing..)
aMule is working pretty well for me.  However, I'm behind a firewall that I don't control, so I always have Low ID.  As I understand it, aMule works pretty well for you if you accept having a Low ID.  So, I don't know if my experience is actually any different than yours.  Also, I have dual processors.

As a somewhat educated observer, here are my observations on the stack trace revealed by sample:

1) select() is ultimately being called in the main event loop.  This should never happen unless with timeout 0 so that it is just a poll().  Maybe a bug is preventing select() from honoring a 0 timeout?  Although, since the freezes aren't permanent, some timeout appears to be in effect.

2) The sockets are probably being created as non-blocking.  There's a chance that due to a bug in wxMac (or maybe Mac OS X), the socket isn't behaving as non-blocking.  However, this might make accept() block when it shouldn't, but wouldn't be expected to change the behavior of select().

[... Ken spends some time looking at the code ...]

Um, OK, I've found something very confusing and troubling.  In CListenSocket::OnAccept, there's a call to wxSocketServer::AcceptWith with the 'wait' parameter specifically set to 'true'.  Also, there's a whole thing with tracking the number of pending connections (m_nPeningConnections [sic]).  Why not just call AcceptWith(..., false) until it fails?  Don't bother tracking pending connections at all.  Or, just call AcceptWith(..., false) once and, if there are more pending connections queued up, rely on GSocket/wxSocketServer to issue further notifications/events.  Unless I misread the code, it will issue such notifications until the queue is empty.

I think what is happening is that the count of pending connections is getting out of sync with the actual queue of pending connections.  So, you are attempting more AcceptWith calls than there are actually connections to accept.  It is very possible for a connection request to arrive at a listening socket, trigger wxMac's internal signalling mechanism to issue the LISTENSOCKET_HANDLER event, and before the AcceptWith call is issued, the connection could be closed.  Then, you will try an AcceptWith with no actual pending connection in the queue.  It will block until a new, different connection actually is made, or maybe it will eventually time out.

Edited to suggest: Those of you who compile aMule for yourselves can do the following to test my theory.  In aMule-2.0.0rc7/src/ListenSocket.cpp, change line 2266 from
Code: [Select]
                       if (AcceptWith(*newclient, true)) { to
Code: [Select]
                       if (AcceptWith(*newclient, false)) {(just changing 'true' to 'false').

Rebuild aMule and test it.
« Last Edit: October 26, 2004, 01:45:12 AM by ken »
Logged

m2kio

  • Full Member
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 152
    • http://little-bat.de
Re: rc7: aMule stalls if i get a high id
« Reply #24 on: October 26, 2004, 04:52:03 PM »

Quote
Originally posted by ken
Edited to suggest: Those of you who compile aMule for yourselves can do the following to test my theory.  In aMule-2.0.0rc7/src/ListenSocket.cpp, change line 2266 from
Code: [Select]
                       if (AcceptWith(*newclient, true)) { to
Code: [Select]
                       if (AcceptWith(*newclient, false)) {(just changing 'true' to 'false').

Rebuild aMule and test it.

seems it does not hang but it crashes each time shortly after i click on 'connect'.

       ... kio !
Logged

EvoErik

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 7
Re: rc7: aMule stalls if i get a high id
« Reply #25 on: October 26, 2004, 06:34:25 PM »

Crashes randomly.

(But looks better than before - I get a high id and it starts downloading)

Regards,
Erik
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: rc7: aMule stalls if i get a high id
« Reply #26 on: October 26, 2004, 07:53:28 PM »

Cna I get a backtrace on crash?
Logged

EvoErik

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 7
Re: rc7: aMule stalls if i get a high id
« Reply #27 on: November 01, 2004, 04:58:06 PM »

Version: 2.0.0rc7 (2.0.0rc7)PID:     6652
Thread:  0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000006

Thread 0 Crashed:
0   com.apple.CoreFoundation    0x90190b34 CFRelease + 0x24
1   <<00000000>>        0x05176150 0 + 0x5176150
2   amule                       0x002a3808 0x1000 + 0x2a2808
3   amule                       0x0018fdfc 0x1000 + 0x18edfc
4   amule                       0x001903f4 0x1000 + 0x18f3f4
5   amule                       0x00186528 0x1000 + 0x185528
6   amule                       0x0000d444 0x1000 + 0xc444
7   amule                       0x0013fd44 0x1000 + 0x13ed44
8   amule                       0x00184924 0x1000 + 0x183924
9   amule                       0x001840c0 0x1000 + 0x1830c0
10  amule                       0x00184ad0 0x1000 + 0x183ad0
11  amule                       0x00184824 0x1000 + 0x183824
12  amule                       0x002379b4 0x1000 + 0x2369b4
13  amule                       0x0023dcf8 0x1000 + 0x23ccf8
14  amule                       0x0023dc6c 0x1000 + 0x23cc6c
15  amule                       0x001b0244 0x1000 + 0x1af244
16  amule                       0x001b01bc 0x1000 + 0x1af1bc
17  amule                       0x001b02d0 0x1000 + 0x1af2d0
18  amule                       0x00044f3c 0x1000 + 0x43f3c
19  amule                       0x0019ea98 0x1000 + 0x19da98
20  amule                       0x00184afc 0x1000 + 0x183afc
21  amule                       0x00208688 0x1000 + 0x207688
22  amule                       0x0020e664 0x1000 + 0x20d664
23  amule                       0x0023cdc8 0x1000 + 0x23bdc8
24  amule                       0x0023cf78 0x1000 + 0x23bf78
25  com.apple.HIToolbox         0x927d1fc8 DispatchEventToHandlers + 0x150
26  com.apple.HIToolbox         0x927d223c SendEventToEventTargetInternal + 0x174
27  com.apple.HIToolbox         0x927e46e4 SendEventToEventTarget + 0x28
28  com.apple.HIToolbox         0x927f96dc SendHICommandEvent(unsigned long, HICommand const*, unsigned long, unsigned long, unsigned char, OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 0x170
29  com.apple.HIToolbox         0x9289189c SendMenuItemSelectedEvent + 0x88
30  com.apple.HIToolbox         0x92893478 FinishMenuSelection(MenuData*, MenuResult*, MenuResult*, unsigned long, unsigned long, unsigned long) + 0x80
31  com.apple.HIToolbox         0x928d0110 PopUpMenuSelectCore(MenuData*, Point, double, Point, GDevice**, Rect const*, unsigned short, unsigned long, Rect const*, Rect const*, __CFString const*, OpaqueMenuRef**, unsigned short*) + 0x19c
32  com.apple.HIToolbox         0x9295ef94 PopUpMenuSelect + 0xbc
33  amule                       0x001a411c 0x1000 + 0x1a311c
34  amule                       0x003aa7dc 0x1000 + 0x3a97dc
35  amule                       0x000878a8 0x1000 + 0x868a8
36  amule                       0x0039729c 0x1000 + 0x39629c
37  amule                       0x0003c974 0x1000 + 0x3b974
38  amule                       0x00184924 0x1000 + 0x183924
39  amule                       0x001840c0 0x1000 + 0x1830c0
40  amule                       0x00184ad0 0x1000 + 0x183ad0
41  amule                       0x000415f4 0x1000 + 0x405f4
42  amule                       0x000807e0 0x1000 + 0x7f7e0
43  amule                       0x0008122c 0x1000 + 0x8022c
44  amule                       0x00184924 0x1000 + 0x183924
45  amule                       0x001840c0 0x1000 + 0x1830c0
46  amule                       0x00184ad0 0x1000 + 0x183ad0
47  amule                       0x00184afc 0x1000 + 0x183afc
48  amule                       0x00208688 0x1000 + 0x207688
49  amule                       0x001a9bc8 0x1000 + 0x1a8bc8
50  amule                       0x001aa820 0x1000 + 0x1a9820
51  com.apple.HIToolbox         0x927d1fc8 DispatchEventToHandlers + 0x150
52  com.apple.HIToolbox         0x927d223c SendEventToEventTargetInternal + 0x174
53  com.apple.HIToolbox         0x927e46e4 SendEventToEventTarget + 0x28
54  com.apple.HIToolbox         0x927f2d64 HandleMouseEventForWindow(OpaqueWindowPtr*, OpaqueEventRef*, unsigned short) + 0x144
55  com.apple.HIToolbox         0x9291354c HandleMouseEvent(OpaqueEventRef*) + 0x170
56  com.apple.HIToolbox         0x927e2c84 ToolboxEventDispatcherHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) + 0x1e8
57  com.apple.HIToolbox         0x927d2084 DispatchEventToHandlers + 0x20c
58  com.apple.HIToolbox         0x927d223c SendEventToEventTargetInternal + 0x174
59  com.apple.HIToolbox         0x927e46e4 SendEventToEventTarget + 0x28
60  amule                       0x0023dcd4 0x1000 + 0x23ccd4
61  amule                       0x0023dc6c 0x1000 + 0x23cc6c
62  amule                       0x0023d8b0 0x1000 + 0x23c8b0
63  amule                       0x002358bc 0x1000 + 0x2348bc
64  amule                       0x0013a3bc 0x1000 + 0x1393bc
65  amule                       0x00002540 0x1000 + 0x1540
66  amule                       0x000023b4 0x1000 + 0x13b4

Thread 1:
0   libSystem.B.dylib           0x9000b20c select + 0xc
1   com.apple.CoreFoundation    0x90196b18 __CFSocketManager + 0x1fc
2   libSystem.B.dylib           0x900246e8 _pthread_body + 0x28

PPC Thread State:
  srr0: 0x90190b34 srr1: 0x0000f930                vrsave: 0x00000000
    cr: 0x84024224  xer: 0x00000002   lr: 0x90190b1c  ctr: 0x90190b10
    r0: 0x002a3808   r1: 0xbfffd6f0   r2: 0x84024224   r3: 0x00000000
    r4: 0x05176150   r5: 0xbfffd840   r6: 0x0000000b   r7: 0x00000004
    r8: 0x05202ec7   r9: 0x00000000  r10: 0x00000001  r11: 0x0052a278
   r12: 0x90190b10  r13: 0x00000000  r14: 0x00000000  r15: 0x00000000
   r16: 0x00000000  r17: 0x00000000  r18: 0x00000000  r19: 0x00000000
   r20: 0x00000003  r21: 0x00000000  r22: 0x051879c0  r23: 0x01329980
   r24: 0x0052cec4  r25: 0x051b0630  r26: 0x01317ea0  r27: 0x00000000
   r28: 0x00000001  r29: 0x00000003  r30: 0x051761b0  r31: 0x90190b1c
Logged

Kry

  • Ex-developer
  • Retired admin
  • Hero Member
  • *****
  • Karma: -665
  • Offline Offline
  • Posts: 5795
Re: rc7: aMule stalls if i get a high id
« Reply #28 on: November 01, 2004, 05:49:54 PM »

wx version?
Logged

EvoErik

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 7
Re: rc7: aMule stalls if i get a high id
« Reply #29 on: November 01, 2004, 06:13:24 PM »

Quote
Originally posted by Kry
wx version?

I'm using the version downloaded from m2kio homepage...

Best regards,
Erik
Logged
Pages: 1 [2] 3