Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2480 closed Bug (invalid)

SIGSEGV on Popcorn Hour C200 build

Reported by: Ger Teunis Owned by: charles
Priority: Normal Milestone: None Set
Component: libtransmission Version: 1.75
Severity: Normal Keywords:
Cc:

Description

I am at a quest to also offer Transmission builds on the NMT Popcorn Hour C-200 which I also do for the A/B series popcorn.

I've got all libraries and transmission compiled and it runs... for a while. Just after if is processing peer information (setting encryption mode int to peer info) is crashes with an SIGSEGV.

For better debugger I've created a release with more debugging and also created a GDB for C200.

The following happens in GDB.

sh-3.00# export CLUTCH_HOME=/share/Apps/Transmission/webui/
sh-3.00# LD_LIBRARY_PATH=/share/Apps/Transmission/bin ./gdb -args /share/Apps/Tr
ansmission/bin/transmission-daemon -g /share/Apps/Transmission/.transmission -T
-w /share/Download -f
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mips-linux-gnu"...
(gdb) r
Starting program: /opt/sybhttpd/localhost.drives/SATA_DISK/Apps/Transmission/bin
/transmission-daemon -g /share/Apps/Transmission/.transmission -T -w /share/Down
load -f
[18:09:34.992] RPC Server: Adding address to whitelist: 127.0.0.1
[18:09:34.997] RPC Server: Serving RPC and Web requests on port 9091
[18:09:34.998] Transmission 1.75 (9114) started
[18:09:35.019] DHT: Generating new id
[18:09:35.100] ubuntu-9.10-beta-desktop-i386.iso: Couldn't read resume file
[18:09:35.101] ubuntu-9.10-beta-desktop-i386.iso: Queued for verification
[18:09:35.102] Loaded 1 torrents
[18:09:35.102] ubuntu-9.10-beta-desktop-i386.iso: Verifying torrent
[18:09:35.315] Using libcurl 7.19.6
[New LWP 2248]
[18:09:35.436] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[18:09:35.436] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)

[18:09:44.445] Port Forwarding (UPnP): Found Internet Gateway Device "http://192
.168.2.139:6357/"
[18:09:44.445] Port Forwarding (UPnP): Local Address is "192.168.2.139"
[18:09:44.448] Port Forwarding (UPnP): Port forwarding through "http://192.168.2
.139:6357/", service "".  (local address: 192.168.2.139:51413)
[18:09:44.448] Port Forwarding: State changed from "Not forwarded" to "Starting"

[18:09:44.449] Port Forwarding: State changed from "Starting" to "???"
[18:09:44.521] ubuntu-9.10-beta-desktop-i386.iso: Got 23 peers from tracker

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 2248]
tr_peerIoSetEncryption (io=0x370000, encryptionMode=2) at peer-io.c:686
686     peer-io.c: No such file or directory.
        in peer-io.c
(gdb) bt
#0  tr_peerIoSetEncryption (io=0x370000, encryptionMode=2) at peer-io.c:686
#1  0x0044b500 in readYb (handshake=0x4cd328, inbuf=<value optimized out>)
    at handshake.c:475
#2  0x0044b994 in canRead (io=<value optimized out>, arg=0x4cd328,
    piece=<value optimized out>) at handshake.c:1064
#3  0x00432c2c in canReadWrapper (io=0x4ccc58) at peer-io.c:135
#4  0x0045f92c in event_process_active (base=0x49d7c0) at event.c:392
#5  0x0045fec0 in event_base_loop (base=0x49d7c0, flags=0) at event.c:544
#6  0x0045fc4c in event_loop (flags=0) at event.c:468
#7  0x0045f9ac in event_dispatch () at event.c:406
#8  0x0041fde0 in libeventThreadFunc (veh=0x49c7d8) at trevent.c:239
#9  0x2ad66d34 in ?? () from /lib/libpthread.so.0
warning: GDB can't find the start of the function at 0x2ad66d33.

    GDB is unable to find the start of the function at 0x2ad66d33
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x2ad66d33 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

It seems the code breaks here:

void
tr_peerIoSetEncryption( tr_peerIo * io,
                        int         encryptionMode )
{
    assert( tr_isPeerIo( io ) );
    assert( encryptionMode == PEER_ENCRYPTION_NONE
         || encryptionMode == PEER_ENCRYPTION_RC4 );

    io->encryptionMode = encryptionMode;
}

