X-Spam-Check-By: sourceware.org Message-Id: <1165851287.32453.279885173@webmail.messagingengine.com> From: "Charles Wilson" To: cygwin AT cygwin DOT com Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="ISO-8859-1" MIME-Version: 1.0 X-Mailer: MessagingEngine.com Webmail Interface Subject: pcre, C++ Date: Mon, 11 Dec 2006 10:34:47 -0500 Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com In version 6.0, the (upstream) pcre maintainer added a C++ wrapper contributed by Google. However, in pcre-6.7 (and going back all the way to 6.0), I can find no case where the C++ unittests pcre_scanner_unittest or pcrecpp_unittest actually pass; they always segfault on cygwin (gcc/g++ 3.4.4-1, binutils 20060817-1) [and also mingw]. A little digging shows that the problem occurs in pcrepp.cc (RE::Init): void RE::Init(const char* pat, const RE_Options* options) { pattern_ = pat; <<< HERE where std::string pattern_, a member of class RE, is assigned the const char* pat -- and pat is NOT null (verified in gdb) (it is a valid, null-terminated regex string). This is certainly a legal thing to do, as std::string has a operator=(const char*). But for some reason, it fails here. I think that somehow this code is tickling a g++/stdlibc++ bug, but my gdb-foo is not sufficient to figure it out. I tried recompiling with -O0, but (a) the test progs still failed, and (b) there was no additional enlightenment under gdb. [Note: pcrecpp works fine on linux[gcc]/solaris[Sun Workshop 8.0]/irix[MIPS-Pro], at least as tested by pcre_scanner_unittest and pcrecpp_unittest] Has anyone else observed this failure on cygwin with pcrecpp? Anybody got a clue what's really going on here? -- Chuck -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/