#0 compareOffsetToFile (a=0x7f9d831be5c8, b=0x7fa99446a860) at inout.c:160 155: compareOffsetToFile (const void * a, const void * b) 156: { 157: const uint64_t offset = * (const uint64_t*)a; 158: const tr_file * file = b; 159: 160: if (offset < file->offset) 161: return -1; 162: 163: if (offset >= file->offset + file->length) 164: return 1; 165: #1 0x00007f9d96bed8f8 in __GI_bsearch (key=key@entry=0x7f9d831be5c8, base=0x7f9d9958b660 , nmemb=, size=size@entry=40, compar=compar@entry=0x7f9d9a04b3d0 ) at bsearch.c:37 [Error: bsearch.c was not found in source tree] #2 0x00007f9d9a04b445 in tr_ioFindFileLocation (tor=tor@entry=0x7f9d9b216400, pieceIndex=pieceIndex@entry=2637, pieceOffset=pieceOffset@entry=0, fileIndex=fileIndex@entry=0x7f9d831be644, fileOffset=fileOffset@entry=0x7f9d831be648) at inout.c:182 177: const tr_file * file; 178: 179: assert (tr_isTorrent (tor)); 180: assert (offset < tor->info.totalSize); 181: 182: file = bsearch (&offset, 183: tor->info.files, tor->info.fileCount, sizeof (tr_file), 184: compareOffsetToFile); 185: 186: assert (file != NULL); 187: #3 0x00007f9d9a04b4c3 in readOrWritePiece (tor=0x7f9d9b216400, ioMode=ioMode@entry=2, pieceIndex=pieceIndex@entry=2637, pieceOffset=pieceOffset@entry=0, buf=0x7f9d7044c790 "'4`L\276 \256\326\341\346\061\304A\367\367&aXq\207u\006\260\332E\327&a4[*\374\322\204\f\026Ll\371Czt\250\262\016\230\275\300Ju\f\307\354H\246\317)P\330\200\030.\353\316\232\201!\302\270\253\v66\367U}\241\310M\377\315\247\345+\306\230\006\260S\210\271\262\376t\214\354\306"..., buflen=buflen@entry=262144) at inout.c:213 208: const tr_info * info = &tor->info; 209: 210: if (pieceIndex >= tor->info.pieceCount) 211: return EINVAL; 212: 213: tr_ioFindFileLocation (tor, pieceIndex, pieceOffset, 214: &fileIndex, &fileOffset); 215: 216: while (buflen && !err) 217: { 218: const tr_file * file = &info->files[fileIndex]; #4 0x00007f9d9a04ba71 in tr_ioWrite (tor=tor@entry=0x7f9d9b216400, pieceIndex=pieceIndex@entry=2637, begin=begin@entry=0, len=len@entry=262144, buf=buf@entry=0x7f9d7044c790 "'4`L\276 \256\326\341\346\061\304A\367\367&aXq\207u\006\260\332E\327&a4[*\374\322\204\f\026Ll\371Czt\250\262\016\230\275\300Ju\f\307\354H\246\317)P\330\200\030.\353\316\232\201!\302\270\253\v66\367U}\241\310M\377\315\247\345+\306\230\006\260S\210\271\262\376t\214\354\306"...) at inout.c:265 260: uint32_t begin, 261: uint32_t len, 262: const uint8_t * buf) 263: { 264: return readOrWritePiece (tor, TR_IO_WRITE, pieceIndex, begin, (uint8_t*)buf, len); 265: } 266: 267: /**** 268: ***** 269: ****/ 270: #5 0x00007f9d9a049481 in flushContiguous (cache=cache@entry=0x7f9d9ad3daf0, pos=0, n=) at cache.c:192 187: evbuffer_free (b->evbuf); 188: tr_free (b); 189: } 190: tr_ptrArrayErase (&cache->blocks, pos, pos+n); 191: 192: err = tr_ioWrite (tor, piece, offset, walk-buf, buf); 193: tr_free (buf); 194: 195: ++cache->disk_writes; 196: cache->disk_write_bytes += walk-buf; 197: return err; #6 0x00007f9d9a049505 in flushRuns (cache=cache@entry=0x7f9d9ad3daf0, runs=runs@entry=0x7f9d7044bb70, n=3) at cache.c:210 205: 206: for (i=0; !err && i runs[i].pos) 214: runs[j].pos -= runs[i].len; 215: } #7 0x00007f9d9a0496b2 in cacheTrim (cache=0x7f9d9ad3daf0) at cache.c:236 231: int i=0, j=0; 232: 233: calcRuns (cache, runs); 234: while (j < cacheCutoff) 235: j += runs[i++].len; 236: err = flushRuns (cache, runs, i); 237: tr_free (runs); 238: } 239: 240: return err; 241: } #8 0x00007f9d9a04991b in tr_cacheWriteBlock (cache=, torrent=torrent@entry=0x7f9d9b2ab600, piece=, offset=, length=32669, writeme=writeme@entry=0x7f9d7015b3b0) at cache.c:356 351: evbuffer_remove_buffer (writeme, cb->evbuf, cb->length); 352: 353: cache->cache_writes++; 354: cache->cache_write_bytes += cb->length; 355: 356: return cacheTrim (cache); 357: } 358: 359: int 360: tr_cacheReadBlock (tr_cache * cache, 361: tr_torrent * torrent, #9 0x00007f9d9a055d34 in clientGotBlock (req=0x7f9d70013018, data=0x7f9d7015b3b0, msgs=0x7f9d700116a0) at peer-msgs.c:1588 1583: 1584: /** 1585: *** Save the block 1586: **/ 1587: 1588: if ((err = tr_cacheWriteBlock (getSession (msgs)->cache, tor, req->index, req->offset, req->length, data))) 1589: return err; 1590: 1591: tr_bitfieldAdd (&msgs->peer->blame, req->index); 1592: fireGotBlock (msgs, req); 1593: return 0; #10 readBtPiece (setme_piece_bytes_read=, inlen=1382, inbuf=0x7f9d701d6450, msgs=0x7f9d700116a0) at peer-msgs.c:1336 1331: (int)(req->length - evbuffer_get_length (block_buffer))); 1332: if (evbuffer_get_length (block_buffer) < req->length) 1333: return READ_LATER; 1334: 1335: /* pass the block along... */ 1336: err = clientGotBlock (msgs, block_buffer, req); 1337: evbuffer_drain (block_buffer, evbuffer_get_length (block_buffer)); 1338: 1339: /* cleanup */ 1340: req->length = 0; 1341: msgs->state = AWAITING_BT_LENGTH; #11 canRead (io=, vmsgs=0x7f9d700116a0, piece=) at peer-msgs.c:1624 1619: { 1620: ret = READ_LATER; 1621: } 1622: else if (msgs->state == AWAITING_BT_PIECE) 1623: { 1624: ret = readBtPiece (msgs, in, inlen, piece); 1625: } 1626: else switch (msgs->state) 1627: { 1628: case AWAITING_BT_LENGTH: 1629: ret = readBtLength (msgs, in, inlen); break; #12 0x00007f9d9a026d3a in canReadWrapper (io=0x7f9d70160270) at peer-io.c:203 198: 199: while (!done && !err) 200: { 201: size_t piece = 0; 202: const size_t oldLen = evbuffer_get_length (io->inbuf); 203: const int ret = io->canRead (io, io->userData, &piece); 204: const size_t used = oldLen - evbuffer_get_length (io->inbuf); 205: const unsigned int overhead = guessPacketOverhead (used); 206: 207: if (piece || (piece!=used)) 208: { #13 0x00007f9d9a069a7a in UTP_ProcessIncoming (conn=conn@entry=0x7f9d701d61e0, packet=packet@entry=0x7f9d831beb40 "\001", len=len@entry=1402, syn=syn@entry=false) at utp.cpp:2158 2153: if (seqnr == 0) { 2154: size_t count = packet_end - data; 2155: if (count > 0 && conn->state != CS_FIN_SENT) { 2156: LOG_UTPV("0x%08x: Got Data len:%u (rb:%u)", conn, (uint)count, (uint)conn->func.get_rb_size(conn->userdata)); 2157: // Post bytes to the upper layer 2158: conn->func.on_read(conn->userdata, data, count); 2159: } 2160: conn->ack_nr++; 2161: conn->bytes_since_ack += count; 2162: 2163: // Check if the next packet has been received too, but waiting #14 0x00007f9d9a06a8bc in UTP_IsIncomingUTP (incoming_proc=incoming_proc@entry=0x7f9d9a03cdc0 , send_to_proc=send_to_proc@entry=0x7f9d9a03ced0 , send_to_userdata=send_to_userdata@entry=0x7f9d9ad40c80, buffer=buffer@entry=0x7f9d831beb40 "\001", len=len@entry=1402, to=0x7f9d831beac0, tolen=tolen@entry=16) at utp.cpp:2587 2582: conn->func.on_error(conn->userdata, err); 2583: } 2584: return true; 2585: } else if (flags != ST_SYN && conn->conn_id_recv == id) { 2586: LOG_UTPV("0x%08x: recv processing", conn); 2587: const size_t read = UTP_ProcessIncoming(conn, buffer, len); 2588: if (conn->userdata) { 2589: conn->func.on_overhead(conn->userdata, false, 2590: (len - read) + conn->get_udp_overhead(), 2591: header_overhead); 2592: } #15 0x00007f9d9a03cf78 in tr_utpPacket (buf=buf@entry=0x7f9d831beb40 "\001", buflen=buflen@entry=1402, from=from@entry=0x7f9d831beac0, fromlen=16, ss=ss@entry=0x7f9d9ad40c80) at tr-utp.c:179 174: if (utp_timer == NULL) 175: return -1; 176: reset_timer (ss); 177: } 178: 179: return UTP_IsIncomingUTP (incoming, tr_utpSendTo, ss, 180: buf, buflen, from, fromlen); 181: } 182: 183: void 184: tr_utpClose (tr_session * session UNUSED) #16 0x00007f9d9a03c404 in event_callback (s=, type=, sv=0x7f9d9ad40c80) at tr-udp.c:225 220: rc = tau_handle_message (ss, buf, rc); 221: if (!rc) 222: tr_ndbg ("UDP", "Couldn't parse UDP tracker packet."); 223: } else { 224: if (tr_sessionIsUTPEnabled (ss)) { 225: rc = tr_utpPacket (buf, rc, (struct sockaddr*)&from, fromlen, ss); 226: if (!rc) 227: tr_ndbg ("UDP", "Unexpected UDP packet"); 228: } 229: } 230: } #17 0x00007f9d97cf4744 in event_base_loop () from /tmp/apport_sandbox_yvg9gB/usr/lib/x86_64-linux-gnu/libevent-2.0.so.5 #18 0x00007f9d9a03d0a8 in libeventThreadFunc (veh=0x7f9d9ad3a6c0) at trevent.c:248 243: event_add (eh->pipeEvent, NULL); 244: event_set_log_callback (logFunc); 245: 246: /* loop until all the events are done */ 247: while (!eh->die) 248: event_base_dispatch (base); 249: 250: /* shut down the thread */ 251: tr_lockFree (eh->lock); 252: event_base_free (base); 253: eh->session->events = NULL; #19 0x00007f9d9a0283fa in ThreadFunc (_t=0x7f9d9ac1d870) at platform.c:118 113: static ThreadFuncReturnType 114: ThreadFunc (void * _t) 115: { 116: tr_thread * t = _t; 117: 118: t->func (t->arg); 119: 120: tr_free (t); 121: #ifdef WIN32 122: _endthreadex (0); 123: return 0; #20 0x00007f9d96f82f8e in start_thread (arg=0x7f9d831c0700) at pthread_create.c:311 [Error: pthread_create.c was not found in source tree] #21 0x00007f9d96cace1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113 [Error: ../sysdeps/unix/sysv/linux/x86_64/clone.S was not found in source tree]