aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 ... 17 18 [19] 20 21 ... 37

Author Topic: RRM's epic struggle for a better aMule on high-speed connections  (Read 165831 times)

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #270 on: December 13, 2009, 08:01:24 PM »

Can you try to compile aMule from source? I have an idea I'd like to try out.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #271 on: December 13, 2009, 08:50:13 PM »

Dear RRM, this is how I compile amule from source:

Code: [Select]
# First uninstall amule and make sure the following packages are installed:
$ sudo aptitude purge amule
$ sudo aptitude install libwxgtk2.8-dev libgeoip-dev build-essential stow
$ # Move to a temporary directory
$ mkdir ~/tmp && cd ~/tmp
$ git clone git://repo.or.cz/amule.git
$ cd amule
$ # See below for different options about configure, now assume opt-config
$ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin
$ make -j 2 && sudo make install
$ cd /usr/local/stow
$ sudo stow amule-opt

Note that in the configure line you may use different options. You are mainly interested in
  • debug options: Either you use --disable-debug or --enable-debug --with-wxdebug
  • optimazation: Either you use --enable-optimize or --disable-optimize

Stow is used to be able to have several installs of amule. Using stow and stow -D you can easily use one or another. Don't forget to change the directory in --prefix!
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #272 on: December 13, 2009, 09:03:31 PM »

Can you try to compile aMule from source? I have an idea I'd like to try out.

I like trying out new ideas.
And yes, i can try, of course, but i will be needing your help.

Dear RRM, this is how I compile amule from source:

OK, I will follow your instructions, but right now i got to go to sleep
(got to get up early tomorrow).
With the combined help of both Stu and Bill, i will definitely give it a try.
I will start tomorrow after work.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #273 on: December 13, 2009, 09:32:03 PM »

Here is the modified file I'd like you to try.
And always use --enable-optimize !
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
RRM's epic struggle for a better aMule on high-speed connections
« Reply #274 on: December 13, 2009, 09:36:05 PM »

Just a question:
Quote
And always use --enable-optimize !
Doesn't this interfere with debugging?
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #275 on: December 13, 2009, 11:36:41 PM »

Only a little. Some variables might get optimized away, execution order juggled a little, such things that mainly count if you plan to single-step through the program.
On the other hand, I suspect RRM is running his machine at the limit at his enormous upload speed, and compilation without optimize will be counter-productive here.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #276 on: December 14, 2009, 02:40:34 AM »

Only a little. Some variables might get optimized away, execution order juggled a little, such things that mainly count if you plan to single-step through the program.
On the other hand, I suspect RRM is running his machine at the limit at his enormous upload speed, and compilation without optimize will be counter-productive here.

That's the key, in this case we'd ideally like to run amule as close as possible as the stock packages, that is to say, with optimizations enabled.

In general, I've been able to debug amule always with --enable-optimize enabled, so it is better to start with it.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #277 on: December 14, 2009, 02:47:10 AM »

Here is the modified file I'd like you to try.
So the patch is:
Code: [Select]
--- amule.cpp 2009-12-11 01:53:56.941082794 +0100
+++ amule.cpp.new 2009-12-14 02:41:04.058052812 +0100
@@ -1145,6 +1145,12 @@
  }
 #endif
 
+ static bool recurse = false;
+ if (recurse) {
+ return;
+ }
+ recurse = true;
+
  uploadqueue->Process();
  downloadqueue->Process();
  //theApp->clientcredits->Process();
@@ -1232,6 +1238,7 @@
  // Recomended by lugdunummaster himself - from emule 0.30c
  serverconnect->KeepConnectionAlive();
 
+ recurse = false;
 }

Umm, good idea to try, let's see what happens with the patch.

In my humble opinion this bug has to do with some consumer/producer misbehavior in aMule's code, that is to say, more is produced and queued than it is possible to consume.

Ideally we should log all events and queues and see which is the one going crazy, but I couldn't make sense of aMule's event flow yet. Maybe we should rewrite it, but we'd land too far away from eMule's codebase, and I don't know if this is a wise decision.

Another option would be to limit all queuing structures.

This is a hard bug to track :(
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #278 on: December 14, 2009, 08:03:29 PM »

It's rather some unexpected (at least by me) behavior of wx. I'll explain if this has an effect.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #279 on: December 14, 2009, 08:19:05 PM »

Quote from: btkaos
First uninstall amule

To migrate the files that i'm downloading, known clients etc etc
into the new aMule, can i simply copy all the old .dat .met and .conf files
and the Incoming and Temp folders, and then paste them into the new aMule folder?

Quote from: btkaos
Don't forget to change the directory in --prefix!

What directory?

Quote from: Stu Redman
Here is the modified file I'd like you to try.

Sure, i will, but... how?
where does it come in in btkaos' instructions?

Here is the modified file I'd like you to try.
So the patch is:
Code: [Select]
--- amule.cpp 2009-12-11 01:53:56.941082794 +0100
+++ amule.cpp.new 2009-12-14 02:41:04.058052812 +0100
@@ -1145,6 +1145,12 @@
  }
 #endif
 
+ static bool recurse = false;
+ if (recurse) {
+ return;
+ }
+ recurse = true;
+
  uploadqueue->Process();
  downloadqueue->Process();
  //theApp->clientcredits->Process();
@@ -1232,6 +1238,7 @@
  // Recomended by lugdunummaster himself - from emule 0.30c
  serverconnect->KeepConnectionAlive();
 
+ recurse = false;
 }

Huh?
What does that mean???
Logged

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
RRM's epic struggle for a better aMule on high-speed connections
« Reply #280 on: December 14, 2009, 09:00:06 PM »

