Project

General

Profile

Actions

Bug #3824

closed
BT RM

Potential race in WMessageResourceBundle with WServer::setLocalizedStrings

Bug #3824: Potential race in WMessageResourceBundle with WServer::setLocalizedStrings

Added by Bruce Toll over 11 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/25/2015
Due date:
% Done:

0%

Estimated time:

Description

For static resources where WServer::setLocalizedStrings is provided a WMessageResourceBundle on which refresh() has not been called, it appears that multiple threads can attempt to initialize the WMessageResourceBundle simultaneously. This can result in a segfault.

I noticed this with an earlier github version of Wt 3.3.3-25-g7023b38 when attempting to retrieve several static resources in parallel. I have attached a lightly edited backtrace demonstrating one failure path. I would have liked to provide a self-contained reproducible example, but hopefully this is sufficient.

NOTE: A workaround that seems to help is to call refresh() on the WMessageResourceBundle before passing it to setLocalizedStrings, e.g.

auto message_bundle = new WMessageResourceBundle();
message_bundle->use(server.appRoot() + "report");

// prevent race condition on first use of message_bundle
message_bundle->refresh();
server.setLocalizedStrings(message_bundle);

Files

backtrace_20150225c.txt (6.45 KB) backtrace_20150225c.txt Bruce Toll, 02/25/2015 10:05 PM

Related issues 2 (0 open — 2 closed)

Related to Feature #3381: client's locale is not respected in static WResourceClosedRomain Mardulyn06/25/2014

Actions
Related to Improvements #14171: Do not parse WMessageResourceBundle each time on WApplication launchClosedRomain Mardulyn12/03/2025

Actions

KD Updated by Koen Deforche over 11 years ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Benoit Daccache
  • Target version set to 3.3.4

I believe you're right. We should make sure that use of a message resource bundle is thread-safe (which we didn't initially foresee), except for it's refresh(), and properly document this.

KD Updated by Koen Deforche over 11 years ago Actions #2

  • Status changed from InProgress to New
  • Assignee deleted (Benoit Daccache)

To be solved together with #3381 by changing WLocalizedStrings API to be stateless: having a new virtual function which takes the locale as paremeter, and deprecating the old ones.

Koen

KD Updated by Koen Deforche over 11 years ago Actions #3

  • Target version deleted (3.3.4)

MV Updated by Matthias Van Ceulebroeck 11 months ago Actions #4

  • Related to Feature #3381: client's locale is not respected in static WResource added

MV Updated by Matthias Van Ceulebroeck 11 months ago Actions #5

  • Related to Improvements #14171: Do not parse WMessageResourceBundle each time on WApplication launch added

MV Updated by Matthias Van Ceulebroeck 11 months ago Actions #6

  • Description updated (diff)
  • Status changed from New to InProgress
  • Assignee set to Matthias Van Ceulebroeck
  • Target version set to 4.12.3

The issue #14171, resulted in me finding this ticket by "accident".
As this relates to the same functionality, this ticket will be #14171's precursor.

MV Updated by Matthias Van Ceulebroeck 11 months ago Actions #7

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)

RM Updated by Romain Mardulyn 11 months ago Actions #8

  • Assignee set to Romain Mardulyn

RM Updated by Romain Mardulyn 9 months ago Actions #9

  • Target version changed from 4.12.3 to 4.12.4

RM Updated by Romain Mardulyn 8 months ago Actions #10

  • Target version changed from 4.12.4 to 4.12.6

RM Updated by Romain Mardulyn 8 months ago Actions #11

  • Target version changed from 4.12.6 to 4.13.0

RM Updated by Romain Mardulyn 7 months ago Actions #12

  • Target version changed from 4.13.0 to 4.13.1

RM Updated by Romain Mardulyn 7 months ago Actions #13

  • Target version changed from 4.13.1 to 4.13.2

RM Updated by Romain Mardulyn 7 months ago Actions #14

  • Target version changed from 4.13.2 to 4.14.0

RM Updated by Romain Mardulyn 4 months ago Actions #15

  • Assignee deleted (Romain Mardulyn)

ED Updated by emil de keyser 4 months ago Actions #16

  • Assignee set to emil de keyser

ED Updated by emil de keyser 4 months ago Actions #17

  • Status changed from Review to Resolved
  • Assignee changed from emil de keyser to Romain Mardulyn

RM Updated by Romain Mardulyn 4 months ago Actions #18

  • Status changed from Resolved to Implemented @Emweb

RM Updated by Romain Mardulyn 4 months ago Actions #19

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom