SUSE Support

Here When You Need Us

HANA Database Planning Engine crashes in __strncmp_avx2_rtm+0x1b3

This document (000021026) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server for SAP Applications 15 SP4
SUSE Linux Enterprise Server for SAP Applications 15 SP3
SUSE Linux Enterprise Server 15 SP4
SUSE Linux Enterprise Server 15 SP3

Situation

The occurrence of crashes in the HANA database planning engine has been reported on several occasions. The innermost call stack has been found to be in __strncmp_avx2_rtm+0x1b3. This function is used in one of the critical processes of the dictionary build in the HANA planning engine. It is noteworthy that the occurrence of crashes is not observed under normal operating conditions, but only in the event when the strings being compared are at the end of their pages. A typical stack trace associated with such HANA Indexserver crashes is presented below:

[CRASH_EXTINFO]  Extended exception info: (2023-02-22 11:18:54 125 
Local)
----> Dump of siginfo contents <----
  signal:      11(SIGSEGV)
  code:        1(SEGV_MAPERR: address not mapped to object)
  addr:        0x00007325e2a81000
--
[CRASH_STACK]  Stacktrace of crash: (2023-02-22 11:18:54 125 Local)
----> Symbolic stack backtrace <----
  0: __strncmp_avx2_rtm + 0x1b3
         SFrame: IP: 0x00007fca76ee0193 (0x00007fca76edffe0+0x1b3) FP:
   0x00007f8fbcb78e40 SP: 0x00007f8fbcb78e38 RP: 0x00007fcaa418e3fc
         Params: 0x0, 0x1f, 0x7325e2a80f9b, 0xffffffdb, 0x0,
   0x7f8fbcb78b90
         Regs: rax=0x7ab923942580, rdx=0x7325e2a80f9b, rcx=0xffffffdb,
       rbx=0x4932ea22, rsi=0x1f, rdi=0x0, rbp=0x77dd2c241b40, r8=0x0,
       r9=0x7f8fbcb78b90, r10=0xffffffffffffffe5, r11=0x1, r12=0x7325e2a80f75,
       r13=0x27, r14=0xf146, r15=0x7f8fbcb78e90
         Module: /lib64/libc.so.6

Resolution

In the x86-64 avx2 strncmp implementation, strings are compared in chunks of 4 vector sizes (128 bytes). The fix addresses this issue by implementing an avx2 offset check condition for the strncmp function. A maintenance update has been released with a fix. Update glibc packages to the latest version or ensure the version is at the following version or higher. Following this, it is necessary to reboot the system to ensure that the changes take effect.
SUSE Versionglibc version
SLES 15 SP4glibc-2.31-150300.46.1
SLES 15 SP3glibc-2.31-150300.46.1

Cause

The HANA crash is caused by the x86-64 AVX2-based implementation of the strncmp function in the glibc used by the HANA database planning engine. When two strings being compared are at the end of their pages, __strncmp_avx2 falls back to a one-byte-at-a-time loop named "cross_page_loop". However, this loop is incorrect if the length of the comparison exactly matches VEC_SIZE*4, which is 128 on some machines. As a result, this causes crashes in the HANA database planning engine. The fix for this issue involves adding an offset check condition for strncmp function, which verifies whether the given offset has already passed after the first four vector size comparison. This issue was first introduced with commit 1457016337 in glibc version 2.28, As a result, all existing SLES15 SP3 and SLES15 SP4 glibc releases prior to glibc-2.31-150300.46.1 are impacted.

Status

Reported to Engineering

Additional Information

This defect/bug impacts solely the x86_64 CPUs that have the ability to support AVX2. Architectures other than x86_64, such as IBM POWER architecture, remain unaffected. The presence of the AVX2 extension can be checked through the following command:
# lscpu | grep avx2

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000021026
  • Creation Date: 28-Mar-2023
  • Modified Date:25-Apr-2023
    • SUSE Linux Enterprise Server
    • SUSE Linux Enterprise Server for SAP Applications

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.