Problems with transmission 1.80+ on uClibc 0.9.27

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

Helo.
I'm cross-compiling transmission for my Sat-Reciever/MediaTank AzBox HD Premium.
It is:
Linux MMP 2.6.15-sigma #138 PREEMPT Thu Jan 22 21:35:07 KST 2009 mips unknown

GCC:
Reading specs from /usr/local/smp86xx/lib/gcc/mipsel-linux-uclibc/3.4.2/specs
Configured with: /smp86xx_toolchain.20080505/toolchain_build_mipsel_nofpu/gcc-3.4.2/configure --prefix=/usr/local/smp86xx --build=sparc-pc-linux-gnu --host=sparc-pc-linux-gnu --target=mipsel-linux-uclibc --enable-languages=c,c++ --enable-shared --disable-__cxa_atexit --enable-target-optspace --with-gnu-ld --disable-nls --enable-multilib --with-float=soft --enable-sjlj-exceptions
Thread model: posix
gcc version 3.4.2

where is uClibc 0.9.27, libz 1.2.1, curl 7.18.2 and openssl 0.9.8j in it's own SDK (smp86xx_toolchain.20080505), so i use it.

i cross-compile libevent 1.4.14b as shared library.

When i cross compile transmission 1.77 or lower - it runs Ok, but if i cross-compile 1.80+ - its compiling Ok, but then i run it - all downloaded chunks are bad.
In log appears comething like (output from 2.12):
[11:40:47.844] File.avi Piece 0, which was just downloaded, failed its checksum test (peer-mgr.c:1468)

I modified source to print CRCs and so, what computed and original CRCs are different.

Can somebody help me with this ?
Do you need some additional info ?

PS: Sorry for my poor english.
x190
Posts: 5094
Joined: Sun Nov 30, 2008 4:59 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by x190 »

Can't help you with that cross-compilation stuff (makes me go cross-eyed!), but I'm wondering if you have tested with a known uncorrupted torrent such as an Ubuntu iso?
libevent 1.4.14b
Is this applicable?
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

x190 wrote:Can't help you with that cross-compilation stuff (makes me go cross-eyed!), but I'm wondering if you have tested with a known uncorrupted torrent such as an Ubuntu iso?
Is this applicable?
I wrote, that in 1.77 or lower all works perfect.
Same torrent and same libs with 1.80 or higher doesnt work !!!
From NEWS of 1.80:
* Add an OS hint to not cache local data during torrent verification
* Portability fixes for embedded systems

I think - this is it, but i don't know what exactly changed.
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by Jordan »

This was reported in trac before, but the ticket didn't go anywhere because I didn't have a system similar to the reporter, and the reporter had difficulty in building his own version of Transmission to make tests.

If you can walk through the changes between 1.77 and 1.80, and figure out for certain which change broke verification, I'd be happy to fix the change. However until I have that information there's no much that I can do.
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

What do you mean "walk through the changes between 1.77 and 1.80" ?
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by Jordan »

I mean, make builds from svn snapshots of what came between 1.77 and 1.80 so that you can figure out which commit broke Transmission on uClibc 0.9.27. Not a fun task, probably.
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

Ok. I'll try.
Results will be reported.
iz0bbz
Posts: 3
Joined: Thu Dec 09, 2010 4:14 pm

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by iz0bbz »

Charles wrote:Not a fun task, probably.
Yep, considering that svn checkout doesn't retrieve libevent third-party directory at revision 1559, needed for old transmission versions builds.

Back to the point, I've the same box and same problem.
I've started checks from revision 9394, the equivalent in trunk of version 1.76
At a first look it seems that the 'bug' was introduced in trunk between revisions 9486 and 9500. Still testing.
iz0bbz
Posts: 3
Joined: Thu Dec 09, 2010 4:14 pm

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by iz0bbz »

Bingo.

The issue was introduced exactly in 9500.
And wierd enough, the only difference is in configure.ac :

-AC_CHECK_FUNCS([lrintf strlcpy daemon dirname basename strcasecmp localtime_r posix_fallocate memmem strtold syslog])
+AC_CHECK_FUNCS([pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r posix_fallocate memmem strtold syslog])

I reverse-applied the same patch to transmission-2.13 sources (in other words, removing "pread pwrite" to AC_CHECK_FUNCS in configure.ac) and it works! :D
But I can't really figure out why those checks broke compilation on uClibc 0.9.27, and how to fix that.

AAS, could you please double-check my results?
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

Yes !!! This is it.
pread() and pwrite() is broken in uClibc 0.9.27.
Without it transmission works perfect.

UPD: It's a known problem: http://lists.busybox.net/pipermail/ucli ... 27653.html
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by Jordan »

AAS wrote:Yes !!! This is it.
pread() and pwrite() is broken in uClibc 0.9.27.
Without it transmission works perfect.

UPD: It's a known problem: http://lists.busybox.net/pipermail/ucli ... 27653.html
That link's from 2003 though. Are you sure this is still a uClibc issue?

Also, I see 0.9.31 has been available since April. Does upgrading uClibc solve the issue?
AAS
Posts: 6
Joined: Mon Nov 22, 2010 10:07 am

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by AAS »

This bug is present in 0.9.27 version.
And 0.9.27 is very old version (released in Jan-2005).
Upgrading is not possible, because root fs hardcoded in AzBox's ROM as CRAMFS. Reflashing of ROM is not a trivial operation.
But, IMHO, adding checks for MIPS and uCLibc in configure to not use pread()/pwrite() if fully solves this issue.
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by Jordan »

https://trac.transmissionbt.com/ticket/3826

Awesome work, iz0bbz ... that must have been time-consuming.
iz0bbz
Posts: 3
Joined: Thu Dec 09, 2010 4:14 pm

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by iz0bbz »

Jordan, you told:
It would be nice to do this conditionally based on the uClibc version number, rather than unconditionally like this, but I didn't see the fix mentioned anywhere, so I don't know what version to test for. :(
I see pread/pwrite fixes mentioned in 0.9.27 -> 0.9.28 uclibc changelog:
http://lists.uclibc.org/pipermail/uclib ... 16032.html
10990: mips: fix pread/pwrite bugs reported by ltp.
I cannot test on 0.9.28 (AAS explained why) but I think it's quite safe to check for uclibc <0.9.28
Jordan
Transmission Developer
Posts: 2311
Joined: Sat May 26, 2007 3:39 pm
Location: Titania's Room

Re: Problems with transmission 1.80+ on uClibc 0.9.27

Post by Jordan »

Ah, good catch. http://lists.busybox.net/pipermail/ucli ... 19117.html looks like it's The One.
Post Reply