You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our bug scanner has reported a data race issue at text.c#L237,
in function main, search_sortlist sorts threads created by search_getspeeds,
j = search_getspeeds( search, i );
search_sortlist( search, i );
search_getspeeds returns 0 if pthread_create failed,
would it create a part of speedtest threads, then hit one pthread_create failure and returns to main function? Could it result a situation that the created threads still running and search_sortlist writes to variables used by threads in the same time?
intsearch_getspeeds( search_t *results, int count )
{
.......
while( done < count )
{
for( i = 0; i < count; i ++ )
{
if( running < results->conf->search_threads && !results[i].speed )
{
results[i].speed = SPEED_ACTIVE;
results[i].speed_start_time = gettime();
if( pthread_create( results[i].speed_thread,
NULL, search_speedtest, &results[i] ) == 0 )
{
running ++;
break;
}
else
{
return( 0 ); // hit one pthread_create failure here, but some of threads might still running
}
}
SourceBrella Inc.,
Alex
The text was updated successfully, but these errors were encountered:
Hi all,
Our bug scanner has reported a data race issue at text.c#L237,
in function
main
,search_sortlist
sorts threads created by search_getspeeds,j = search_getspeeds( search, i ); search_sortlist( search, i );
search_getspeeds
returns 0 ifpthread_create
failed,would it create a part of speedtest threads, then hit one
pthread_create
failure and returns to main function? Could it result a situation that the created threads still running andsearch_sortlist
writes to variables used by threads in the same time?SourceBrella Inc.,
Alex
The text was updated successfully, but these errors were encountered: