[MDEV-15156] Crash in Item_field::type_handler Created: 2018-02-01  Updated: 2020-08-25  Resolved: 2018-06-15

Status: Closed
Project: MariaDB Server
Component/s: Stored routines
Affects Version/s: 10.2.13
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Nilnandan Joshi Assignee: Alexander Barkov
Resolution: Cannot Reproduce Votes: 1
Labels: None
Environment:

RHEL



 Description   

The stack trace is:

#5  0x0000561f8fe62c68 in Item_field::type_handler (this=<optimized out>) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.2.13/sql/item.h:2832
        handler = <optimized out>
#6  0x0000561f8fe59289 in Item_splocal::fix_fields (this=0x7fb8f0043e70, thd=0x7fb8f0084c68, ref=0x0) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.2.13/sql/item.cc:1807
        item = 0x7fb8f0255078
#7  0x0000561f8fc10931 in Item_splocal::append_for_log (this=0x7fb8f0043e70, thd=0x7fb8f0084c68, str=0x7fcea417ccc0) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.2.13/sql/sp_head.cc:101
No locals.
#8  0x0000561f8fc10623 in append (p=0x7fb8f0043f10, this=<synthetic pointer>) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.2.13/sql/item.h:511
No locals.
#9  subst_spvars (thd=thd@entry=0x7fb8f0084c68, instr=instr@entry=0x7fb8f0044738, query_str=query_str@entry=0x7fb8f0044770) at /home/buildbot/buildbot/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX/mariadb-10.2.13/sql/sp_head.cc:1103

The crash is in:

  const Type_handler *type_handler() const
  {
    const Type_handler *handler= field->type_handler();
    return handler->type_handler_for_item_field();
  }

I assume that field is pointing to some wrong (deleted?) data.

This is called from:

bool Item_splocal::fix_fields(THD *thd, Item **ref)
{
  Item *item= get_item(thd->spcont);
  set_handler(item->type_handler());
  return fix_fields_from_item(thd, ref, item);
}
 
bool Item_splocal::append_for_log(THD *thd, String *str)
{
  if (fix_fields(thd, NULL))
    return true;


Generated at Thu Feb 08 08:19:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.