Bug #90609 runtime error: call to function myfunc_int through pointer to incorrect function
Submitted: 24 Apr 2018 14:52 Modified: 25 Apr 2018 13:08
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.13 OS:Any
Assigned to: CPU Architecture:Any

[24 Apr 2018 14:52] Tor Didriksen
Description:
sql/sql_udf.h:108:20: runtime error: call to function myfunc_int through pointer to incorrect function type 'long long (*)(UDF_INIT *, UDF_ARGS *, unsigned char *, unsigned char *)'
sql/udf_example.cc:530: note: myfunc_int defined here
    #0 0x5ab704d in udf_handler::val_int(bool*) sql/sql_udf.h:108:20
    #1 0x5a3161a in Item_func_udf_int::val_int() sql/item_func.cc:3878:3

How to repeat:
build with clang/ubsan

./mtr --mem --sanitize 
./mtr --mem --sanitize --suite=service_udf_registration

Suggested fix:
Fix function signatures, remove C-style function-pointer casts (except for Udf_func_any)
[25 Apr 2018 13:08] Paul DuBois
Posted by developer:
 
Fixed in 8.0.13.

A runtime error could occur for calls to myfunc_int().