solaris gcc 3.2 stlport regexp (bug?)
Hi all, When I use bjam to compile the regexp library it compiles seems happy and then no code works properly, seg faults, rubbish results etc. When I compile using a modified make file of the shared-gcc.mak (modifications follow): INCLUDES= -I/export/home/ctwiner/STLport-4.5.3/stlport -L/export/home/ctwiner/STLport-4.5.3/lib LIBS= -lstlport_gcc_stldebug # compiler: CXX=g++ LINKER=g++ -shared -fPIC # # compiler options for release build: # C1=-c -O2 -I../../../ -fPIC # # compiler options for debug build: # C2=-c -g -I../../../ -fPIC It builds but even linking to the .so created causes a seg fault. I know that stlport is ok because I have programs linking to the new version using std::map's vectors and strings. I posted another message using 2.95 which had the same/similar problems. Everything seems to build fine but running causes seg faults. The solaris version is 2.8. When using the bjam built files and trying to run the compiled regexp_tests the locale_impl.h of stlports asserts at line 60. latest downloads of all librarys have been used. TIA Chris
Have you checked that your LD_LIBRARY_PATH is right? I've seen problems like this when picking up the a different version of the standard library than I compiled with.... Jeff
--- In Boost-Users@y..., "Jeff Garland"
Have you checked that your LD_LIBRARY_PATH is right? I've seen problems like this when picking up the a different version of the standard library than I compiled with....
Jeff
I have done but I'm going to check on my own ultra now, the work one has been heavily used and mine is fairly virginal. I should have a far better chance on mine. We'll see. Chris
Ok, I have some more information, some of the problem was due to compiling my application with -shared -fPIC (not the shared library). I got rid of that and the remaining problem was the following reg exp: reg_exp="(\\w+)=(\\{|\"([^\\t\\n\\r\\f\"].*)\"|([^ \\t\\n\\r\\f]+))|\\}|\\{"; in perl : /(\w+)=(\{|"([^\t\n\r\f"]*)"|([^ \t\n\r\f]+))|\}|\{/g Sometimes this line will work and others seg fault/illegal instruction. Changing the reg exp to .*class_name.* works fully. Change it back, segfault. as an aside it is meant to match : field_name="field value " or sub_message_name={ with a whole document made of this format. Does the regexp work on other compilers? Chris
Does the regexp work on other compilers?
Yes, I've tried with C++ Builder 6.1 with codeguard support enabled (Borland's memory checking utility), and everything passes OK with the following test program, can you verify that the program reproduces your problem, and if not provide one that does. Many thanks, John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm test code: #include <iostream> #include "boost/regex.hpp" int main(int, char**) { boost::regex abc("(\\w+)=(\\{|\"([^\\t\\n\\r\\f\"].*)\"|([^\\t\\n\\r\\f]+))|\\}|\\{"); std::string s("field_name=\"field value \" "); boost::smatch what; boost::regex_search(s, what, abc); std::cout << (std::string)what[0] << std::endl; s = "sub_message_name={"; boost::regex_search(s, what, abc); std::cout << (std::string)what[0] << std::endl; return 0; }
--- In Boost-Users@y..., "John Maddock"
Does the regexp work on other compilers?
Yes, I've tried with C++ Builder 6.1 with codeguard support enabled (Borland's memory checking utility),
It's been a few years since I last played with codegaurd, or bcb for that matter. Is the vcl still tied to delphi?
and everything passes OK with the following test program, can you verify that the program reproduces your problem, and if not provide one that does. Many thanks,
Ok I made the test and ran it giving "Illegal Instruction" as it's only output. If need be I might be able to give you access to my own solaris box (similar config) via ssh. But of course I'd rather not unless necessary :-). Looking over the output the as out of memory is a bit disturbing, I'll have a look for patches etc. Cheers, Chris
Hi John + All, The bug seems to lye with stlport. Removing it (fully, I can't have done that when I tried to) removes the problems. Something in stlport is responsible. Thanks for your patience, I'll try to figure out what is wrong with stlport. Chris
The bug seems to lye with stlport. Removing it (fully, I can't have done that when I tried to) removes the problems. Something in stlport is responsible.
Thanks for your patience, I'll try to figure out what is wrong with stlport.
Thanks for letting me know, have you tried with _STLP_DEBUG defined? Actually I'm sure you have, and I'm stating the obvious as usual :-) John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
It's been a few years since I last played with codegaurd, or bcb for that matter. Is the vcl still tied to delphi?
Yes, but you don't have to use it if you don't want to...
and everything passes OK with the following test program, can you verify that the program reproduces your problem, and if not provide one that does. Many thanks,
Ok I made the test and ran it giving "Illegal Instruction" as it's only output.
Darn, can you get a stack backtrace? What about without STLport?
If need be I might be able to give you access to my own solaris box (similar config) via ssh. But of course I'd rather not unless necessary :-).
Looking over the output the as out of memory is a bit disturbing, I'll have a look for patches etc.
Yes the regression test build failures are all down to: 1) No wide character support configured. 2) as running out of memory Maybe updating binutils would fix that? John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
When I use bjam to compile the regexp library it compiles seems happy and then no code works properly, seg faults, rubbish results etc.
When I compile using a modified make file of the shared-gcc.mak (modifications follow):
INCLUDES= -I/export/home/ctwiner/STLport-4.5.3/stlport -L/export/home/ctwiner/STLport-4.5.3/lib LIBS= -lstlport_gcc_stldebug
# compiler: CXX=g++ LINKER=g++ -shared -fPIC
# # compiler options for release build: # C1=-c -O2 -I../../../ -fPIC # # compiler options for debug build: # C2=-c -g -I../../../ -fPIC
It builds but even linking to the .so created causes a seg fault.
I know that stlport is ok because I have programs linking to the new version using std::map's vectors and strings.
I posted another message using 2.95 which had the same/similar problems. Everything seems to build fine but running causes seg faults.
The solaris version is 2.8. When using the bjam built files and trying to run the compiled regexp_tests the locale_impl.h of stlports asserts at line 60.
latest downloads of all librarys have been used.
Can you cd into boost-root/status and do a: bjam -sTOOLS=whatever regex and let me have the results? With luck it might help me narrow down the issues (remember I don't have access to the platform you are using). Thanks, John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
Can you cd into boost-root/status and do a:
bjam -sTOOLS=whatever regex
and let me have the results?
With luck it might help me narrow down the issues (remember I don't have access to the platform you are using).
Thanks John, I've sent them to your compusrve address, if you prefer I'll send them elsewhere (or post them here). I'll get started on compiling the other example. Chris
participants (3)
-
c_twiner
-
Jeff Garland
-
John Maddock