[llvm-bugs] [Bug 42663] New: /lib64/libclangFrontend.so(+0x8401c)[0x555e67c01c] free(): invalid pointer: 0x0000005561711800

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Jul 18 03:10:04 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42663

            Bug ID: 42663
           Summary: /lib64/libclangFrontend.so(+0x8401c)[0x555e67c01c]
                    free(): invalid pointer: 0x0000005561711800
           Product: clang
           Version: 3.8
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: shi1986000 at 126.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 22255
  --> https://bugs.llvm.org/attachment.cgi?id=22255&action=edit
OpenCL Programming Guide - Chapter 2 Exercise Code

Recently, I'm learnning the OpenCL Programming Guide adn use clang+llvm3.8.1 to
compile the exercise code in Chapter 2 of the book. During the execution of the
program, I encountered a serious bug about clang.

My Error info:
***********************************************************************************
[root at localhost HelloWorld]# ./HelloWorld
*** Error in `./HelloWorld': free(): invalid pointer: 0x0000005562f65800 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x9f854)[0x555fb1b854]
/lib64/libc.so.6(__libc_free+0x804)[0x555fb2c22c]
/lib64/libstdc++.so.6(_ZdlPv+0x20)[0x555f8128f0]
/lib64/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x20)[0x555f8a8298]
/lib64/libclangFrontend.so(+0x8401c)[0x555fed001c]
======= Memory map: ========
120000000-120004000 r-xp 00000000 08:02 4719230                         
/root/TarAll/src/Chapter_2/HelloWorld/HelloWorld
120010000-120014000 r--p 00000000 08:02 4719230                         
/root/TarAll/src/Chapter_2/HelloWorld/HelloWorld
120014000-120018000 rw-p 00004000 08:02 4719230                         
/root/TarAll/src/Chapter_2/HelloWorld/HelloWorld
123604000-1236c8000 rwxp 00000000 00:00 0                                [heap]
555f730000-555f758000 r-xp 00000000 08:02 4863976                       
/usr/lib64/ld-2.20.so
555f758000-555f764000 rw-p 00000000 00:00 0
555f764000-555f768000 rw-p 00024000 08:02 4863976                       
/usr/lib64/ld-2.20.so
555f784000-555f7a0000 r-xp 00000000 08:02 4863583                       
/usr/lib64/libOpenCL.so.1.0.0
555f7a0000-555f7ac000 ---p 0001c000 08:02 4863583                       
/usr/lib64/libOpenCL.so.1.0.0
555f7ac000-555f7b0000 rw-p 00018000 08:02 4863583                       
/usr/lib64/libOpenCL.so.1.0.0
555f7b0000-555f8e8000 r-xp 00000000 08:02 4862493                       
/usr/lib64/libstdc++.so.6.0.20
555f8e8000-555f8f4000 ---p 00138000 08:02 4862493                       
/usr/lib64/libstdc++.so.6.0.20
555f8f4000-555f900000 r--p 00134000 08:02 4862493                       
/usr/lib64/libstdc++.so.6.0.20
555f900000-555f908000 rw-p 00140000 08:02 4862493                       
/usr/lib64/libstdc++.so.6.0.20
.... ..... 
***********************************************************************************

My platform info
***********************************************************************************
architecture info:
[root at localhost HelloWorld]# uname -a
Linux localhost 3.10.84-21.fc21.loongson.18.mips64el #1 SMP PREEMPT Tue Apr 16
18:41:34 CST 2019 mips64 mips64 mips64 GNU/Linux

[root at localhost HelloWorld]# lscpu
Architecture:          mips64
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Model name:            ICT Loongson-3A R3 (Loongson-3A3000) @ 1399MHz
CPU max MHz:           1399.9860
CPU min MHz:           349.9960
NUMA node0 CPU(s):     0-3
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
rpm packages info:
[root at localhost HelloWorld]# rpm -qa | grep llvm
llvm-devel-3.8.1-3.fc21.loongson.2.mips64el
llvm-static-3.8.1-3.fc21.loongson.2.mips64el
llvm-libs-3.8.1-3.fc21.loongson.2.mips64el
llvm-3.8.1-3.fc21.loongson.2.mips64el
llvm-debuginfo-3.8.1-3.fc21.loongson.2.mips64el

[root at localhost HelloWorld]# rpm -qa | grep clang
clang-libs-3.8.1-1.fc21.loongson.2.mips64el
clang-devel-3.8.1-1.fc21.loongson.2.mips64el
clang-analyzer-3.8.1-1.fc21.loongson.2.noarch
clang-debuginfo-3.8.1-1.fc21.loongson.2.mips64el
clang-3.8.1-1.fc21.loongson.2.mips64el

[root at localhost HelloWorld]# rpm -qa | grep libclc
libclc-0.0.1-11.20150918git4346c30.fc21.loongson.mips64el
libclc-devel-0.0.1-11.20150918git4346c30.fc21.loongson.mips64el

[root at localhost HelloWorld]# rpm -qa | grep libOpenCL
mesa-libOpenCL-11.1.0-5.20151218.fc21.loongson.6.mips64el
mesa-libOpenCL-devel-11.1.0-5.20151218.fc21.loongson.6.mips64el

***********************************************************************************
other info:
[root at localhost HelloWorld]# llc -version
LLVM (http://llvm.org/):
  LLVM version 3.8.1
  Optimized build.
  Built Jul  8 2019 (07:52:07).
  Default target: mips64el-redhat-linux
  Host CPU: (unknown)

  Registered Targets:
    amdgcn   - AMD GCN GPUs
    bpf      - BPF (host endian)
    bpfeb    - BPF (big endian)
    bpfel    - BPF (little endian)
    cpp      - C++ backend
    mips     - Mips
    mips64   - Mips64 [experimental]
    mips64el - Mips64el [experimental]
    mipsel   - Mipsel
    nvptx    - NVIDIA PTX 32-bit
    nvptx64  - NVIDIA PTX 64-bit
    r600     - AMD GPUs HD2XXX-HD6XXX
    systemz  - SystemZ

[root at localhost HelloWorld]# llc -version
LLVM (http://llvm.org/):
  LLVM version 3.8.1
  Optimized build.
  Built Jul  8 2019 (07:52:07).
  Default target: mips64el-redhat-linux
  Host CPU: (unknown)

  Registered Targets:
    amdgcn   - AMD GCN GPUs
    bpf      - BPF (host endian)
    bpfeb    - BPF (big endian)
    bpfel    - BPF (little endian)
    cpp      - C++ backend
    mips     - Mips
    mips64   - Mips64 [experimental]
    mips64el - Mips64el [experimental]
    mipsel   - Mipsel
    nvptx    - NVIDIA PTX 32-bit
    nvptx64  - NVIDIA PTX 64-bit
    r600     - AMD GPUs HD2XXX-HD6XXX
    systemz  - SystemZ
[root at localhost HelloWorld]# clinfo
Number of platforms                               1
  Platform Name                                   Clover
  Platform Vendor                                 Mesa
  Platform Version                                OpenCL 1.1 MESA 11.1.0
  Platform Profile                                FULL_PROFILE
  Platform Extensions                             cl_khr_icd
  Platform Extensions function suffix             MESA

  Platform Name                                   Clover
Number of devices                                 1
  Device Name                                     AMD CAICOS (DRM 2.49.0, LLVM
3.8.1)
  Device Vendor                                   AMD
  Device Vendor ID                                0x1002
  Device Version                                  OpenCL 1.1 MESA 11.1.0
  Driver Version                                  11.1.0
  Device OpenCL C Version                         OpenCL C 1.1
  Device Type                                     GPU
  Device Profile                                  FULL_PROFILE
  Max compute units                               2
  Max clock frequency                             775MHz
  Max work item dimensions                        3
  Max work item sizes                             256x256x256
  Max work group size                             256
  Preferred work group size multiple              64
  Preferred / native vector sizes
    char                                                16 / 16
    short                                                8 / 8
    int                                                  4 / 4
    long                                                 2 / 2
    half                                                 0 / 0        (n/a)
    float                                                4 / 4
    double                                               0 / 0        (n/a)
  Half-precision Floating-point support           (n/a)
  Single-precision Floating-point support         (core)
    Denormals                                     No
    Infinity and NANs                             Yes
    Round to nearest                              Yes
    Round to zero                                 No
    Round to infinity                             No
    IEEE754-2008 fused multiply-add               No
    Support is emulated in software               No
    Correctly-rounded divide and sqrt operations  No
  Double-precision Floating-point support         (n/a)
  Address bits                                    32, Little-Endian
  Global memory size                              1073741824 (1024MiB)
  Error Correction support                        No
  Max memory allocation                           268435456 (256MiB)
  Unified memory for Host and Device              Yes
  Minimum alignment for any data type             128 bytes
  Alignment of base address                       1024 bits (128 bytes)
  Global Memory cache type                        None
  Image support                                   No
  Local memory type                               Local
  Local memory size                               32768 (32KiB)
  Max constant buffer size                        268435456 (256MiB)
  Max number of constant args                     13
  Max size of kernel argument                     1024
  Queue properties
    Out-of-order execution                        No
    Profiling                                     Yes
  Profiling timer resolution                      0ns
  Execution capabilities
    Run OpenCL kernels                            Yes
    Run native kernels                            No
  Device Available                                Yes
  Compiler Available                              Yes
  Device Extensions                              
cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics
cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics
cl_khr_byte_addressable_store

NULL platform behavior
  clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
  clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Success [MESA]
  clCreateContext(NULL, ...) [default]            Success [MESA]
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD CAICOS (DRM 2.49.0, LLVM
3.8.1)
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found
in platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in
platform
  clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  Success (1)
    Platform Name                                 Clover
    Device Name                                   AMD CAICOS (DRM 2.49.0, LLVM
3.8.1)

ICD loader properties
  ICD loader Name                                 OpenCL ICD Loader
  ICD loader Vendor                               OCL Icd free software
  ICD loader Version                              2.2.7
  ICD loader Profile                              OpenCL 1.2

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190718/be8ac2ea/attachment-0001.html>


More information about the llvm-bugs mailing list