There's no reason to change any data files (.met, .conf,...), they won't be affected when you uninstall aMule. (All data files are on the hidden directory .aMule in your home folder.) The same applies for the Temp and Incoming folders.

The --prefix is inside the command below, in this case "/usr/local/stow/amule-opt/". The first time you compile manually, you won't have to change anything. Only if you want to have more than one aMule installed, you chose a different folder here, for instance --prefix=/usr/local/stow/amule-debug/.
Quote
$ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --disable-debug --mandir=/share/bin

The file aMule gave you, has to be copied in the folder 'src' inside the aMule source code directory. (If you follow btkaos' instructions, that's ~/tmp/amule, where ~ is your home folder.)

Do this before you execute "make". (Oh, "make -j2" is for a dual core processor.)

A patch is a change of two files. Do you see the lines starting with a '+'? Those lines have been added with the patch. If you meant what the contents mean: That's a part of the source code, which processes the upload and download queue. The newly added lines make sure it's not executed in a wrong way by executing itself.
Logged

btkaos

  • Global Moderator
  • Sr. Member
  • *****
  • Karma: 110
  • Offline Offline
  • Posts: 486
  • Kaos is infinite!
RRM's epic struggle for a better aMule on high-speed connections
« Reply #281 on: December 14, 2009, 09:12:18 PM »

Quote from: btkaos
First uninstall amule

To migrate the files that i'm downloading, known clients etc etc
into the new aMule, can i simply copy all the old .dat .met and .conf files
and the Incoming and Temp folders, and then paste them into the new aMule folder?
Don't worry, those directories are configuration parameters and should be preserved, we are only modifying the binaries.
Quote
Quote from: btkaos
Don't forget to change the directory in --prefix!

What directory?

When you call configure, the --prefix parameter sets the install directory. That is to say, if you use --prefix=/usr/local/stow/amule-2 amule will be installed in that directory.

Using this parameter in combination with stow (a local package manager) you can install several versions of aMule (in /usr/local/stow/amule-stu, etc...) and change which one is used with stow. This is really useful in order quickly test different builds of aMule.

Quote
Quote from: Stu Redman
Here is the modified file I'd like you to try.

Sure, i will, but... how?
where does it come in in btkaos' instructions?

Just before configure replace the src/amule.cpp with the one provided by STU.

RRM, your bug will be very hard to track, but once you know how to compile aMule, STU will be able to test possible fixes in a quick way.

Just a note, once you have compiled aMule for the first time, you don't need to perform the whole process. Imagine STU sends you some changes, then you substitute the corresponding files and just execute:
Code: [Select]
$ make
$ sudo make install

And voilĂ , you have a new aMule. Of course if you want to change the install location you need to call configure again, only that.

Another trick is to upgrade current aMule. To do that go to the tmp directory and use
Code: [Select]
$ git pull
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
RRM's epic struggle for a better aMule on high-speed connections
« Reply #282 on: December 14, 2009, 09:47:28 PM »

Plan B:
I have uploaded a aMule binary for you at http://www.megaupload.com/?d=KPDJLN25
(Just try it a few times if it says "not available".)
Unpack it with gzip -d amule.gz
fix permissions with chmod 755 amule
and run it with ./amule
It's a bit largish because it's linked static and with debug infos. It's built on Ubuntu Karmic 64 - that's your platform, right?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #283 on: December 15, 2009, 09:32:07 AM »

Plan B:

Thanks. I will give it a try as plan B, right?

Quote
It's built on Ubuntu Karmic 64 - that's your platform, right?

Sorry for the confusion i caused by posting all this in a 64 thread,
which i initially did by responding to someone who thought he had a
quick fix for the crashing issue.(1st page of this thread)
I have Ubuntu Karmic running on 32 bits.
« Last Edit: December 15, 2009, 09:34:32 AM by RRM »
Logged

RRM

  • Sr. Member
  • ****
  • Karma: 40
  • Offline Offline
  • Posts: 444
RRM's epic struggle for a better aMule on high-speed connections
« Reply #284 on: December 15, 2009, 11:24:57 AM »

Thank you very much for all your help
still, im getting dizzy of reading all kind of info that i dont understand...
so let me try to get things straight, before i mess up everything.
Should i wait for a new amule.cpp as my system is 32 bits, and not 64?
Is this what i should do:

1. I uninstall aMule by removing it in the Ubuntu Software Center

2. I type the following commands in a terminal window:
Code: [Select]
$ sudo aptitude purge amule
$ sudo aptitude install libwxgtk2.8-dev libgeoip-dev build-essential stow
$ mkdir ~/tmp && cd ~/tmp
$ git clone git://repo.or.cz/amule.git
$ cd amule

3. I download the modified file (amule.cpp) that Stu gave me.

4. I delete the amule.cpp in ~/tmp/amule/src/
and replace it with the downloaded amule.cpp
But: I cannot find the temp folder in my home folder...?
Or will it only be there once ive done this:
Code: [Select]
$ mkdir ~/tmp && cd ~/tmp?

5.
Code: [Select]
$ ./configure --prefix=/usr/local/stow/amule-opt/ --enable-geoip --enable-optimize --enable-debug --with-wxdebug --mandir=/share/bin
(because i have to enable both optimize and debug, because they dont interfere, right?)

6.
Code: [Select]
$ make -j 2 && sudo make install
$ cd /usr/local/stow
$ sudo stow amule-opt
« Last Edit: December 15, 2009, 12:04:43 PM by RRM »
Logged
Pages: 1 ... 17 18 [19] 20 21 ... 37