aMule Forum

English => en_Bugs => Topic started by: GuybrushThreepwood on March 24, 2009, 07:32:40 PM

Title: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on March 24, 2009, 07:32:40 PM
Hello to everyone and, first of all, thank you for your great work! I've cross-compiled aMule to use it on a BCM6348 (mips) based router. The cross-compilation stage was quite straightforward and I hadn't found any particular issue. I have to add that, despite of the hw limitations (as said, I use it on a router), aMule is rock solid, even for prolonged use (I execute the aMule daemon on the router and control it on every client by aMuleGUI).
I have only a problem which cause I haven't still been able to find despite of my many attempts: when I try to download a file which size is above 1Gb (I don't know if this is the exact limit but I can say that I've flawlessy downloaded a file worth 930Mb while I haven't succeeded in downloading one 1,3Gb worth), the part file could be completely allocated and it even manages to download some megabytes of it but after a while (always under the 100Mb barrier) aMule crashes.
It's important to point out that, when it starts crashing when downloading that file and even if I start amuled again, as soon as it starts downloading the "big" file, it crashes again and again after having downloaded only a few kbytes of the file while, if I stop those downloads, it works flawlessy as always.
Just to be clear: I've compiled aMule 2.2.2, aMule SVN-20081004, aMule 2.2.3 and the latest SVN (9536) but, no matter what version I use, aMule still crashes if it starts downloading those files. I'm rather confident that this isn't an aMule bug but something else...
Here are the dependencies I've used:

bison 2.4  (on the aMule wiki it's shown as a required dependency though, if I remember well, I've compiled the older versions without it with no problems at all)
libiconv 1.12
cryptopp 5.5.2                       
gettext 0.16.1
glib 2.18.0 (to succesfully compile it, I had to set these environment variables: ac_cv_func_nonposix_getpwuid_r=no; ac_cv_func_posix_getpwuid_r=yes; ac_cv_func_posix_getgrgid_r=yes; glib_cv_uscore=no; glib_cv_stack_grows=yes)
wxGTK 2.8.10
zlib 1.2.3

Obviously, apart from the fact that the 1Gb barrier doesn't define a large file, when a switch to enable large file support was available in the various configure scripts, I had used it. My toolchain might be ok cause I've cross compiled a lot of stuff ( just a couple of examples: tar, wget, mediatomb, esniper...) for my router and everything works fine (as said, even aMule is rock solid apart from this annoying issue). I hope that someone here would like to give me a suggestion. Thanks to everyone and have a good day! :)
Title: Re: aMule (various versions tested) crashes when downloading a big file
Post by: GuybrushThreepwood on March 25, 2009, 10:05:04 AM
Hello again! :) I've posted the description of the issue that I'm experiencing here in the compilation problems board because I'm rather confident that the problem resides there but, if someone among the moderators thinks that it's better to post it elsewhere, just move the thread to the appropriate place so that it could be more visible. Thanks! :)
Title: Re: aMule (various versions tested) crashes when downloading a big file
Post by: GuybrushThreepwood on March 26, 2009, 03:50:24 PM
According to the fact that no one has still replied, I'm starting to fear that I've choosen the wrong board. As I don't like to open the same thread on more boards at the same time, I would be grateful to someone among the moderators if  he/she would like to move this thread in a more appropriate place. Thank you very much! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: wuischke on March 26, 2009, 03:56:01 PM
Hi,

It seems Freddy77 (http://www.amule.org/amule/index.php?action=profile;u=15205) found the problem:
Quote from: http://www.amule.org/amule/index.php?topic=16726.0
Last fix was due to a problem in uClibc setrlimit which limited file size to 1GB so any access beyond this limit caused a SIGXFSZ. I removed UnlimitResource(RLIMIT_FSIZE) calls in amule.cpp and is working.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on March 26, 2009, 05:21:24 PM
Well, I have to say I found the patch in another site but I though that recent uClib don't have this problem... The simple solution is to remove the line

UnlimitResource(RLIMIT_FSIZE);

in function SetResourceLimits from src/amule.cpp (or just comment it).

A better solution would be to use syscall setrlimit64 if uClib and linux is detected.

I think a

#if !defined(__UCLIBC__)  || !defined(__linux__)
     UnlimitResource(RLIMIT_FSIZE);
#endif

would be a safe start.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on March 30, 2009, 10:44:46 PM
Hi and, first of all, thank you very much for your replies and excuse me for the late reply but I've been very busy in the last days. I didn't know that it was a rather common issue... The size limit was exactly the one that I had guessed! ;) I've found this patch too:

