2 messages in com.mysql.lists.bugsUDF In 4.1| From | Sent On | Attachments |
|---|---|---|
| Schulman, Michael | 11 Dec 2003 15:29 | |
| Jani Tolonen | 13 Dec 2003 04:07 |
| Subject: | UDF In 4.1![]() |
|---|---|
| From: | Schulman, Michael (mich...@lehman.com) |
| Date: | 12/11/2003 03:29:33 PM |
| List: | com.mysql.lists.bugs |
I'm trying to create a Aggregate UDF. Everything works fine except for the error handling. I return 1 from the init function and mysqld crashes with a signal 11. Here is the code :
my_bool xopen_init( UDF_INIT* initid, UDF_ARGS* args, char* message ) { fprintf(stderr ,"INIT \n"); if (args->arg_count != 1) { fprintf(stderr ,"INIT BAD ARG COUNT\n"); strcpy( message, "wrong number of arguments: XOPEN() requires one arguments"); fprintf(stderr, "wrong number of arguments: XOPEN() requires one arguments\n"); return 1; } fprintf(stderr ,"INIT 2\n"); if ((args->arg_type[0] != INT_RESULT) && (args->arg_type[0] != REAL_RESULT) ) { fprintf(stderr ,"INIT BAD ARGS\n"); strcpy(message, "wrong argument type: XOPEN() requires an INT or a REAL" ); fprintf(stderr, "wrong argument type: XOPEN() requires an INT or a REAL\n" ); return 1; } initid->maybe_null = 1; // The result may be null initid->max_length = 20; // 6 digits + . + 10 decimals initid->ptr = (char*)NULL; fprintf(stderr ,"INIT 4\n"); return 0; }
It runs fine when I pass in one int or real data type but as soon as I pass in a string or two variables it crashes...
Here is the output from the error file :
INIT INIT BAD ARG COUNT wrong number of arguments: XOPEN() requires one arguments mysqld got signal 11; This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured. This error can also be caused by malfunctioning hardware. We will try our best to scrape up some info that will hopefully help diagnose the problem, but since we have already crashed, something is definitely wrong and this may fail.
key_buffer_size=8388600 read_buffer_size=131072 sort_buffer_size=2097144 max_used_connections=0 max_connections=100 threads_connected=1 It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_connections = 225791 K bytes of memory Hope that's ok; if not, decrease some variables in the equation.
thd=0x8831568 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... Cannot determine thread, fp=0xbe7fe7b8, backtrace may not be correct. Stack range sanity check OK, backtrace follows: 0x811e625 0x4002258b 0x40219680 0x401e9c68 0x40205ef3 0x82d42bd 0x80d8db5 0x80d4a71 0x81471e9 0x814bb14 0x814e6f0 0x814b8f2 0x812d287 0x8130720 0x812b8ea 0x812b299 0x812a949 0x4001efdf 0x4028199a New value of fp=(nil) failed sanity check, terminating stack trace! Please read http://www.mysql.com/doc/en/Using_stack_trace.html <http://www.mysql.com/doc/en/Using_stack_trace.html> and follow instructions on how to resolve the stack trace. Resolved stack trace is much more helpful in diagnosing the problem, so please do resolve it Trying to get some variables. Some pointers may be invalid and cause the dump to abort... thd->query at 0x8832270 = select xopen(b,c) from t thd->thread_id=1
Successfully dumped variables, if you ran with --log, take a look at the details of what thread 1 did to cause the crash. In some cases of really bad corruption, the values shown above may be invalid.
The manual page at http://www.mysql.com/doc/C/r/Crashing.html <http://www.mysql.com/doc/C/r/Crashing.html> contains information that should help you find out what is causing the crash.
Number of processes running now: 0 031211 18:15:34 mysqld restarted
Any help would be greatly appreciated, Thanks, Mike
------------------------------------------------------------------------------ This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.




