/test/11.0_dbg_san/strings/ctype-ucs2.c:2604:11: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
#4 0x560ec3b8cb34 in Item::val_int_from_str(int*) /test/11.0_dbg_san/sql/item.cc:252
#5 0x560ec3b8d272 in Item::val_int_signed_typecast_from_str() /test/11.0_dbg_san/sql/item.cc:261
#6 0x560ec320996f in Type_handler_string_result::Item_val_int_signed_typecast(Item*) const /test/11.0_dbg_san/sql/sql_type.cc:5218
#7 0x560ec1abcacf in Item::val_int_signed_typecast() /test/11.0_dbg_san/sql/item.h:1472
#8 0x560ec40f12c6 in Item_func_signed::val_int() /test/11.0_dbg_san/sql/item_func.h:1330
#9 0x560ec32c61ec in Type_handler::Item_send_longlong(Item*, Protocol*, st_value*) const /test/11.0_dbg_san/sql/sql_type.cc:7488
#10 0x560ec332e1c4 in Type_handler_longlong::Item_send(Item*, Protocol*, st_value*) const /test/11.0_dbg_san/sql/sql_type.h:5760
#11 0x560ec1ab669e in Item::send(Protocol*, st_value*) /test/11.0_dbg_san/sql/item.h:1235
#12 0x560ec1c7215e in Protocol::send_result_set_row(List<Item>*) /test/11.0_dbg_san/sql/protocol.cc:1332
#13 0x560ec203be8c in select_send::send_data(List<Item>&) /test/11.0_dbg_san/sql/sql_class.cc:3102
#14 0x560ec27b2fc5 in select_result_sink::send_data_with_check(List<Item>&, st_select_lex_unit*, unsigned long long) /test/11.0_dbg_san/sql/sql_class.h:5748
#15 0x560ec27b2fc5 in JOIN::exec_inner() /test/11.0_dbg_san/sql/sql_select.cc:4761
#16 0x560ec27b9a3c in JOIN::exec() /test/11.0_dbg_san/sql/sql_select.cc:4672
#17 0x560ec27a81fa in mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*) /test/11.0_dbg_san/sql/sql_select.cc:5153
#18 0x560ec27ac655 in handle_select(THD*, LEX*, select_result*, unsigned long long) /test/11.0_dbg_san/sql/sql_select.cc:611
#19 0x560ec232be35 in execute_sqlcom_select /test/11.0_dbg_san/sql/sql_parse.cc:6267
#20 0x560ec238d190 in mysql_execute_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:3949
#21 0x560ec23bcaa8 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /test/11.0_dbg_san/sql/sql_parse.cc:7999
#22 0x560ec23cc83c in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1894
#23 0x560ec23da641 in do_command(THD*, bool) /test/11.0_dbg_san/sql/sql_parse.cc:1407
#24 0x560ec2d9e91b in do_handle_one_connection(CONNECT*, bool) /test/11.0_dbg_san/sql/sql_connect.cc:1416
#25 0x560ec2d9fe36 in handle_one_connection /test/11.0_dbg_san/sql/sql_connect.cc:1318
#26 0x152b8be94b42 in start_thread nptl/pthread_create.c:442
MDEV-28387UBSAN: runtime error: negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strtoll10 on SELECT
Closed
relates to
MDEV-28386UBSAN: runtime error: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in my_strntoull_8bit on SELECT ... OCT
Closed
MDEV-30931UBSAN: negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself in get_interval_value on SELECT
Leads to (one additional stack/UniqueID per line):
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn|Value_source::longlong_from_string_with_check
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10
Across versions/build types.
Roel Van de Paar
added a comment - - edited Four additional stacks/UniqueID's with this additional testcase:
SELECT (-1/1)/(-1/CONV(0,0, '-9223372036854775808/-1' ));
Leads to (one additional stack/UniqueID per line):
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn|Value_source::longlong_from_string_with_check
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10
Across versions/build types.
SELECTCAST(CONVERT ('-9223372036854775808' USING utf16le) AS SIGNED);
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strtoll10_mb2|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn|Item::val_int_from_str
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strtoll10_mb2|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
Roel Van de Paar
added a comment - Slightly different UniqueID/stack with:
SELECT CAST ( CONVERT ( '-9223372036854775808' USING utf16le) AS SIGNED);
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strtoll10_mb2|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn|Item::val_int_from_str
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strtoll10_mb2|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
SELECT BIN(CONVERT(-9223372036854775808 USING ucs2));
Leads to additional stacks:
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|Item_func_conv::val_str|Type_handler::Item_send_str|Protocol::send_result_set_row
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|Item_func_conv::val_str|Type_handler::Item_send_str|Type_handler_string_result::Item_send
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|charset_info_st::strntoull|Item_func_conv::val_str|Type_handler::Item_send_str
Roel Van de Paar
added a comment -
SELECT BIN( CONVERT (-9223372036854775808 USING ucs2));
Leads to additional stacks:
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|Item_func_conv::val_str|Type_handler::Item_send_str|Protocol::send_result_set_row
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|Item_func_conv::val_str|Type_handler::Item_send_str|Type_handler_string_result::Item_send
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/ctype-ucs2.c|my_strntoull_mb2_or_mb4|charset_info_st::strntoull|Item_func_conv::val_str|Type_handler::Item_send_str
People
Alexander Barkov
Roel Van de Paar
Votes:
0Vote for this issue
Watchers:
1Start watching this issue
Dates
Created:
Updated:
Resolved:
Git Integration
Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.
{"report":{"fcp":1500.6999998092651,"ttfb":406.19999980926514,"pageVisibility":"visible","entityId":121711,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"b4cec659-5f15-4b67-8688-dcb28cddcb9b","navigationType":0,"readyForUser":1719.5,"redirectCount":0,"resourceLoadedEnd":1368.5999999046326,"resourceLoadedStart":428.2999997138977,"resourceTiming":[{"duration":81.7000002861023,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":428.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":510,"responseStart":0,"secureConnectionStart":0},{"duration":221.69999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":428.59999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":428.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":650.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":504.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":428.7999997138977,"connectEnd":428.7999997138977,"connectStart":428.7999997138977,"domainLookupEnd":428.7999997138977,"domainLookupStart":428.7999997138977,"fetchStart":428.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":653,"responseEnd":933.0999999046326,"responseStart":702.0999999046326,"secureConnectionStart":428.7999997138977},{"duration":690,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":428.8999996185303,"connectEnd":428.8999996185303,"connectStart":428.8999996185303,"domainLookupEnd":428.8999996185303,"domainLookupStart":428.8999996185303,"fetchStart":428.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":653.0999999046326,"responseEnd":1118.8999996185303,"responseStart":680.2999997138977,"secureConnectionStart":428.8999996185303},{"duration":254,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":429.19999980926514,"connectEnd":429.19999980926514,"connectStart":429.19999980926514,"domainLookupEnd":429.19999980926514,"domainLookupStart":429.19999980926514,"fetchStart":429.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":653.2999997138977,"responseEnd":683.1999998092651,"responseStart":681.7999997138977,"secureConnectionStart":429.19999980926514},{"duration":253.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":429.2999997138977,"connectEnd":429.2999997138977,"connectStart":429.2999997138977,"domainLookupEnd":429.2999997138977,"domainLookupStart":429.2999997138977,"fetchStart":429.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":653.2999997138977,"responseEnd":683.0999999046326,"responseStart":681.2999997138977,"secureConnectionStart":429.2999997138977},{"duration":277.19999980926514,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":429.5,"connectEnd":429.5,"connectStart":429.5,"domainLookupEnd":429.5,"domainLookupStart":429.5,"fetchStart":429.5,"redirectEnd":0,"redirectStart":0,"requestStart":653.5,"responseEnd":706.6999998092651,"responseStart":705.2999997138977,"secureConnectionStart":429.5},{"duration":222,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":429.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":429.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":651.6999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":282.09999990463257,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":430,"connectEnd":430,"connectStart":430,"domainLookupEnd":430,"domainLookupStart":430,"fetchStart":430,"redirectEnd":0,"redirectStart":0,"requestStart":677.8999996185303,"responseEnd":712.0999999046326,"responseStart":710.5,"secureConnectionStart":430},{"duration":243,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":430.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":430.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":673.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":285.30000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":430.2999997138977,"connectEnd":430.2999997138977,"connectStart":430.2999997138977,"domainLookupEnd":430.2999997138977,"domainLookupStart":430.2999997138977,"fetchStart":430.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":679.0999999046326,"responseEnd":715.5999999046326,"responseStart":708.1999998092651,"secureConnectionStart":430.2999997138977},{"duration":688.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":431.3999996185303,"connectEnd":431.3999996185303,"connectStart":431.3999996185303,"domainLookupEnd":431.3999996185303,"domainLookupStart":431.3999996185303,"fetchStart":431.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1032.2999997138977,"responseEnd":1119.8999996185303,"responseStart":1115.7999997138977,"secureConnectionStart":431.3999996185303},{"duration":937.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":431.5,"connectEnd":431.5,"connectStart":431.5,"domainLookupEnd":431.5,"domainLookupStart":431.5,"fetchStart":431.5,"redirectEnd":0,"redirectStart":0,"requestStart":1356.8999996185303,"responseEnd":1368.5999999046326,"responseStart":1368.0999999046326,"secureConnectionStart":431.5},{"duration":276.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1144.5,"connectEnd":1144.5,"connectStart":1144.5,"domainLookupEnd":1144.5,"domainLookupStart":1144.5,"fetchStart":1144.5,"redirectEnd":0,"redirectStart":0,"requestStart":1388.5999999046326,"responseEnd":1421,"responseStart":1420.1999998092651,"secureConnectionStart":1144.5}],"fetchStart":0,"domainLookupStart":149,"domainLookupEnd":159,"connectStart":159,"connectEnd":180,"secureConnectionStart":168,"requestStart":180,"responseStart":407,"responseEnd":414,"domLoading":426,"domInteractive":1885,"domContentLoadedEventStart":1885,"domContentLoadedEventEnd":1971,"domComplete":3103,"loadEventStart":3103,"loadEventEnd":3103,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1799},{"name":"bigPipe.sidebar-id.end","time":1800},{"name":"bigPipe.activity-panel-pipe-id.start","time":1800.0999999046326},{"name":"bigPipe.activity-panel-pipe-id.end","time":1802.3999996185303},{"name":"activityTabFullyLoaded","time":1991.8999996185303}],"measures":[],"correlationId":"c78fe5d1373af8","effectiveType":"4g","downlink":9.5,"rtt":0,"serverDuration":108,"dbReadsTimeInMs":15,"dbConnsTimeInMs":25,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Four additional stacks/UniqueID's with this additional testcase:
Leads to (one additional stack/UniqueID per line):
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn|Value_source::longlong_from_string_with_check
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|Value_source::Converter_strtoll10::Converter_strtoll10|Value_source::Converter_strtoll10_with_warn::Converter_strtoll10_with_warn
UBSAN|negation of -X cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself|strings/my_strtoll10.c|my_strtoll10|my_strtoll10_8bit|charset_info_st::strtoll10|Value_source::Converter_strtoll10::Converter_strtoll10
Across versions/build types.