It's build for MIPS 24k using Code Sourcery toolchain for mips (free edition) configured being little endian (-EL) during GCC and LD.

Change History (25)

comment:1 Changed 12 years ago by charles

That 0x370000 address seems suspicious to me... it's so round and even

comment:2 Changed 12 years ago by Ger Teunis

I think I also saw another memory address. I'll look into it this evening. Do you have any clue what might cause this? All seems to run at first until the "Get X peers" message appears. My conclusion is that it compiled and linked okay?

Any pointers would be greatly appreciated!

comment:3 Changed 12 years ago by charles

To me the crashes in #2483 and #2460 look kind of similar to this (even though #2460 reports to be a totally different issue), they all seem to be crashing when the tr_peer or maybe the tr_peerIo is being referenced after being destroyed.

For tracking this down, the first thing I'd suggest is to turn on assertions by rebuilding after tearing out -DNDEBUG from configure.ac and the Makefiles.

comment:4 Changed 12 years ago by charles

@Ger: did that help any?

comment:5 Changed 12 years ago by Ger Teunis

Charles, first of all: your help is much appreciated! Great work on transmission and support.

Okay; now the tests I've removed all DNDEBUG from all Makefiles and configure.ac, also made sure no O flags where there as well. I noticed there isn't any DEBUG flags anymore.

My steps where: change configure.ac did the complete configure Changed all Makefiles make

This is the result (please look at the third which is interesting)

First run:

sh-3.00# export CLUTCH_HOME=/share/Apps/Transmission/webui/
sh-3.00# LD_LIBRARY_PATH=/share/Apps/Transmission/bin ./gdb -args /share/Apps/Tr
ansmission/bin/transmission-daemon -g /share/Apps/Transmission/.transmission -T
-w /share/Download -f
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mips-linux-gnu"...
(gdb) r
Starting program: /opt/sybhttpd/localhost.drives/SATA_DISK/Apps/Transmission/bin
/transmission-daemon -g /share/Apps/Transmission/.transmission -T -w /share/Down
load -f
[11:06:08.542] RPC Server: Adding address to whitelist: 127.0.0.1
[11:06:08.561] RPC Server: Serving RPC and Web requests on port 9091
[11:06:08.563] Transmission 1.75 (9114) started
[11:06:08.589] DHT: Generating new id
[11:06:08.658] ubuntu-9.10-beta-desktop-i386.iso: Couldn't read resume file
[11:06:08.659] ubuntu-9.10-beta-desktop-i386.iso: Queued for verification
[11:06:08.660] Loaded 1 torrents
[11:06:08.660] ubuntu-9.10-beta-desktop-i386.iso: Verifying torrent
[11:06:08.880] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[11:06:08.880] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)

[11:06:16.881] Port Forwarding (UPnP): Found Internet Gateway Device "http://192
.168.2.139:6357/"
[11:06:16.881] Port Forwarding (UPnP): Local Address is "192.168.2.139"
[11:06:16.884] Port Forwarding (UPnP): Port forwarding through "http://192.168.2
.139:6357/", service "".  (local address: 192.168.2.139:51413)
[11:06:16.885] Port Forwarding: State changed from "Not forwarded" to "Starting"

[11:06:16.892] Using libcurl 7.19.6
[New LWP 23668]
[11:06:16.995] Port Forwarding: State changed from "Starting" to "???"
[11:06:17.129] ubuntu-9.10-beta-desktop-i386.iso: Got 14 peers from tracker

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 23668]
0x00443a94 in tr_isPeerIo (io=0xa10000) at peer-io.c:180
180     peer-io.c: No such file or directory.
        in peer-io.c
(gdb) bt
#0  0x00443a94 in tr_isPeerIo (io=0xa10000) at peer-io.c:180
#1  0x00445e04 in tr_peerIoSetEncryption (io=0xa10000, encryptionMode=2)
    at peer-io.c:681
#2  0x00469620 in readYb (handshake=0x4fb118, inbuf=0x4fb0d8)
    at handshake.c:475
#3  0x0046bee8 in canRead (io=0x4faa08, arg=0x4fb118, piece=0x2b0eedd4)
    at handshake.c:1064
#4  0x004437e8 in canReadWrapper (io=0x4faa08) at peer-io.c:135
#5  0x00443e14 in event_read_cb (fd=27, event=2, vio=0x4faa08)
    at peer-io.c:226