http://trac.nslu2-linux.org/optware/browser/trunk/sources/amule/amule-1gb-uclibc-mipsel.patch?rev=5903

and tried to apply it instead of commenting the call to UnlimitResources: I haven't still found some spare time to test the newly compiled SVN9540 but I would keep you updated. Thanks again! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on March 31, 2009, 04:33:18 PM
I haven't still found some spare time to test the newly compiled SVN9540 but I would keep you updated. Thanks again! :)

I have a mips router too and I can confirm it works :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 01, 2009, 11:11:54 PM
Yes, it works perfectly. Commenting these two lines:

Code: [Select]
//      rl.rlim_cur = rl.rlim_max;
//      setrlimit(resType, &rl);

in src/amule.cpp was enough and everything works as expected now! ;) Just another couple of slightly OT questions: what does it means when, though there are updated informations in the logfile, they aren't showed by aMuleGUI (it keeps giving the "Loading" message, nothing more)? I remember that everything was fine with the older SVN versions... What can make the obfuscated connection attempt fail on all the servers? I can connect to them all only without obfuscation (according to the logfile; I don't know how to verify if this is true or false). The version that I'm currently using is SVN 9546. Thanks again! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 02, 2009, 09:26:59 PM
Now that's something different. It simply kills ALL calls to UnlimitResource.
Please check if it works with unpatched 9546 (or later) as well.

Regarding SVN: we have two SVN branches available for download at the moment: "trunk" and "RELEASE-2_2_X" (which is a beta for the coming 2.2.4). Freddy77s Mips optimizations and the remote access to the log are both in trunk only, so you really should be using that.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 03, 2009, 03:42:00 PM
Now that's something different. It simply kills ALL calls to UnlimitResource.
Please check if it works with unpatched 9546 (or later) as well.

Hi and thanks for your reply. :) The last SVN that I've compiled without patching amule.cpp was the 9536 and it didn't work. Has something related to that issue changed in the meantime? I know that I've done something different from what suggested by Freddy77: I tought that, rather than commenting the call to UnlimitResource, it was better to follow the other way but I don't know if I'm right or wrong. By the way, let me know if it's important to you and I would recompile SVN 9548 from the trunk branch without patching amule.cpp then let you know the results.

Regarding SVN: we have two SVN branches available for download at the moment: "trunk" and "RELEASE-2_2_X" (which is a beta for the coming 2.2.4). Freddy77s Mips optimizations and the remote access to the log are both in trunk only, so you really should be using that.

Yes, I've already guessed something like that. In fact, yesterday I've compiled the SVN 9548 from the trunk branch and the logfile visualization in aMuleGUI started to work again. Anyway, thanks for confirming this to me! :)  What about the problems with the obfuscation?
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 05, 2009, 09:49:16 PM
The last SVN that I've compiled without patching amule.cpp was the 9536 and it didn't work. Has something related to that issue changed in the meantime?
Well, it should work in trunk and NOT in 2.2.X, so if you compiled 9536 2.2.X it can't work.

Quote
What about the problems with the obfuscation?
Try getting a good server list.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 06, 2009, 11:40:25 PM
Well, it should work in trunk and NOT in 2.2.X, so if you compiled 9536 2.2.X it can't work.

I'm quite sure that it was the trunk 9536 that didn't work...

Try getting a good server list.

