Project

General

Profile

Bug #1454

bundle - strtok() race in fb_opendir()

Added by Jaroslav Kysela almost 8 years ago. Updated almost 8 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
Category:
General
Target version:
Start date:
2012-12-12
Due date:
% Done:

100%

Estimated time:
Found in version:
current git
Affected Versions:

Description

I experience a re-entrant race in fb_opendir() function. See patch for details.


Files

a.patch (1.04 KB) a.patch Jaroslav Kysela, 2012-12-12 15:25

Associated revisions

Revision 86fac417 (diff)
Added by Adam Sutton almost 8 years ago

Issue #1454 - Remove usage of non re-entrant strtok()

Thanks to Jaroslav Kysela <> for providing the initial fix.

Revision 7d97d1f6 (diff)
Added by Adam Sutton almost 8 years ago

Issue #1454 - init strtok_r() state ptrs, older gcc whinges.

Revision a420c83a (diff)
Added by Adam Sutton almost 8 years ago

Issue #1454 - correct stupid typo when changing code layout in filebundle.

Revision 165e3d4c (diff)
Added by Adam Sutton almost 8 years ago

Fix #1454 - Remove usage of non re-entrant strtok()

Thanks to Jaroslav Kysela <> for providing the initial fix.
(cherry picked from commit 86fac417c20734383e904e38169f1c88b42a6da9)
(cherry picked from commit 7d97d1f648ed720785eac367481d8e56ea8f1ff8)
(cherry picked from commit a420c83a0e0d2c31c2c15d0fec6fedc3f5a36dfe)

History

#1

Updated by Adam Sutton almost 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Adam Sutton
  • Affected Versions 3.2, 3.3 added

Agreed, but I think the problem is more general than this.

I think we should probably avoid using strtok() anywhere that requires a second call, else we need to carefully check all such instances to ensure they are only called from a single thread.

Adam

#2

Updated by Adam Sutton almost 8 years ago

Thanks for the patch, I did the change myself in the end as I decided to do a complete (except one startup use) replacement of strtok() to avoid potential re-entrance/race issues.

Need to decide whether to backport to 3.2, probably yes!

Adam

#3

Updated by Adam Sutton almost 8 years ago

  • Status changed from Accepted to Resolved

Should now be fixed on master, needs back porting.

Adam

#4

Updated by Adam Sutton almost 8 years ago

  • Target version set to 3.2
#5

Updated by Adam Sutton almost 8 years ago

  • Status changed from Resolved to Fixed
  • % Done changed from 0 to 100

Also available in: Atom PDF