Opened 10 years ago

Closed 10 years ago

#6985 closed Bugs (worksforme)

regex_regress_threaded randomly crashes in ICU interface tests

Reported by: Clifford Hung <chung@…> Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost Development Trunk Severity: Showstopper
Keywords: Cc:

Description

When the regex tests are built with the ICU libraries, the regex_regress_threaded test randomly crashes in ICU interface tests.

For example, when using ICU 4.4 with Boost (trunk) compiled with gcc 4.6.1 on Ubuntu 11.10, the regex_regress_threaded test run ten times by a shell script outputs the following:

no errors detected
no errors detected
no errors detected
no errors detected
no errors detected
no errors detected
no errors detected
no errors detected
no errors detected
terminate called after throwing an instance of 'std::length_error'
  what():  basic_string::_S_create

**** exception(210): signal: SIGABRT (application abort requested)
******** errors detected; see standard output for details ********

I have also tried compiling the ICU library from source for versions 4.4, 4.6, 4.8 and 4.9 and similar crashes are reported from the ICU interface tests.

Change History (8)

comment:1 by anonymous, 10 years ago

I think I have this fixed in SVN: I just fixed a couple of valgrind errors that were showing up. Helgrind still reports some errors inside ICU, but I think these are spurious (valgrind doesn't know about ICU's memory management routines).

Can you please retest?

Many thanks, John.

comment:2 by Clifford Hung <chung@…>, 10 years ago

That seems to have resolved it on trunk using ICU 4.4 (both ones supplied by Ubuntu and compiled libraries).

I mistakenly said that I had tried ICU versions 4.6 to 4.9 on trunk, that was actually on 1.48.0. On trunk, those ICU versions fail the has_icu_test as follows:

../../../bin.v2/libs/regex/build/gcc-4.6.1/debug/has_icu_test.o: In function `main':
/home/chung/dev/boost-trunk/libs/regex/test/../../../libs/regex/build/has_icu_test.cpp:24: undefined reference to `u_charFromName_49'

I used the same bjam command to build from boost/libs/regex/test on trunk as on 1.48.0, so I'm not sure why it is failing. Example:

../../../bjam  -a include=/home/chung/dev/icu-linux-4.9/source/common "linkflags=-L/home/chung/dev/icu-linux-4.9/build/lib"

I applied the diff of revision 78940 vs 78480 to Boost 1.48.0 and the regex test passes for ICU 4.4. However, for ICU 4.6, 4.8 and 4.9 I am getting an error about unexpected exceptions (std::bad_alloc). Here's an excerpt:

regress/test_sets.cpp:52: Error in test here:
  regress/test_icu.cpp:351:Received an unexpected std::exception: std::bad_alloc (While testing ICU interfaces)
regress/test_sets.cppregress/test_sets.cpp:52: Error in test here:
  regress/test_icu.cpp:351:Received an unexpected std::exception: std::bad_alloc (While testing ICU interfaces)
regress/test_sets.cpp:53: Error in test here:
  regress/test_icu.cpp:351:Received an unexpected std::exception: std::bad_alloc (While testing ICU interfaces)

comment:3 by anonymous, 10 years ago

I mistakenly said that I had tried ICU versions 4.6 to 4.9 on trunk, that was actually on 1.48.0. On trunk, those ICU versions fail the has_icu_test as follows:

I believe this is caused by the linker finding the wrong ICU library versions, try:

bjam -sICU_PATH=/home/chung/dev/icu-linux-4.9

However, for ICU 4.6, 4.8 and 4.9 I am getting an error about unexpected exceptions (std::bad_alloc). Here's an excerpt:

Works for me with ICU-49 on Win32 and Ubuntu x86. Could this be due to LD_LIBRARY_PATH not being set and the libraries not being loaded correctly?

Otherwise what's the platform?

in reply to:  3 comment:4 by Clifford Hung <chung@…>, 10 years ago

Replying to anonymous:

I mistakenly said that I had tried ICU versions 4.6 to 4.9 on trunk, that was actually on 1.48.0. On trunk, those ICU versions fail the has_icu_test as follows:

I believe this is caused by the linker finding the wrong ICU library versions, try:

bjam -sICU_PATH=/home/chung/dev/icu-linux-4.9

However, for ICU 4.6, 4.8 and 4.9 I am getting an error about unexpected exceptions (std::bad_alloc). Here's an excerpt:

Works for me with ICU-49 on Win32 and Ubuntu x86. Could this be due to LD_LIBRARY_PATH not being set and the libraries not being loaded correctly?

Otherwise what's the platform?

Passing ICU_PATH for the build on boost-trunk allows it to pass the has_icu_test but the regex test fails due to the std:bad_alloc exceptions as with 1.48.0. The platform I am using for Ubuntu is a Lenovo W500 (Core 2 Duo, 4 GB memory).

comment:5 by John Maddock, 10 years ago

I'm stuck.

Passes for me on both 32 and 64 bit Ubuntu, also tried various ICU versions.

Note that regex itself doesn't throw bad_alloc from anywhere, so the exception must be coming from the std lib or ICU itself. Any chance you can do some debugging?

Thanks, John.

comment:6 by Clifford Hung <chung@…>, 10 years ago

Could you list the steps you took to compile ICU and Boost Regex just to rule out differences in the build?

comment:7 by John Maddock, 10 years ago

Nothing special, for the ICU version installed via Ubuntu's package manager it's just:

cd libs/regex/test
bjam

And ICU is found and used OK.

For versions I built, it's the normal:

./configure --prefix=some-local-path
make
make install

For ICU, and then:

export LD_LIBRARY_PATH=some-local-path/bin
bjam -sICU_PATH=some-local-path

For regex.

The errors you're getting smell like some sort of misconfiguration - mismatched link and runtime ICU versions? But it's hard to tell for sure.

comment:8 by John Maddock, 10 years ago

Resolution: worksforme
Status: newclosed

Waiting for response... works for me.

Note: See TracTickets for help on using tickets.