Any suggestion? I used the gruk.org server list but it hasn't been updated for a long time and now I'm using the peerates one. By what I know, they should be the best ones, aren't they? Thanks again! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 09, 2009, 09:21:12 PM
See here (http://www.amule.org/amule/index.php?topic=16690.0).
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 10, 2009, 04:04:41 PM
Thanks for the suggestion: it's a very well done guide. Unfortunately, apart from the fact that I already know those notions, as said I already use the peerates server list (I update it on a daily basis) and the bluetack ipfilter too. Even the options already are as suggested, everything seems to be fine but it continues to say that it can't establish obfuscated connections to neither of the servers in the serverlist.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Kry on April 10, 2009, 06:17:43 PM
It could very well be a cpu-specific bug, as much as I tried avoiding those.

Someone's gonna have to look into that... Or write a test unit for it.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 10, 2009, 09:46:02 PM
Freddy77, is obfuscation working on your Mips router ?
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on April 11, 2009, 08:34:59 AM
Freddy77, is obfuscation working on your Mips router ?

mmm... good question? How to check it? In log I got no errors...
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 11, 2009, 12:40:34 PM
What can make the obfuscated connection attempt fail on all the servers? I can connect to them all only without obfuscation (according to the logfile; I don't know how to verify if this is true or false).
There should be a log message that connection was established without obfuscation only as I understand it.
Also try checking "accept only obfuscated connections" and see if you still can connect to a server.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 15, 2009, 10:57:25 PM
It could very well be a cpu-specific bug, as much as I tried avoiding those.

Someone's gonna have to look into that... Or write a test unit for it.

Hi and thanks for your reply! :) Yes, I've tought that this issue could be related to my specific environment too: I'd like to have some kind of advice from freddy77 who uses aMule on a mips router as I do.

@freddy77

Do you confirm that your logfile is fine? I always get this error in mine:

Code: [Select]
Connecting
Failed to connect to all obfuscated servers listed. Making another pass without obfuscation.

Without obfuscation, I can connect with ease and I always receive an high ID; the router inbound filters are well configured. I'm still using the SVN 9548: I haven't still found some spare time to cross-compile the latest 2.2.4 release. Just another question (more on topic ;) ): does amule.cpp still need to be patched in order to be compiled with older versions of uClib avoiding the 1Gb "bug"? Thanks for your reply and have a good day! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on April 16, 2009, 06:35:01 PM
Well... with amulegui I enabled "Safe connect" on "Servers" tab than "Accept only obfuscated connections" on "Security" tab, then I terminated amuled and started again (just to be sure!). It connects to server and is actually transferring (currently only upload). Log is

Code: [Select]
2009-04-16 18:24:41: amuled: OnInit - starting timer
 2009-04-16 18:24:41: Error: Cannot get the official hostname (error 2: No such file or directory)
 2009-04-16 18:24:41: Error: Cannot convert from the charset 'ASCII'!
 2009-04-16 18:24:41: Initialising aMuled SVN using  v2.8.9 (Snapshot: rev. 9549)
 2009-04-16 18:24:41: Checking if there is an instance already running...
 2009-04-16 18:24:41: No other instances are running.
!2009-04-16 18:24:41: ERROR: WARNING Warning! You are running aMule as root.
!2009-04-16 18:24:41: Doing so is not recommended for security reasons,
!2009-04-16 18:24:41: and you are advised to run aMule as an normal
!2009-04-16 18:24:41: user instead.
 2009-04-16 18:24:42: Creditfile loaded, 3555 clients are known
 2009-04-16 18:24:42: Loading IP-filters 'ipfilter.dat' and 'ipfilter_static.dat'.
 2009-04-16 18:25:42: Loaded 247768 IP-ranges from '/var/usb/amule/.aMule/ipfilter.dat'. 0 malformed lines were discarded.
 2009-04-16 18:25:42: Loaded 0 IP-ranges from '/var/usb/amule/.aMule/ipfilter_static.dat'. 0 malformed lines were discarded.
 2009-04-16 18:25:43: *** TCP socket (ECServer) listening on 192.168.1.1:4712
 2009-04-16 18:25:43: Created Server UDP-Socket at port 24665
 2009-04-16 18:25:43: ListenSocket: Ok.
 2009-04-16 18:25:43: Created Client UDP-Socket at port 24672
 2009-04-16 18:25:43: amuled: forking to background - see you
 2009-04-16 18:25:43: Loading server.met file: /var/usb/amule/.aMule/server.met
