Re: Regexp datablade problem
Posted in 2006
Doug Conrey wrote:
> This looks like a very useful tool, but I can?t get the darn thing
> working against IDS 10.0.FC4 on AIX 5.3.
>
> The first problem I had was compiling errors related to strchr ?
> apparently on AIX the compiler wants to use a macro for strchr, so the
> declaration ?extern char *strchr();? caused the compiler to produce this:
>
>
>
> "c/regexp.c", line 715.29: 1506-041 (E) The invocation of macro strchr
> contains fewer arguments than required by the macro definition.
>
> "c/regexp.c", line 715.22: 1506-275 (S) Unexpected text ',' encountered.
>
>
>
> I couldn?t find much about this, but given that the compiler is using
> macros I figured I could comment out the declaration. If I do that it
> will compile and link without errors.
>
> I then copy the files around, create the new VPCLASS and register the
> blade in my test database as per the instructions. All of these things
> work without errors as well. Unfortunately when I try to use the
> regexp_match(lvarchar, lvarchar) function the engine crashes with an
> assertion failure (no exception handler). I turned tracing on and it
> looks like the regexp function is returning successfully ? the trace
> message immediately before the return executes, and even indicates that
> it has the correct return value. According to the AF file the thread
> causing the problem is my sqlexec thread, executing in the 0th cpu vp. I
> don?t see much else of use in there.
>
> I started playing around with the code a little to see if I could
> prevent this by returning before it called various things. It looks like
> if the code gets into the regcomp function (in regexp.c) it dies, even
> if I return immediately after the variable declarations in that function.
>
>
>
> As a note, I also tried compiling this with gcc. If I do that the engine
> crashes with a number of these:
>
>
>
> rtld: 0712-001 Symbol memcpy was referenced
>
> from module /usr/informix/extend/regexp.1.0/regexp.bld(), but a
> runtime definition
>
> of the symbol was not found.
>
>
>
> Then I tried compiling with the ?bstatic flag, and got something new:
>
>
>
> 14:52:32 Fatal error in ADM VP at mt.c:12516
>
> 14:52:32 Unexpected virtual processor termination, pid = 209262, exit => 0x100
>
>
>
> I?m pretty much out of ideas, but this would be such a handy tool I?m
> hoping someone has a solution. Thanks.
>
>
>
> DC
>
my guess would go as follows - on solaris memcpy and friends are declared in
string.h, but on aix they are in memory.h. What is probably happening is that
the compiler, having not found the prototypes, deems one of said functions
(not memcpy) to be returning an integer, and truncates the pointer. from then
on, a segv is just round the corner. try
#include <memory.h>
at the beginning of the blade
also, since you building a blade for a 64 bit engine, I trust that you are
doing a cc -q64 -G ... if not, you would be mixing and matching 32 and 64 bit
pointers
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Structured Query Scripting Language http://www.4glworks.com/sqsl.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm