Boost.Regex - why does it core dump?
I have built Boost 1.33.1 on a HP-UX 11.22 OS with GCC 4.02. I have created a little test program, and when it gets to the following line of code it core dumps. boost::regex Exp( "[0-9]" ); This happens when I link both statically or dynamically. Any insights into what might be the problem would be greatly appreciated. Matt Smith Acxiom Corporation Data Compilation CWY0101-80 PO Box 2000 301 Industrial Blvd. Conway, AR 72033-2000 (501) 342-2434 Matt.Smith@acxiom.com *************************************************************************** The information contained in this communication is confidential, is intended only for the use of the recipient named above, and may be legally privileged. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please resend this communication to the sender and delete the original message or any copy of it from your computer system. Thank You. ****************************************************************************
Smith Matt - matsmi wrote:
I have built Boost 1.33.1 on a HP-UX 11.22 OS with GCC 4.02.
I have created a little test program, and when it gets to the following line of code it core dumps.
boost::regex Exp( "[0-9]" );
This happens when I link both statically or dynamically.
Me too. Except the platform is VC7 + STLport. It crashes because deep inside a map, a pointer has 0xccccccc in it (obviously a cleared storage flag). I slunk back to 1.33.0, thought I fixed that error, and then got a butt-load of other errors. Only a few are posted about. -- Phlip http://www.greencheese.org/ZeekLand <-- NOT a blog!!
Me too. Except the platform is VC7 + STLport. It crashes because deep inside a map, a pointer has 0xccccccc in it (obviously a cleared storage flag).
I slunk back to 1.33.0, thought I fixed that error, and then got a butt-load of other errors. Only a few are posted about.
I've just retested 1.33.1 with VC7 and STLport 4.6.2 and 5.0.0 and don't see any problems, so.... 1) Do you have a test case? 2) Which STLport version are you using? 3) What compiler runtime are you using? Thanks, John.
John Maddock wrote:
1) Do you have a test case?
I have a mysterious build environment (and a slow workstation that takes a long time to compile template-rich systems). Our leaders hacked the system together to port Makefiles (yes, dumb old Makefiles) transparently between the Linux target and the Win32 development environments. Can't we all just ... get along? This will make extracting a test case that reproduces the environment problematic. Unless you would like me to mail you all of it. ;-)
2) Which STLport version are you using? 3) What compiler runtime are you using?
STLport-4.6.2 Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86 (The IDE is, more familiarily, 7.1) Don't work this until I either get over it or perfect a test case. Or someone else reports something. Either way I'l probably report something to this thread. -- Phlip http://www.greencheese.org/ZeekLand <-- NOT a blog!!
I just reproduced it again. Here's the setup:
$(WIN32_TARGET):
export STLPORT_PATH=../STLport-4.6.2/ ;\
export MSVCDir=$VCINSTALLDIR ;\
./configure --with-toolset=vc-7_1-stlport
--with-bjam=tools/build/jam_src/bin.ntx86/bjam.exe ;\
tools/build/jam_src/bin.ntx86/bjam.exe "-sTOOLS=vc-7_1-stlport"
--with-regex stage
Then at link time, the application catches:
unresolved external symbol "void __cdecl
boost::re_detail::raise_runtime_error(class _STL::runtime_error const
&)"...
unresolved external symbol "class _STL::basic_string
Phlip wrote:
I just reproduced it again. Here's the setup:
$(WIN32_TARGET): export STLPORT_PATH=../STLport-4.6.2/ ;\ export MSVCDir=$VCINSTALLDIR ;\ ./configure --with-toolset=vc-7_1-stlport --with-bjam=tools/build/jam_src/bin.ntx86/bjam.exe ;\ tools/build/jam_src/bin.ntx86/bjam.exe "-sTOOLS=vc-7_1-stlport" --with-regex stage
Then at link time, the application catches:
unresolved external symbol "void __cdecl boost::re_detail::raise_runtime_error(class _STL::runtime_error const &)"...
unresolved external symbol "class _STL::basic_string
__cdecl boost::re_detail::w32_transform(unsigned long,char const *,char const *)"... So I copy and paste those into my application's cpp file, and they link. Then I crash here:
Linker errors are there to tell you something: the lib file you're linking against is *not* binary compatible with your applications build options. So.... are you letting autolink pick the right lib to link against or have you over-riden an error there as well? Are you defining __STL_DEBUG in debug builds? The bjam built libs do so, and you'll need to define __STL_DEBUG to link against them. The autolink code should have picked this one up however. If all esle fails I suggest you build the regex lib from the IDE with *exactly* the same options as your application: remember it's just a bunch of sources, you can add the source code directly to your project as well if you want (define BOOST_REGEX_NO_LIB to disable autolinking if you do so however). Hopefully that will clear the problem's you're seeing. John.
I have created a little test program, and when it gets to the following line of code it core dumps.
boost::regex Exp( "[0-9]" );
This happens when I link both statically or dynamically.
Any insights into what might be the problem would be greatly appreciated.
No idea, can you please: 1) add a try catch block and verify that the dump isn't a result of an uncaught exception. 2) provide a backtrace? John.
I have built Boost 1.33.1 on a HP-UX 11.22 OS with GCC 4.02.
Just a wild suggestion: I take it that gcc-4.02 is not your default g++ compiler (the one you get when you invoke g++)? If so are you certain that the lib was built with gcc-4 and not the default compiler? It would certainly cause that kind of issue if that's the case. John.
participants (3)
-
John Maddock
-
Phlip
-
Smith Matt - matsmi