bugGNU gettext - Bugs: bug #57306, libgettextpo: po_file_read is...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #57306: libgettextpo: po_file_read is thread-unsafe

Submitter:  Alexander Potashev <aspotashev>
Submitted:  Tue 26 Nov 2019 02:24:10 PM UTC
 
Category:  Programmer interface Severity:  2 - Minor
Item Group:  None Status:  Confirmed
Privacy:  Public Assigned to:  None
Open/Closed:  Open

Tue 26 Nov 2019 03:33:34 PM UTC, comment #2: 

The workaround is easy: Use libgettextpo in a single thread only, or serialize using a lock.

Bruno Haible <haible>
Project Administrator
Tue 26 Nov 2019 03:31:58 PM UTC, comment #1: 

Indeed, libgettextpo contains a number of static variables; this makes it not multithread-safe:

$ nm .libs/libgettextpo.so.0.5.5 | grep ' [bBdD] ' | awk '{print $3}' | LC_ALL=C sort
autodetect_jp_try
autodetect_kr_try
autodetect_list_end
autodetect_predefined
autodetect_utf8_try
buf.6047
buffer_key
bufmax.6048
bufmax_key
bullet_stack
callback_arg
completed.7594
curr_mp
curr_msgid_pos
default_methods
default_values.7095
directory
escape
extension.4130
filepos_comment_type
have_dupfd_cloexec.3850
ignore_parser.6534
indent
keys_init_once
libgettextpo_allow_duplicates
libgettextpo_error_with_progname
libgettextpo_exit_failure
libgettextpo_format_language
libgettextpo_format_language_pretty
libgettextpo_formatstring_awk
libgettextpo_formatstring_boost
libgettextpo_formatstring_c
libgettextpo_formatstring_csharp
libgettextpo_formatstring_elisp
libgettextpo_formatstring_gcc_internal
libgettextpo_formatstring_gfc_internal
libgettextpo_formatstring_java
libgettextpo_formatstring_java_printf
libgettextpo_formatstring_javascript
libgettextpo_formatstring_kde
libgettextpo_formatstring_kde_kuit
libgettextpo_formatstring_librep
libgettextpo_formatstring_lisp
libgettextpo_formatstring_lua
libgettextpo_formatstring_objc
libgettextpo_formatstring_parsers
libgettextpo_formatstring_pascal
libgettextpo_formatstring_perl
libgettextpo_formatstring_perl_brace
libgettextpo_formatstring_php
libgettextpo_formatstring_python
libgettextpo_formatstring_python_brace
libgettextpo_formatstring_qt
libgettextpo_formatstring_qt_plural
libgettextpo_formatstring_scheme
libgettextpo_formatstring_sh
libgettextpo_formatstring_smalltalk
libgettextpo_formatstring_tcl
libgettextpo_formatstring_ycp
libgettextpo_germanic_plural
libgettextpo_gl_linked_list_implementation
libgettextpo_gram_max_allowed_errors
libgettextpo_gram_pos
libgettextpo_gram_pos_column
libgettextpo_input_format_po
libgettextpo_obstack_alloc_failed_handler
libgettextpo_output_format_po
libgettextpo_pass_obsolete_entries
libgettextpo_plural_table
libgettextpo_po_charset_ascii
libgettextpo_po_charset_utf8
libgettextpo_po_error
libgettextpo_po_error_at_line
libgettextpo_po_gram_char
libgettextpo_po_gram_lval
libgettextpo_po_gram_nerrs
libgettextpo_po_lex_charset
libgettextpo_po_lex_iconv
libgettextpo_po_lex_weird_cjk
libgettextpo_po_multiline_error
libgettextpo_po_multiline_warning
libgettextpo_po_xerror
libgettextpo_po_xerror2
libgettextpo_sentence_end_required_spaces
libgettextpo_sigfpe_code
libgettextpo_sigfpe_exit
libgettextpo_syntax_check_name
libgettextpo_version
libgettextpo_xmalloc_exit_failure
mbf
page_width
pass_comments
plural_counter
po_lex_obsolete
po_lex_previous
print_comment
required_fields.7094
result.6691
sc_funcs
signal_eilseq
standard_charsets.3410
stdout_closed.2850
uniforum
weird_cjk_charsets.3465
whole_list.6807
width.3915
wrap_strings

Bruno Haible <haible>
Project Administrator
Tue 26 Nov 2019 02:24:10 PM UTC, original submission:  

po_file_read is thread-unsafe because it sets global variables like error handlers.

I would like to be able to open multiple .po files in parallel to improve performance.

Alexander Potashev <aspotashev>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by aspotashev (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

     

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-11-26 haible Severity3 - Normal 2 - Minor
    2019-11-26 haible StatusNone Confirmed

    Back to the top

    Powered by Savane 3.10