Boost.Regex - why does it core dump?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Boost.Regex - why does it core dump?

Smith Matt - matsmi
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

    [hidden email]

***************************************************************************
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.
****************************************************************************

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Phlip
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!!
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

John Maddock
In reply to this post by Smith Matt - matsmi
> 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.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

John Maddock
In reply to this post by Smith Matt - matsmi
> 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.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

John Maddock
In reply to this post by Phlip
> 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.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Phlip
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!!
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Smith Matt - matsmi
In reply to this post by Smith Matt - matsmi


> 1) add a try catch block and verify that the dump isn't a result of an

uncaught exception.

Done.  Same result.


> 2) provide a backtrace?

Okay; here it is:

Program terminated with signal 11, Segmentation fault.
#0  0x407c851 in boost::detail::atomic_increment (pw=0x400087a4)
    at sp_counted_base_gcc_ia64.hpp:38
38               "r"(pw));
(gdb) backtrace
#0  0x407c851 in boost::detail::atomic_increment (pw=0x400087a4)
    at sp_counted_base_gcc_ia64.hpp:38
#1  0x407cc60 in boost::detail::sp_counted_base::add_ref_copy
(this=0x400087a0)
    at sp_counted_base_gcc_ia64.hpp:117
#2  0x407cdb0 in boost::detail::shared_count::shared_count
(this=0x7ffff0f8,
    r=@0x7ffff128) at shared_count.hpp:170
#3  0x4087700 in
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char
>
>::boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<c
har> > (this=0x7ffff0f4) at shared_ptr.hpp:106
#4  0x40af160 in
std::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implement
ation<char> >,boost::re_detail::cpp_regex_traits_base<char> const*
>::std::pair<boost::shared_ptr<boost::re_detail::cpp_regex_traits_implem
entation<char> >,boost::re_detail::cpp_regex_traits_base<char> const* >
(this=0x7ffff0f4,
    __a=@0x7ffff124, __b=@0x7ffff0f0) at stl_pair.h:85
#5  0x4119f40 in
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,boost:
:re_detail::cpp_regex_traits_implementation<char> >::do_get (
    k=@0x7ffff1b0, max_cache_size=5) at object_cache.hpp:122
#6  0x411b190 in
boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,boost:
:re_detail::cpp_regex_traits_implementation<char> >::get (
    k=@0x7ffff1b0, max_cache_size=5) at object_cache.hpp:78
#7  0x411b250 in
boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char
> > boost::re_detail::create_cpp_regex_traits<char> (l=@0x7ffff1e0)
    at cpp_regex_traits.hpp:822
#8  0x411b380 in
boost::cpp_regex_traits<char>::boost::cpp_regex_traits<char> (
    this=0x40008760) at cpp_regex_traits.hpp:842
#9  0x411b480 in boost::regex_traits<char,boost::cpp_regex_traits<char>
>::boost::regex_traits<char,boost::cpp_regex_traits<char> >
(this=0x40008760)
    at regex_traits.hpp:68
#10 0x411b500 in
boost::regex_traits_wrapper<boost::regex_traits<char,boost::cpp_regex_tr
aits<char> >
>::boost::regex_traits_wrapper<boost::regex_traits<char,boost::cpp_regex
_traits<char> > > (this=0x40008760) at regex_traits.hpp:162
#11 0x411b5b0 in
boost::re_detail::regex_data<char,boost::regex_traits<char,boost::cpp_re
gex_traits<char> >
>::boost::re_detail::regex_data<char,boost::regex_traits<char,boost::cpp
_regex_traits<char> > > (this=0x4000f410)
    at basic_regex.hpp:54
#12 0x411b740 in
boost::re_detail::basic_regex_implementation<char,boost::regex_traits<ch
ar,boost::cpp_regex_traits<char> >
>::boost::re_detail::basic_regex_implementation<char,boost::regex_traits
<char,boost::cpp_regex_traits<char> > > (
    this=0x4000f410) at basic_regex.hpp:85
#13 0x411b880 in
boost::basic_regex<char,boost::regex_traits<char,boost::cpp_regex_traits
<char> > >::do_assign (this=0x7ffff2d8, p1=0x404d950 ".",
    p2=0x404d951 "", f=0) at basic_regex.hpp:517
#14 0x4079f10 in
boost::basic_regex<char,boost::regex_traits<char,boost::cpp_regex_traits
<char> > >::assign+0x90 ()
#15 0x407a000 in
boost::basic_regex<char,boost::regex_traits<char,boost::cpp_regex_traits
<char> > >::assign+0xc0 ()
#16 0x407a100 in
boost::basic_regex<char,boost::regex_traits<char,boost::cpp_regex_traits
<char> >
>::boost::basic_regex<char,boost::regex_traits<char,boost::cpp_regex_tra
its<char> > >+0xd0 ()
#17 0x4067ee0:0 in ValidateArgs+0x430 ()
#18 0x4068800:0 in main+0xc0 ()
Current language:  auto; currently c++

*************************************************************************
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.
*************************************************************************
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Phlip
In reply to this post by Phlip
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<char,class
_STL::char_traits<char>,class _STL::allocator<char> > __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:

  _Rb_tree_node<_Value>* _M_find(const key_type& __k) const
# endif
  {
    _Link_type __y = this->_M_header._M_data;      // Last node which
is not less than __k.
    _Link_type __x = _M_root();      // Current node.

Deep in STLport, _tree.h, this->_M_header._M_data == 0xcdcdcdcd. Not
sure why that would cause the __y line to crash, but the data
generally shouldn't be garbage anyway, right?

--
  Phlip
  http://www.greencheese.org/ZeekLand  <-- NOT a blog!!
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Smith Matt - matsmi
In reply to this post by Smith Matt - matsmi
> > 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.


gcc-4.02 IS the default compiler, so that is what the libraries and my
test program are built with.  Thanks.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
***************************************************************************
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.
****************************************************************************
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

John Maddock
In reply to this post by Smith Matt - matsmi
>> 2) provide a backtrace?
>
> Okay; here it is:

Oh !*^% it's an outstanding shared_ptr bug: if you define
BOOST_SP_USE_PTHREADS both when building regex and again in your application
this problem will go away.  I'll go off and nag the people responsible ;->

John.

_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

John Maddock
In reply to this post by Phlip
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<char,class
> _STL::char_traits<char>,class _STL::allocator<char> > __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.



_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: Boost.Regex - why does it core dump?

Smith Matt - matsmi
In reply to this post by Smith Matt - matsmi
> Oh !*^% it's an outstanding shared_ptr bug: if you define
> BOOST_SP_USE_PTHREADS both when building regex and again in your
application
> this problem will go away.  I'll go off and nag the people responsible
;->

Well, surprisingly enough (because, as I understand it, gcc on HP-UX
does not support multi-threading), that worked!  

Thanks for your help, John!

Matt
*************************************************************************
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.
*************************************************************************
_______________________________________________
Boost-users mailing list
[hidden email]
http://lists.boost.org/mailman/listinfo.cgi/boost-users