#6  0x00485d1c in event_process_active (base=0x4c97c0) at event.c:392
#7  0x004862b0 in event_base_loop (base=0x4c97c0, flags=0) at event.c:544
#8  0x0048603c in event_loop (flags=0) at event.c:468
#9  0x00485d9c in event_dispatch () at event.c:406
#10 0x0042de00 in libeventThreadFunc (veh=0x4c87d8) at trevent.c:239
#11 0x0040f748 in ThreadFunc (_t=0x4c8868) at platform.c:108
#12 0x2ad66d34 in ?? () from /lib/libpthread.so.0
warning: GDB can't find the start of the function at 0x2ad66d33.

    GDB is unable to find the start of the function at 0x2ad66d33
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x2ad66d33 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

It really looks like the address is very round again, what might that be?

Second run:

0x00443a94 in tr_isPeerIo (io=0xf40000) at peer-io.c:180
180     in peer-io.c

Third run:

[11:11:16.987] Port Forwarding: State changed from "Starting" to "???"
transmission-daemon: peer-io.c:500: tr_peerIoGetAddress: Assertion `tr_isPeerIo(
 io )' failed.

Program received signal SIGABRT, Aborted.
[Switching to LWP 23878]
0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6

Fourth run:

[11:13:09.504] ubuntu-9.10-beta-desktop-i386.iso: Got 15 peers from tracker
transmission-daemon: peer-io.c:200: event_read_cb: Assertion `tr_isPeerIo( io )'
 failed.

Program received signal SIGABRT, Aborted.
[Switching to LWP 23939]
0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6

I hope this is helpful! Please let me know if I can do any more debugging or testing. Can't wait to run transmission on C200 again.

comment:6 Changed 12 years ago by Ger Teunis

ps> if you want to take it offline for faster round trips: I am reachable on g.teunisREMOVEME@… (remove capital letters) this is for MSN as well. ger_teunis at skype.

comment:7 Changed 12 years ago by charles

It's helpful, but I'm not sure what the cause is. Could you please try to repeat this with r9273 or higher?

comment:8 Changed 12 years ago by Ger Teunis

Using a trunk checkout (revision 9273)

sh-3.00# LD_LIBRARY_PATH=/share/Apps/Transmission/bin ./gdb -args /share/Apps/Tr
ansmission/bin/transmission-daemon -g /share/Apps/Transmission/.transmission -T
-w /share/Download -f
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mips-linux-gnu"...
(gdb) r
Starting program: /opt/sybhttpd/localhost.drives/SATA_DISK/Apps/Transmission/bin
/transmission-daemon -g /share/Apps/Transmission/.transmission -T -w /share/Down
load -f
[19:55:48.350] RPC Server: Adding address to whitelist: 127.0.0.1
[19:55:48.354] RPC Server: Serving RPC and Web requests on port 9091
[19:55:48.355] Transmission 1.75+ (9273) started
[19:55:48.378] DHT: Generating new id
[19:55:48.460] ubuntu-9.10-beta-desktop-i386.iso: Couldn't read resume file
[19:55:48.468] Loaded 1 torrents
[19:55:48.684] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[19:55:48.685] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)

[19:55:56.692] Port Forwarding (UPnP): Found Internet Gateway Device "http://192
.168.2.139:6357/"
[19:55:56.693] Port Forwarding (UPnP): Local Address is "192.168.2.139"
[19:55:56.696] Port Forwarding (UPnP): Port forwarding through "http://192.168.2
.139:6357/", service "".  (local address: 192.168.2.139:51413)
[19:55:56.696] Port Forwarding: State changed from "Not forwarded" to "Starting"

[19:55:56.954] Port Forwarding: State changed from "Starting" to "???"
[19:55:56.963] Using libcurl 7.19.6
[New LWP 16443]
[19:55:57.213] ubuntu-9.10-beta-desktop-i386.iso: Got 17 peers from tracker

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 16443]
0x00446504 in tr_isPeerIo (io=0x660000) at peer-io.c:187
187     peer-io.c: No such file or directory.
        in peer-io.c
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from terminal]
Starting program: /opt/sybhttpd/localhost.drives/SATA_DISK/Apps/Transmission/bin
/transmission-daemon -g /share/Apps/Transmission/.transmission -T -w /share/Down
load -f
[19:56:09.409] RPC Server: Adding address to whitelist: 127.0.0.1
[19:56:09.411] RPC Server: Serving RPC and Web requests on port 9091
[19:56:09.413] Transmission 1.75+ (9273) started
[19:56:09.436] DHT: Generating new id
[19:56:09.521] ubuntu-9.10-beta-desktop-i386.iso: Couldn't read resume file
[19:56:09.529] Loaded 1 torrents
[19:56:09.744] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[19:56:09.744] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)

