aMule Forum

English => aMule Help => Topic started by: julius malchovitch on June 07, 2007, 08:51:29 AM

Title: aMule works in slackware but NOT in ubuntu/suse
Post by: julius malchovitch on June 07, 2007, 08:51:29 AM
Hi everybody,  I post my problem here, just is in case anyone is able to help me.
I am working on an amule mod for a  big italian isp.

The patch is almost complete but I have the following issue:
When amule is run under slackware-current I am able to find peers on the kad network and amule is able to connect to them without problems both for uploads and downloads.

When compiling and running amule under ubuntu/suse for the very few seconds after starting up the application, in the "clients" section I can see a few kad peers, amule claims to be connected to them but after a few seconds every connection to every kad peer is dropped and I am unable to upload/download anything to/from anyone.

Running on ubuntu/suse the amule binary compiled on slackware does _not_ solve the problem, so I guess this is an environment problem rather than a problem in the amule code.
Both distros have self-compiled wxwidgets 2.8.4, both of them have glibc 2.5.0 and gcc 4.1.2

Does anyone have a clue on which packages/libs should I check for incompatibilities?

Thanks,
Julius

P.S.: I know that in this forum amule mods are not supported, I posted here because I think it's unlikely the problem is the mod's code.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: wuischke on June 07, 2007, 11:24:40 AM
Hi Julius

I don't mean to be rude, but did you use the same/a new nodes.dat file for every system? I suspect you run aMule regularly on your slackware machine and therefore have a current nodes.dat file with valid nodes.
When testing on Suse/Ubuntu you probably only had an old nodes.dat with invalid nodes which leads to your observed behaviour. Can you confirm this?

If this does not apply:
Quote
P.S.: I know that in this forum amule mods are not supported, I posted here because I think it's unlikely the problem is the mod's code.
Could you please test this? Does the same happen, when you use unmodified source code?
Do you use aMule 2.1.3 or current developmental snapshots as base?

Regards
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: julius malchovitch on June 08, 2007, 09:25:23 AM
Hi Julius

I don't mean to be rude, but did you use the same/a new nodes.dat file for every system? I suspect you run aMule regularly on your slackware machine and therefore have a current nodes.dat file with valid nodes.
When testing on Suse/Ubuntu you probably only had an old nodes.dat with invalid nodes which leads to your observed behaviour. Can you confirm this?

If this does not apply:
Quote
P.S.: I know that in this forum amule mods are not supported, I posted here because I think it's unlikely the problem is the mod's code.
Could you please test this? Does the same happen, when you use unmodified source code?
Do you use aMule 2.1.3 or current developmental snapshots as base?

Regards

Hi wuischke, thanks for the quick reply.

I tryed the nodes.dat from slackware as you suggested and I get the same behaviour described in my initial post.

Then I obtained from my ISP a public IP (our network is behind a NAT), and tryed amule cvs without any modification, and I still have the _same_ behaviour as above, so I guess it's an incompatibility coming directly from amule-cvs.

Any other suggestion is welcome.

Thanks again,

Julius
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: skolnick on June 08, 2007, 11:55:38 PM
I think the issue is more with some software installed in ubuntu/suse, not aMule itself. Could you please test the binaries built on slackware with ubuntu and suse?

Regards.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: wuischke on June 09, 2007, 10:55:25 AM
He did already.

Still I'm wondering about this and cannot thing of a distro-caused reason. There are plenty of people using Ubuntu and Suse and as far as I can remember no one complained about something like that.
Mh, the only things which come in my mind are an ipfilter.dat file blocking something or some other part of the network setup (firewall,nat,isp) being guilty.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Gnucco on June 11, 2007, 01:17:35 AM
I think I've just found the problem! I'm using ubuntu 7.04, the problem is present in the CVS snapshot (I used 20070606).
I added some more traces around the code, and found that the method  CFileDataIO::ReadTag does not properly fill the name property of the returned tag object.
The ReadString call inside this method does not convert the name to unicode. Name is tipically a 1char string, where the char is something like 0xFF / 0xFE, not a human readable "name".

I used this very dumb and broken code as a workaround, I'm sure that you can do better than this:

Code: [Select]
// name = ReadString(false);
{
uint32 len = ReadUInt16();
unsigned char val[len + 1];
val[len] = 0;

Read( (void*)val, len );
printf("Tag len: %d Buf: %s\n", len, val );
name= wxT("X");
name[0]= val[0];
}

