aMule Forum
English => Multiplatform => Mac OSX => Topic started by: m2kio on October 20, 2004, 06:43:17 PM
-
hi,
i compiled aMule: .
it stalled for me most time, and i've got a clue:
if ip-forwarding in my router is set up to work for aMule, and aMule is about to get a high id from a server, then aMule stalls playing beachball 4ever.
if ip-forwarding is disabled, and aMule only gets a low id, then aMule does not stall.
... kio !
fix me fix me fix me fix me fix me fix me fix me fix me fix me
-
Try this. Run aMule with symbols intact (i.e. not stripped). When aMule is stalled, issue this command in Terminal:
sample amule 1
Post the resulting file on your website and put a link to it here. That way the devs can see what aMule was doing when it stalled.
-
ok.
link is
actually, it's not much, i'll paste it here:
Analysis of sampling pid 20247 every 10.000000 milliseconds
Call graph:
98 Thread_1d0b
98 start
98 _start
98 main
98 wxEntry(int&, char**)
98 wxApp::MainLoop()
98 wxApp::MacDoOneEvent()
98 wxApp::MacHandleOneEvent(void*)
98 wxAppConsole::ProcessPendingEvents()
98 wxEvtHandler::ProcessPendingEvents()
98 wxEvtHandler::ProcessEvent(wxEvent&)
98 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
98 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
98 CamuleApp::ListenSocketHandler(wxSocketEvent&)
98 CListenSocket::OnAccept(int)
98 wxSocketServer::AcceptWith(wxSocketBase&, bool)
98 GSocket::WaitConnection()
98 GSocket::Input_Timeout()
98 select
98 select
98 Thread_1e03
98 _pthread_body
98 __CFSocketManager
98 select
98 select
Total number in stack (recursive counted multiple, when >=5):
Sort by top of stack, same collapsed (when >= 5):
select 196
-
I had a similar problem. But then I noticed that the problem maybe wasn’t with the low id high id stuff. I went through testing and conclude that the a problem was with the “Autoconnect on startup” I deactivated and… amule finally working :d :d :d :baby:
Try it and see if you still get the same problem !
8)
EDIT: You can also get emule stalled when is doing the hashing thing... (saw this one with gdb). After the AICH is terminated emule runs just fine..! (try not to share any directory and the try to connect to see if it get's stalled... other way arround is to open it with gdb and find out when the AICH thread is terminated)
-
Interesting. Can you confirm that the autoconnect is the one hanging aMule?
-
Originally posted by Kry
Interesting. Can you confirm that the autoconnect is the one hanging aMule?
no, at least not for me.
o enabled ip forwarding in router
o started aMule w/o autoconnect@startup
- aMule did not hang
o waited for AICH to complete
o dbl-clicked on Razorback
--> Beachball
after 2 minutes connected (at least log printed) responded for some seconds
i got a high id from razorback
i tried to adjust window size (green btn) --> Beachball
after 1/2 minute responding again
working for 1/2 minute (maybe)
stalled again for 10 sec
now for the first time i see uploads! :-)
(now waiting for downloads)
now for the moment it seems to work, no more stalling right now, all upload slots in use.
so maybe after startup with autoconnect it does not lock for ever but just goes to a large amount of connection timeouts for lots of connects
uh, right now all uploads suddenly terminated.
still 2 clients on queue, but both stay in queue?!?
new clients go into queue and advance to upload state.
hangs for a sec or 2 ...
hangs for 5 secs ...
hangs for a sec ...
hangs for 5 secs
note: it seems, that it regularly hangs some secs when i click on stats window button.
hangs for 5 secs when i collapsed tree view in stats window.
hangs for 30 secs when i clicked on transfer window button. (uploads still there.)
cpu usage is very high... oh, thats safari. all the animated gifs on this page...
amule hangs again. cpu usage 0.0% for about a minute.
lost 4 of 7 upload connections then.
and so on.
... kio !
p.s.
note: upload windows says: clients on queue: 1
but when i show the waiting list, there are ~20.
(merde... stalling again... lost all but 1 upload connection...)
-
Dear all!
I've the same problem: Beachball while getting a high id.
Could this be related to a bug in gcc for Mac OS X? Fink reports this:
-------
The version of gcc included with XCode 1.5 is known to produce incorrect output from c++ code under certain circumstances. Fink now has a mechanism to warn users about this, and Fink will soon refuse to use the "broken" gcc to compile packages which are known to have this problem.
-------
Regards,
Erik
-
Hum. might be interesting to remove some host resolving on the build and test it... I'll try next days.
I fear a wxWidgets socket problem anyway.
-
Originally posted by EvoErik
The version of gcc included with XCode 1.5 is known to produce incorrect output from c++ code under certain circumstances. Fink now has a mechanism to warn users about this, and Fink will soon refuse to use the "broken" gcc to compile packages which are known to have this problem.
no. i have only XCode 1.1 installed. But there are enough bugs in every version of gcc. but it's more that the programs crash in such cases.
there is an option in the amule build options ummary:
Should aMule be linked against patched gsocket? no
should i try this patch, and how do i enable it?
... kio !
-
m2kio,
should i try this patch, and how do i enable it?
For wx-2.4.2: yes.
For wx-2.5.2: yes.
For wx-2.5.3: no.
Actually, IIRC, these are default options, I mean, usually aMule will link with the patched gsocket, unless you are on wx-2.5.3 or greater. There is an option to configure to disable linking with the patched gsocket, --disable-gsocket.
So, probably you are using wx-2.5.3, is that correct? If so, stick to the default.
Cheers!
-
Originally posted by phoenix
So, probably you are using wx-2.5.3, is that correct? If so, stick to the default.
yes, i got wx-2.5.3. ok, then the best i can do is wait for rc8.
aMule rc7 on Mac works ... sort of. No comparison to the Intel/Linux experience. :(
But, keep on working! :)
... kio !
you may put a link to for the Mac version (OS X 10.3) in the dl area if you like. i'll add a preface to the page.
erm, better . I'll move it there.
-
m2kio,
yes, i got wx-2.5.3. ok, then the best i can do is wait for rc8.
Sorry, but I disagree. If you just wait for rc8, you will get the same problem in rc8. We must fix that.
I did not understand what you mean by playing beachball ?(. I also experience some periodic hangs from aMule, but not particularly on connecting, it's every time, but they are usually 3-4 second hangs. Is that what you mean? Btw, I always have a high id, but i can test on a low id machine too.
Cheers!
-
Originally posted by phoenix
I did not understand what you mean by playing beachball ?(. I also experience some periodic hangs from aMule, but not particularly on connecting, it's every time, but they are usually 3-4 second hangs. Is that what you mean? Btw, I always have a high id, but i can test on a low id machine too.
beachball: the busy cursor. shown when the OS has an event to deliver but isn't polled. (that's how i imagine it works). Thus: you don't see it hanging, in first place. you only see that it's hanging if you require amule to respond to a mouse click or movement. then it takes a sec or 2 and then the mouse pointer is set to a beach ball by the OS.
summary of my current state:
- it works. sort of.
- i get a high id.
- upload and download work. wacky.
- it frequently, sometimes regularly (~1 minute) hangs for some seconds to a minute or so.
meanwhile cpu usage 0.0% and "sample amule 1" always looks similar:
- on connect to a server it hangs for up to a minute or so. (right now: razorback only 5 secs)
- if starting with auto connect to server, it hangs quite a while. (i now have disabled autoconnect)
or it hangs until it crashes (right now on my ibook)
- it frequently crashes on user action. (GUI issue?)
- console sometimes reports bogus mfrees.
e.g.: *** malloc[352]: Deallocation of a pointer not malloced: 0xd3712cb; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug
- quite a lot GUI drawing quirks.
i'm willing to support debugging. but i might need help. :]
... kio !
-
Here's another observation: Whether amule freezes upon server connect or not seems to be highly determined by the actual server you are trying to connect to.
For instance, trying to connect to most of the "big"-servers (e.g. razorback 2, donkey server no 4, byte devils, etc.) reliably freezes my amule.
In contrast, when I try to connect to lionet (212.199.125.36:8080) or "###doingdo####" (205.209.136.190:4661) amule never freezes.
So maybe it's one of the "advanced" lugdunum features (eg zlib compression?) that is causing amule to choke...
-
Can you disable UDP socket and test?
-
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?
-
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
-
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.
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 !
-
me, and yes: dual
-
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?
-
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 ;)
-
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)
-
giliii,
Watch out! You have two udp sockets at the same address:
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.
-
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 if (AcceptWith(*newclient, true)) {
to if (AcceptWith(*newclient, false)) {
(just changing 'true' to 'false').
Rebuild aMule and test it.
-
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 if (AcceptWith(*newclient, true)) {
to 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 !
-
Crashes randomly.
(But looks better than before - I get a high id and it starts downloading)
Regards,
Erik
-
Cna I get a backtrace on crash?
-
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
-
wx version?
-
Originally posted by Kry
wx version?
I'm using the version downloaded from m2kio homepage...
Best regards,
Erik
-
Out of curiousity, is this still a problem? EvoErik, you posted a backtrace from the crash you were getting. Thanks. Unfortunately, the version of aMule that you were using had its symbols stripped, so the backtrace was pretty uninformative to me. Maybe Kry was able to interpret it?
Kry (or anyone), is there a way to map raw addresses back to symbols if you have the pre-stripped executable?
Anyway, if somebody experiencing the crashes could use the debug version and report another backtrace, I (or we) might be able to see what's going wrong.
-
As I can't compile the latest cvs (14.11.) I can't help you right now. You should make precompiled Mac binaries available. But that's a different story.
Regards,
Erik