I'm trying to do something very simple and yet...
In IUS 9.12.UC2 I am creating a function thusly:
create function total (val1 integer, num1 float)
returning float; external name '/dir/IUSfuncs.so(IUSfuncs_total)'
language c
end function;
My c function is pretty boneheaded:
double IUSfuncs_total (long val1, double num1)
{
return (val1 * num1);
}
After compiling as a shared object, I try to run the following statement
in dbaccess:
select total(quantity, price) from table;
And I get the error in the log:
13:42:06 Loading Module </dir/IUSfuncs.so>
13:42:06 C Language Module </dir/IUSfuncs.so> loaded
13:42:06 Assert Failed: Exception Caught. Type: MT_EX_OS, Context: mem
13:42:06 INFORMIX-Universal Server Version 9.12.UC2
13:42:06 Who: Session(1196, jgc@webser11, 10107, 0)
Thread(1929, sqlexec, 0, 0)
File: mtex.c Line: 183
13:42:06 Action: Please notify Informix Technical Support.
13:42:08 Blocking whole system for max 0 secs
13:42:08 VP 1 timed out during system block, releasing
13:42:08 Releasing VP 3 from system block
13:42:08 Releasing VP 7 from system block
13:42:08 Releasing VP 6 from system block
13:42:08 Releasing VP 8 from system block
13:42:08 Releasing VP 5 from system block
13:42:08 Releasing VP 4 from system block
13:42:23 See Also: /tmp/af.789a9fe, shmem.789a9fe.0
13:42:39 (-9791): ERROR: Routine execution trap -- procname=<total>
procid=142 reason: Bad UDR return pointer
I love the incredibly informative error message, Bad UDR return
pointer? I have found the documentation to be of no help. I have tried
numerous different options, such as changing the C datatypes, changing
to pointers, but nothing gets me away from this same error. What is the
ten-second step that I am missing?