Opened 14 years ago

Closed 14 years ago

#1818 closed Bug (duplicate)

Concurrent bug for bandwidth allocation

Reported by: shiyao Owned by: charles
Priority: Highest Milestone: None Set
Component: libtransmission Version: 1.42
Severity: Critical Keywords:
Cc:

Description

In function tr_sessionInitFull (in session.c), it creates the timer by calling tr_peerMgrNew before creating bandwidth object, h->bandwidth. The codes are following,

271:h->peerMgr = tr_peerMgrNew( h );

......

281:h->bandwidth = tr_bandwidthNew( h, NULL );

The timer created by tr_peerMgrNew will send a message to the event thread to allocate bandwith. In general, this behavior is after bandwidth object created (line 281).

However, the order between allocation of bandwidth and creation of bandwidth object is unfixed. If allocation of bandwidth happens before creation of bandwidth object, the program will crash on the assertion at line 251 of bandwidth.c ( assert( tr_isBandwidth( b ) ); ).

I inserted a second delay before line 281 of session.c. The bug is exposed and the program crashed.

Change History (5)

comment:1 Changed 14 years ago by livings124

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

These two calls appear to already be swapped in the 1.50 source.

comment:2 Changed 14 years ago by livings124

  • Milestone changed from None Set to 1.50
  • Resolution worksforme deleted
  • Status changed from closed to reopened

comment:3 Changed 14 years ago by livings124

  • Resolution set to fixed
  • Status changed from reopened to closed

comment:4 Changed 14 years ago by livings124

  • Milestone changed from 1.50 to None Set
  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed 14 years ago by livings124

  • Resolution set to duplicate
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.