[llvm-bugs] [Bug 50915] New: KaleidoscopeJIT crash on initialization

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jun 27 13:00:00 PDT 2021


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

            Bug ID: 50915
           Summary: KaleidoscopeJIT crash on initialization
           Product: libraries
           Version: 10.0
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: OrcJIT
          Assignee: unassignedbugs at nondot.org
          Reporter: kacpero376 at gmail.com
                CC: 1101.debian at gmail.com, llvm-bugs at lists.llvm.org

What steps will reproduce the problem?
1. create a basic CMake project and include all the necessary llvm components
2. include KaleidoscopeJIT.h from
examples/Kaleidoscope/include/KaleidoscopeJIT.h in main file
3. initialise the llvm::orc::KaleidoscopeJIT class
4. print a message before the initialisation and after initialisation  

What is the expected output?
============================

No crash is expected, the message before and after should be printed.

Output:
hello there 1
hello there 2


What do you see instead?
========================

Message before the initialisation appears in console however the message after
is not present and the program stops. 

Output:
hello there 1


What version of the product are you using? On what operating system?
====================================================================

LLVM 10.0.1 on Windows 10 (latest update)


Please provide any additional information below.
================================================

example program for bug reproduction:
test.cxx

#include "path_to_examples/KaleidoscopeJIT.h"
#include <memory>
#include <iostream>

int main(){

    std::cout << "hello there 1" << std::endl;

    // both the version with unique_ptr and without cause the crash...
    std::unique_ptr<llvm::orc::KaleidoscopeJIT> JIT =
std::make_unique<llvm::orc::KaleidoscopeJIT>();
    // llvm::orc::KaleidoscopeJIT JIT = llvm::orc::KaleidoscopeJIT();

    std::cout << "hello there 2" << std::endl;

    return 0;
}

basic CMake configuration:

cmake_minimum_required(VERSION 3.10)

# set the project name
project(testproject VERSION 1.0)

# specify the C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# LLVM
find_package(LLVM REQUIRED CONFIG)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

add_definitions(${LLVM_DEFINITIONS})

add_executable(test1 test.cxx)

llvm_map_components_to_libnames(llvm_libs 
    core executionengine target orcjit support irreader 
        )
target_link_libraries(test1 PUBLIC "${llvm_libs}")

target_include_directories(test1 PUBLIC "${LLVM_INCLUDE_DIRS}")

-- 
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/20210627/bb8dc562/attachment.html>


More information about the llvm-bugs mailing list