!2009-04-16 18:25:43: 7 servers in server.met found
 2009-04-16 18:25:43: Loading temp files from ./Temp.
 2009-04-16 18:25:43: Loading PartFile 1 of 3
 2009-04-16 18:25:44: Loading PartFile 2 of 3
 2009-04-16 18:25:44: Loading PartFile 3 of 3
 2009-04-16 18:25:44: All PartFiles Loaded.
 2009-04-16 18:25:44: Found 3 part files
 2009-04-16 18:25:44: Adding file ./Temp/001.part.met to shares
 2009-04-16 18:25:44: Adding file ./Temp/002.part.met to shares
 2009-04-16 18:25:44: Found 30 known shared files
!2009-04-16 18:25:44: Connecting
 2009-04-16 18:25:44: Connecting to eDonkeyServer No2 (212.63.206.35 - 212.63.206.35:4242)
!2009-04-16 18:25:44: Kad network disabled on preferences, not connecting.
!2009-04-16 18:25:45: web server running on pid 7214
 2009-04-16 18:25:45: Lost connection to eDonkeyServer No2 (212.63.206.35:4242)
!2009-04-16 18:25:45: Connection lost
 2009-04-16 18:25:45: Command `'amuleweb' '--amule-config-file=/var/usb/amule/.aMule/amule.conf'' with pid `7214' has finished with status code `0'.
 2009-04-16 18:25:47: New external connection accepted
 2009-04-16 18:25:47: Connecting client: amule-remote 0x0001
 2009-04-16 18:25:47: Access granted.
 2009-04-16 18:26:09: Connection attempt to eDonkeyServer No2 (212.63.206.35:4242) timed out.
 2009-04-16 18:26:09: Connecting to Sharing Kingdom 2 (89.248.172.50 - 89.248.172.50:4500)
 2009-04-16 18:26:09: Connected to Sharing Kingdom 2 (89.248.172.50:4500)
!2009-04-16 18:26:13: Connection established on: Sharing Kingdom 2
!2009-04-16 18:26:13: Connected to Sharing Kingdom 2 with HighID
 2009-04-16 18:26:13: New clientid is 2522628445
 2009-04-16 18:26:13: ServerMessage: server version 17.15 (lugdunum)
...

seems ok.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on April 16, 2009, 07:14:31 PM
Now is even downloading  :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 16, 2009, 08:10:33 PM
@freddy77

Thanks for your reply and for sharing your logfile. I've looked at it and I've seen that you've problems connecting to eDonkey server no.2 like me (in fact aMule has finally established a connection with Sharing Kingdom 2. My options are exactly as yours with the only exception for the autoconnect option that I keep enabled for staticservers only. I have only eDonkey server no.2 in my staticservers.dat file (it's a choice) and this explains everything: I hadn't taken this into account. The question now is: "why eDonkey server no. 2 always fails the obfuscated connection?". It's surely a server related issue but I'd like to understand why...
You haven't replied to the other question: let's say that I want to compile aMule 2.2.4; do I need to patch amule.cpp as already done with the older versions to avoid the 1Gb "bug" with my toolchain? Thanks again! :)
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: freddy77 on April 16, 2009, 08:47:45 PM
You haven't replied to the other question: let's say that I want to compile aMule 2.2.4; do I need to patch amule.cpp as already done with the older versions to avoid the 1Gb "bug" with my toolchain? Thanks again! :)

I used plain development branch. I don't know is the fix was backported to stable branch or even 2.2.4...
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: Stu Redman on April 18, 2009, 07:02:57 PM
let's say that I want to compile aMule 2.2.4
Forget it, use the trunk development version. Freddy77's low memory optimizations were not backported to 2.2.4 - it has only bugfixes.

I used plain development branch. I don't know is the fix was backported to stable branch or even 2.2.4...
The "stable branch" (2.2.x) should end with 2.2.4 (which is simply a final snapshot of this branch). Hell, it should have ended with 2.2.3. 2.2.4 is lacking features we had for ages, like the log view in the remote gui.
Title: Re: aMule (various versions tested) crashes when downloading a "large" file
Post by: GuybrushThreepwood on April 20, 2009, 09:25:14 PM
let's say that I want to compile aMule 2.2.4
Forget it, use the trunk development version. Freddy77's low memory optimizations were not backported to 2.2.4 - it has only bugfixes.

Thanks for confirming this to me! :)