[19:56:18.765] Port Forwarding (UPnP): Found Internet Gateway Device "http://192
.168.2.139:6357/"
[19:56:18.765] Port Forwarding (UPnP): Local Address is "192.168.2.139"
[19:56:18.768] Port Forwarding (UPnP): Port forwarding through "http://192.168.2
.139:6357/", service "".  (local address: 192.168.2.139:51413)
[19:56:18.768] Port Forwarding: State changed from "Not forwarded" to "Starting"

[19:56:19.053] Port Forwarding: State changed from "Starting" to "???"
[19:56:19.064] Using libcurl 7.19.6
[New LWP 16446]
[19:56:19.284] ubuntu-9.10-beta-desktop-i386.iso: Got 18 peers from tracker

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 16446]
0x00446504 in tr_isPeerIo (io=0x9b0000) at peer-io.c:187
187     in peer-io.c
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) [answered Y; input not from terminal]
Starting program: /opt/sybhttpd/localhost.drives/SATA_DISK/Apps/Transmission/bin
/transmission-daemon -g /share/Apps/Transmission/.transmission -T -w /share/Down
load -f
[19:56:27.796] RPC Server: Adding address to whitelist: 127.0.0.1
[19:56:27.798] RPC Server: Serving RPC and Web requests on port 9091
[19:56:27.800] Transmission 1.75+ (9273) started
[19:56:27.823] DHT: Generating new id
[19:56:27.911] ubuntu-9.10-beta-desktop-i386.iso: Couldn't read resume file
[19:56:27.919] Loaded 1 torrents
[19:56:28.135] Port Forwarding (NAT-PMP): initnatpmp succeeded (0)
[19:56:28.135] Port Forwarding (NAT-PMP): sendpublicaddressrequest succeeded (2)

[19:56:37.149] Port Forwarding (UPnP): Found Internet Gateway Device "http://192
.168.2.139:6357/"
[19:56:37.149] Port Forwarding (UPnP): Local Address is "192.168.2.139"
[19:56:37.153] Port Forwarding (UPnP): Port forwarding through "http://192.168.2
.139:6357/", service "".  (local address: 192.168.2.139:51413)
[19:56:37.154] Port Forwarding: State changed from "Not forwarded" to "Starting"

[19:56:37.444] Port Forwarding: State changed from "Starting" to "???"
[19:56:37.454] Using libcurl 7.19.6
[New LWP 16474]
[19:56:37.672] ubuntu-9.10-beta-desktop-i386.iso: Got 18 peers from tracker
transmission-daemon: crypto.c:295: tr_cryptoGetTorrentHash: Assertion `crypto->t
orrentHashIsSet' failed.

Program received signal SIGABRT, Aborted.
[Switching to LWP 16474]
0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6
(gdb) bt
#0  0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6
#1  0x2adbf824 in abort () from /share/Apps/Transmission/bin/libc.so.6
#2  0x2adb2990 in __assert_fail () from /share/Apps/Transmission/bin/libc.so.6
#3  0x0043e5c0 in tr_cryptoGetTorrentHash (crypto=0x4f9458) at crypto.c:295
#4  0x0046b59c in buildHandshakeMessage (handshake=0x501020,
    buf=0x2b0eed04 "") at handshake.c:218
#5  0x0046c56c in readYb (handshake=0x501020, inbuf=0x4f9738)
    at handshake.c:486
#6  0x0046ef68 in canRead (io=0x4f9068, arg=0x501020, piece=0x2b0eedd4)
    at handshake.c:1066
#7  0x00446168 in canReadWrapper (io=0x4f9068) at peer-io.c:139
#8  0x00446884 in event_read_cb (fd=31, event=2, vio=0x4f9068)
    at peer-io.c:233
#9  0x004890cc in event_process_active (base=0x4c57c0) at event.c:385
#10 0x004895d8 in event_base_loop (base=0x4c57c0, flags=0) at event.c:525
#11 0x004893dc in event_loop (flags=0) at event.c:461
#12 0x0048913c in event_dispatch () at event.c:399
#13 0x00429c50 in libeventThreadFunc (veh=0x4c47d8) at trevent.c:239
#14 0x0040f768 in ThreadFunc (_t=0x4c4868) at platform.c:108
#15 0x2ad66d34 in ?? () from /lib/libpthread.so.0
warning: GDB can't find the start of the function at 0x2ad66d33.

    GDB is unable to find the start of the function at 0x2ad66d33
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x2ad66d33 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

comment:9 Changed 12 years ago by charles

I don't know what to think of this.. :/

Could you hit "bt" for those tr_isPeerIo() assertion failures?

comment:10 Changed 12 years ago by Ger Teunis

Of course, weird bug right? Correct me if I'm wrong; it's not a compilation or linker error right? I suspect if it is an compilation or linking (library) error it would have crashed a lot earlier?

Can I add addition debugging info so we can get more insight in what is going on?

Here is the bt from tr_isPeerIo()

[21:57:33.278] ubuntu-9.10-beta-desktop-i386.iso: Got 16 peers from tracker
transmission-daemon: peer-io.c:688: tr_peerIoSetEncryption: Assertion `tr_isPeer
Io( io )' failed.

