View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000109 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2009-06-30 19:26 | 2013-04-16 13:06 |
| Reporter | msbrown | Assigned To | ajosey | ||
| Priority | normal | Severity | Editorial | Type | Error |
| Status | Closed | Resolution | Accepted As Marked | ||
| Name | Martin Sebor | ||||
| Organization | |||||
| User Reference | |||||
| Section | 2.9.1 | ||||
| Page Number | 507 | ||||
| Line Number | 17490 | ||||
| Interp Status | Approved | ||||
| Final Accepted Text | 0000109:0000214 | ||||
| Summary | 0000109: mblen() not thread-safe | ||||
| Description | _____________________________________________________________________________ EDITORIAL Enhancement Request Number 38 msebor:xxxxxxxxx Bug in XSHd5.1 2.9.1 (rdvk# 4) {mblen() not thread-safe} Wed, 20 May 2009 00:22:48 +0100 (BST) _____________________________________________________________________________ mblen() and mbtowc() are expected to maintain an internal shift state from one call to the next. However, neither function is listed in 2.9.1, Thread-Safety, among functions that are not required to be thread-safe. Thus, the specification effectively requires that each function maintain a thread-local copy of the state. However, at least two recent quality implementations maintain a per-process state instead, and thus are not thread-safe. A discussion on austin-group-l indicates that the named functions are not, in fact, intended to be thread-safe. | ||||
| Desired Action | Add mblen() and mbtowc() functions that maintain an internal state to the list of functions that are not required to be thread safe, in 2.9.1, Thread-Safety. | ||||
| Tags | c99, tc1-2008 | ||||
|
|
->interps Send this down the interpretations track with the normal boilerplate for "standard is clear; standard is wrong". Concerns are being forwarded to the sponsor. Proposed changes for a future revision/ Add mblen(), mbstowcs(), and mbtowc() in subclause 2.9.1 in alphabetic order to the list of functions that need not be thread-safe in the table on P507, L17490-17510. Change the list of functions that need not be thread-safe if called with a NULL ps argument in subclause 2.9.1 on P507, L17512 from: "wcrtomb() and wcsrtombs()" to: "mbrlen(), mbrtowc(), mbsnrtowcs(), mbsrtowcs(), wcrtomb(), wcsnrtombs(), and wcsrtombs()" Add a new paragraph to the mblen() DESCRIPTION after P1270, L41765: "The mblen() function need not be thread-safe." with CX shading. Add a new paragraph to the mbrlen() DESCRIPTION after P1272, L41808: "The mbrlen() function need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbrtowc() DESCRIPTION after P1274, L41871: "The mbrtowc() function need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbsnrtowcs() and mbsrtowcs() DESCRIPTION after P1277, L41989: "The mbsnrtowcs() and mbsrtowcs() functions need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbtowc() DESCRIPTION after P1281, L42094: "The mbtowc() function need not be thread-safe." with CX shading. Change: "The wcsrtombs() function" in the DESCRIPTION of wcsnrtombs() and wcsrtombs() on P2219, L69818 to: "The wcsnrtombs() and wcsrtombs() functions" keeping the CX shading. Remove wcstombs() from the current table of non thread safe functions On page 2235 remove line 70283 "need not be thread-safe" |
|
|
Interpretation status: 2.THE "DEFECT" SITUATION (i.e. the balloting group appears to have gotten it wrong): "The standard states..., and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor." |
|
|
When we progress this down the interpretations track, the accepted text needs to be updated to account for the comments I made in reply to the minutes of the June 4 2009 teleconference: > Add mblen(), mbstowcs(), and mbtowc() in subclause 2.9.1 in alphabetic > order to the list of functions that need not be thread-safe in the table > on P507, L17490-17510. Should be: "Add mblen() and mbtowc() in ..." I think it would also be a good idea to move the other change to this table from near the bottom of the edits to here. (See below.) [...] > Change: > "The wcsrtombs() function" > in the DESCRIPTION of wcsnrtombs() and wcsrtombs() on P2219, L69818 to: > "The wcsnrtombs() and wcsrtombs() functions" > keeping the CX shading. > > Remove wcstombs() from the current table of non thread safe functions This is the line I referred to above, that should be grouped with the other edit to the same table. |
|
|
Interpretation response ------------------------ The standard states the requirements for thread safety of mblen() and mbtowc(), and conforming implementations must conform to this. However, concerns have been raised about this which are being referred to the sponsor." Rationale: ------------- None. Notes to the Editor (not part of this interpretation): ------------------------------------------------------- Add mblen() and mbtowc() in subclause 2.9.1 in alphabetic order to the list of functions that need not be thread-safe in the table on P507, L17490-17510. Remove wcstombs() from the same table. Change the list of functions that need not be thread-safe if called with a NULL ps argument in subclause 2.9.1 on P507, L17512 from: "wcrtomb() and wcsrtombs()" to: "mbrlen(), mbrtowc(), mbsnrtowcs(), mbsrtowcs(), wcrtomb(), wcsnrtombs(), and wcsrtombs()" Add a new paragraph to the mblen() DESCRIPTION after P1270, L41765: "The mblen() function need not be thread-safe." with CX shading. Add a new paragraph to the mbrlen() DESCRIPTION after P1272, L41808: "The mbrlen() function need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbrtowc() DESCRIPTION after P1274, L41871: "The mbrtowc() function need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbsnrtowcs() and mbsrtowcs() DESCRIPTION after P1277, L41989: "The mbsnrtowcs() and mbsrtowcs() functions need not be thread-safe if called with a NULL ps argument." with CX shading. Add a new paragraph to the mbtowc() DESCRIPTION after P1281, L42094: "The mbtowc() function need not be thread-safe." with CX shading. Change: "The wcsrtombs() function" in the DESCRIPTION of wcsnrtombs() and wcsrtombs() on P2219, L69818 to: "The wcsnrtombs() and wcsrtombs() functions" keeping the CX shading. On page 2235 remove line 70283 "The wcstombs() function need not be thread-safe" |
|
|
A liaison ballot comment on this subject should be filed for the C1x committee draft ballot. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-06-30 19:26 | msbrown | New Issue | |
| 2009-06-30 19:26 | msbrown | Status | New => Under Review |
| 2009-06-30 19:26 | msbrown | Assigned To | => ajosey |
| 2009-06-30 19:26 | msbrown | Name | => Mark Brown |
| 2009-06-30 19:26 | msbrown | Organization | => IBM |
| 2009-06-30 19:26 | msbrown | Section | => 2.9.1 |
| 2009-06-30 19:26 | msbrown | Page Number | => 507 |
| 2009-06-30 19:26 | msbrown | Line Number | => 17490 |
| 2009-06-30 19:27 | msbrown | Note Added: 0000142 | |
| 2009-06-30 19:27 | msbrown | Status | Under Review => Interpretation Required |
| 2009-06-30 19:27 | msbrown | Resolution | Open => Accepted As Marked |
| 2009-06-30 19:27 | msbrown | Final Accepted Text | => 0000109:0000142 |
| 2009-07-01 16:35 |
|
Name | Mark Brown => Martin Sebor |
| 2009-07-01 16:35 |
|
Organization | IBM => |
| 2009-08-06 16:23 | ajosey | Note Added: 0000189 | |
| 2009-08-11 16:41 |
|
Interp Status | => Pending |
| 2009-08-21 15:57 | geoffclare | Note Added: 0000204 | |
| 2009-08-21 16:23 | nick | Tag Attached: c99 | |
| 2009-09-03 15:35 | geoffclare | Note Added: 0000214 | |
| 2009-09-03 15:36 | geoffclare | Interp Status | Pending => Proposed |
| 2009-09-03 15:36 | geoffclare | Final Accepted Text | 0000109:0000142 => 0000109:0000214 |
| 2009-10-12 05:56 | ajosey | Interp Status | Proposed => Approved |
| 2010-09-21 11:06 | geoffclare | Tag Attached: tc1-2008 | |
| 2010-11-05 14:34 | nick | Note Added: 0000606 | |
| 2013-04-16 13:06 | ajosey | Status | Interpretation Required => Closed |