With this change, aMule CVS snapshot works like a charm.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: skolnick on June 11, 2007, 03:21:24 AM
Interesting discovery, Gnucco. Please make a bug report on bugs.amule.org so some of the developers can track it and correct it.

Regards.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: phoenix on June 11, 2007, 04:37:58 AM
Gnucco,

Try "name = ReadString(true);" and please, report your results.

Cheers!
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: HyperNode on June 11, 2007, 12:08:09 PM
aMule does work on Suse i am running it on OS 10.2 now. If you need help compiling compiling the cvs let me know.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: mr_hyde on June 11, 2007, 02:15:45 PM
I don't know if the following info are useful... Anyway:
I tried recent CVS version on:
- Slackware (current branch)
- SLAMD64 (current branch)
- Suse 9.3 (with updates)
- Ubuntu/KUbuntu 7.04 (with updates)

For all distros:
- used the same "vanilla" kernel version
- built libupnp and wxwidgets (2.8.4) from sources
- verified that "iptables -L" reports only the ACCEPT policy for all chains
- created a new linux user from scratch to test aMule

aMule works on Slackware/SLAMD64, NOT in Suse/Ubuntu/Kubuntu.
I also tried to use the binary generated with  Slackware in Ubuntu/Suse (I had to create a link for binutils libbfd.so shared lib) but it does not work.

I suspected some relationships with user's enviroment variables (locale?)...

EDIT: I will try the fix identified by Gnucco/Phoenix ASAP

Bye,
  Mr Hyde

Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: wuischke on June 11, 2007, 03:26:24 PM
Thanks a lot for your report, Mr. Hyde.

@HyperNode: Are there any problems with Kademlia? Can you try with a new user and Kad-only?
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: mr_hyde on June 11, 2007, 07:12:09 PM
Just tried the fix proposed by Gnucco on Ubuntu: it works!

Instead
Code: [Select]
ReadString(true)
seems to have _NO_ effect.

Just a question: but why without the fix amule works on my Slackware/SLAMD64??? (Not yet "double-checked" user environment variables)

Bye,
  Mr Hyde
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: julius malchovitch on June 11, 2007, 09:29:09 PM
The patch suggested by gnucco works for me as well.

Thanks,
Julius
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Kry on June 12, 2007, 02:31:40 PM
I love how I said that the changes to string handling WOULD FUCK UP SOMETHING BADLY, phoenix.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Gnucco on June 13, 2007, 08:49:41 AM
IMHO, some more unittest should be added to verify that basic methods works correctly.
Tag parsing, string handling, etc are all good candidates for unittesting.

Maybe some checks can be even embedded in amule startup to verify that the application will work properly.

THe last time I tried, unittest compilation failed on the CVS snapshot.

My two cents
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Kry on June 13, 2007, 03:08:26 PM
You have a new job then!
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Gnucco on June 13, 2007, 09:26:01 PM
Let me guess...
Verify someone of you correctly implement proper unit testing for core subsystems?

 ;D
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Kry on June 14, 2007, 02:09:51 PM
Nope! Try again!
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Kry on June 20, 2007, 07:59:28 PM
Fixed on SVN with my usual elegance:

Code: [Select]
@@ -240,10 +240,10 @@
                        str = UTF82unicode(val);
                        if (str.IsEmpty()) {
                                // Fallback to system locale
-                               str = char2unicode(val);
+                               str = wxString(val, wxConvISO8859_1);
                        }
                } else {
-                       str = char2unicode(val);
+                       str = wxString(val, wxConvISO8859_1);
                }
        }

The network is ISO8859.
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: Gnucco on June 20, 2007, 11:42:46 PM
Both nicer and "righter" ;D than my dirty workaround !
Title: Re: aMule works in slackware but NOT in ubuntu/suse
Post by: HyperNode on June 21, 2007, 09:41:24 PM
Thanks a lot for your report, Mr. Hyde.

@HyperNode: Are there any problems with Kademlia? Can you try with a new user and Kad-only?

Sorry I rarly come on this forum. But no problem with KAD or ED2k after you port forward and allow access to it. Works fine for both but I do know what I am doing and I did setup a advance filtering sys.