Program received signal SIGABRT, Aborted.
[Switching to LWP 21242]
0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6
(gdb) bt
#0  0x2adba8f4 in raise () from /share/Apps/Transmission/bin/libc.so.6
#1  0x2adbf824 in abort () from /share/Apps/Transmission/bin/libc.so.6
#2  0x2adb2990 in __assert_fail () from /share/Apps/Transmission/bin/libc.so.6
#3  0x004488a8 in tr_peerIoSetEncryption (io=0x480000, encryptionMode=2)
    at peer-io.c:688
#4  0x0046c4f0 in readYb (handshake=0x4f0f60, inbuf=0x4c69f0)
    at handshake.c:475
#5  0x0046ef68 in canRead (io=0x4f0890, arg=0x4f0f60, piece=0x2b0eedd4)
    at handshake.c:1066
#6  0x00446168 in canReadWrapper (io=0x4f0890) at peer-io.c:139
#7  0x00446884 in event_read_cb (fd=20, event=2, vio=0x4f0890)
    at peer-io.c:233
#8  0x004890cc in event_process_active (base=0x4c57c0) at event.c:385
#9  0x004895d8 in event_base_loop (base=0x4c57c0, flags=0) at event.c:525
#10 0x004893dc in event_loop (flags=0) at event.c:461
#11 0x0048913c in event_dispatch () at event.c:399
#12 0x00429c50 in libeventThreadFunc (veh=0x4c47d8) at trevent.c:239
#13 0x0040f768 in ThreadFunc (_t=0x4c4868) at platform.c:108
#14 0x2ad66d34 in ?? () from /lib/libpthread.so.0
warning: GDB can't find the start of the function at 0x2ad66d33.

    GDB is unable to find the start of the function at 0x2ad66d33
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x2ad66d33 for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

comment:11 Changed 12 years ago by Ger Teunis

If I do not add an torrent the daemon and webinterface is working okay. As soon as the peers are received it is crashing. When I remove the torrent (ubuntu in this case) and start all is working just fine. When I add an torrent again and the peer info is parsed it is resulting again in the above error.

comment:12 Changed 12 years ago by charles

I really don't know what's going on here. I can't figure out if it's some kind of compiler alignment error, or a bug in Transmission. It's very odd that you're able to crash it so quickly... I don't see that happening when I try it.

Please try out this patch:

Index: handshake.c
===================================================================
--- handshake.c	(revision 9273)
+++ handshake.c	(working copy)
@@ -411,6 +411,9 @@
     struct evbuffer * outbuf;
     size_t            needlen = HANDSHAKE_NAME_LEN;
 
+    assert( handshake != NULL );
+    assert( tr_isPeerIo( handshake->io ) );
+
     if( EVBUFFER_LENGTH( inbuf ) < needlen )
         return READ_LATER;
 
