[TRE-general] Weird bug

Ville Laurikari ville at laurikari.net
Mon May 15 10:53:24 EEST 2006


On Mon, May 15, 2006 at 05:19:37PM +1000, skaller wrote:
> But clearly this can happen because that is precisely
> what does happen when TRE is being linked. Some symbols
> are coming from TRE and some from the C library.

Sure, but you get 100% of the symbols from libtre, i.e. you get a
consistent set of regex symbols.  Right?

> Funny thing is .. if this is supposed to be a replacement
> for GNU regex .. well it obviously cannot support dynamically
> switching the libraries around. The functions are compile time
> compatible but not link time compatible: the compiled regexp
> object of TRE is obviously smaller than the GNU one, and
> the GNU regcomp was clobbering memory.

For ABI compatibility with the system regex functions you need to
configure TRE with --enable-system-abi.  The compatibility is not
perfect.  For example, not all system regex features are available in
TRE, like some funky special regex compilation or exec flags.  So if
you have an application which relies on some features (or bugs!) of
the system regex implementation, using that application with TRE may
not work.  Luckily, applications like this are rare.

I don't remember anymore why it's no longer enabled by default (it
used to be at some point).  Probably there was some compilation
problem on some platform...  I could re-enable it for the next release
and see if people start complaining.  It works fine on all the systems
I have access to (different *BSD, Linux, AIX, Solaris, HP-UX, Irix,
Tru64, Cygwin) so it would probably be safe to turn on by default.

When TRE is built with this flag, you can do
  LD_PRELOAD=libtre.so some-program

and it will use TRE instead of the system regex functions.  The
unfortunate thing is that most programs which use regexps include the
GNU regex implementation statically linked in.  This is probably
because system regex implementations are often quite buggy.

--
http://www.iki.fi/vl/


More information about the TRE-general mailing list