@@ -1036,6 +1039,9 @@
 
     while( readyForMore )
     {
+        assert( handshake != NULL );
+        assert( tr_isPeerIo( handshake->io ) );
+
         switch( handshake->state )
         {
             case AWAITING_HANDSHAKE:

maybe it will give us some more information. At this point I'm assuming that we're prematurely destroying the peer-io, and am trying to figure out how that's happening.

comment:13 Changed 12 years ago by charles

Are you passing any strange options into the compiler? I'm not convinced this isn't a build error...

comment:14 Changed 12 years ago by Ger Teunis

The new assert doesn't trigger. I've also added one assert in handshake.c:476 which doesn't trigger, a few lines below the tr_peerIoSetEncryption is failing.

#0  0x00446504 in tr_isPeerIo (io=0xa0000) at peer-io.c:187
#1  0x00448874 in tr_peerIoSetEncryption (io=0xa0000, encryptionMode=2)
    at peer-io.c:688
#2  0x0046c5ec in readYb (handshake=0x4f8bf0, inbuf=0x4c6ac8)
    at handshake.c:481

Could this be a configuration error? I.e. datatypes being of a different size or so?

My configure:

OPENSSL_CFLAGS="-I/home/ger/src/openssl-0.9.8i/include" LIBCURL_CFLAGS="-I/home/ger/src/curl-7.19.6/include" OPENSSL_LIBS="-L/root/CodeSourcery/Sourcery_G++_Lite/mips-linux-gnu/lib" LIBCURL_LIBS="-L/root/CodeSourcery/Sourcery_G++_Lite/mips-linux-gnu/lib -lcurl" ./configure --host=mips-linux-gnu --prefix=/root/CodeSourcery/Sourcery_G++_Lite/mips-linux-gnu/ CFLAGS="-g -EL" CXXFLAGS="-g -EL" LDFLAGS=-EL CPPFLAGS="-g -EL" ASFLAGS=-EL CC="mips-linux-gnu-gcc" CXX="mips-linux-gnu-g++"

You're right: the io of handshake is always a rounded number, which is kinda weird.

comment:15 Changed 12 years ago by charles

I don't understand why tr_isPeerIo() returns true at the beginning of readYb(), but not later on in the tr_peerIoSetEncryption() call. Unless you've got a better idea, the dumb-but-fast next step would be to paste that "assert( tr_isPeerIo( handshake->io ) ) );" call all throughout readYb() to figure out where it starts failing.

comment:16 Changed 12 years ago by Ger Teunis

Hmm, it seems that the call the tr_cryptoEncryptInit( handshake->crypto ); breaks it all. I've put a few assert above and below. The one just below the EncryptInit? fails (handshake.c:474)

comment:17 Changed 12 years ago by Ger Teunis

To make sure ssl libs are okay I've put the openssl command as well next to the transmission binary; it works okay.

sh-3.00# LD_LIBRARY_PATH=/share/Apps/Transmission/bin ./openssl
WARNING: can't open config file: /root/CodeSourcery/Sourcery_G++_Lite/mips-linux
-gnu/ssl/openssl.cnf
OpenSSL> sha1 /share/Apps/Transmission/bin/transmission-daemon
SHA1(/share/Apps/Transmission/bin/transmission-daemon)= 544eb4b13f28898b0099dccc
564bdb7cf27e6ccd

comment:18 Changed 12 years ago by charles

Ger,

Hm. This is almost certainly an issue with either the build or the ssl library, rather than a Transmission bug. tr_cryptoEncryptInit()'s calls are nearly all calls to the ssl library -- SHA1 calls, RC4_set_key(), and RC4().

comment:19 Changed 12 years ago by charles

half-random thought: are you compiling with headers from one version of ssl and linking against a different version?

comment:20 Changed 12 years ago by Ger Teunis

I am suspecting such a thing as well. But I cannot imagine what is going on. The compiled libs and openssl executable is working fine on the NMT :( Thanks for your time so far; I'll keel trying to build it for C200 though. I suspect I am missing just a simple compiler flag somewhere.

comment:21 Changed 12 years ago by charles

Ger, any news on this?

comment:22 Changed 12 years ago by charles

Ger, any news on this?

comment:23 Changed 12 years ago by Ger Teunis

Hi Charles, currently testing another build from another user. At first glance it does like à build error on my machine. I'll keep you posted.

comment:24 Changed 12 years ago by charles

  • Resolution set to invalid
  • Status changed from new to closed

Doing a little housekeeping and marking this ticket as "invalid". If this turns out to be something that needs upstream attention, please feel free to reopen this ticket with more information.

Thanks for doing the builds, Ger...

comment:25 Changed 12 years ago by Ger Teunis

Charles, It's fixed and was an error on my side :) Builds are not available for popcorn hour c200 to. http://www.networkedmediatank.com/showthread.php?tid=30245

Thanks for your time and support.

Best regards, Ger

Note: See TracTickets for help on using tickets.