Skip to content

Segmentation fault (core dumped) with a minimal example #6

@Tokubara

Description

@Tokubara

On commit 91c97f0 (latest), I created examples/benchmarks/playground.py with the following content:

import hecate as hc
import sys
import numpy as np
@hc.func("c")
def playground (cin) :
  return cin*cin
modName = hc.save("traced", "traced")
print (modName)

Steps to reproduce:

source .venv/bin/activate
source config.sh
hc-trace playground
hbt dacapo 40 playground SEAL CPU

The execution results in a segmentation fault:

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/user/Playground/dacapo/build/bin/hecate-opt --dacapo --ckks-config=/home/user/Playground/dacapo/profiled_SEAL_CPU.json --waterline=40 --enable-debug-printer /home/user/Playground/dacapo/examples/traced/playground.mlir --mlir-print-debuginfo --mlir-pretty-debuginfo --mlir-p
rint-local-scope --mlir-disable-threading --mlir-timing --mlir-print-ir-after-failure -o /home/user/Playground/dacapo/examples/optimized/dacapo/playground.40.mlir
 #0 0x000055647c843492 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x7f9492)
 #1 0x000055647c840b9b SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f91f4019520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x000055647c68dd0c mlir::IntegerAttr::getInt() const (/home/user/Playground/dacapo/build/bin/hecate-opt+0x643d0c)
 #4 0x000055647c127dc0 (anonymous namespace)::DaCapoPlannerPass::runOnOperation() DaCapoPlanner.cpp:0:0
 #5 0x000055647c5f887e mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5ae87e)
 #6 0x000055647c5f8ff9 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5aeff9)
 #7 0x000055647c5f95ec mlir::detail::OpToOpPassAdaptor::runOnOperationImpl(bool) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5af5ec)
 #8 0x000055647c5f8bb5 mlir::detail::OpToOpPassAdaptor::run(mlir::Pass*, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5aebb5)
 #9 0x000055647c5f8ff9 mlir::detail::OpToOpPassAdaptor::runPipeline(mlir::OpPassManager&, mlir::Operation*, mlir::AnalysisManager, bool, unsigned int, mlir::PassInstrumentor*, mlir::PassInstrumentation::PipelineParentInfo const*) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5aeff9)
#10 0x000055647c5fa2bb mlir::PassManager::run(mlir::Operation*) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x5b02bb)
#11 0x000055647c0b3203 performActions(llvm::raw_ostream&, std::shared_ptr<llvm::SourceMgr> const&, mlir::MLIRContext*, mlir::MlirOptMainConfig const&) MlirOptMain.cpp:0:0
#12 0x000055647c0b4d53 processBuffer(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::MlirOptMainConfig const&, mlir::DialectRegistry&, llvm::ThreadPool*) MlirOptMain.cpp:0:0
#13 0x000055647c0b4e9c mlir::LogicalResult llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>::callback_fn<mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&)::'lambda'(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>(long, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&) MlirOptMain.cpp:0:0
#14 0x000055647c77e2d8 mlir::splitAndProcessBuffer(std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::function_ref<mlir::LogicalResult (std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, llvm::raw_ostream&)>, llvm::raw_ostream&, bool, bool) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x7342d8)
#15 0x000055647c0b0384 mlir::MlirOptMain(llvm::raw_ostream&, std::unique_ptr<llvm::MemoryBuffer, std::default_delete<llvm::MemoryBuffer>>, mlir::DialectRegistry&, mlir::MlirOptMainConfig const&) (/home/user/Playground/dacapo/build/bin/hecate-opt+0x66384)
#16 0x000055647c0a04ec main (/home/user/Playground/dacapo/build/bin/hecate-opt+0x564ec)
#17 0x00007f91f4000d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#18 0x00007f91f4000e40 call_init ./csu/../csu/libc-start.c:128:20
#19 0x00007f91f4000e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#20 0x000055647c09f8d5 _start (/home/user/Playground/dacapo/build/bin/hecate-opt+0x558d5)
Segmentation fault (core dumped)

What might be wrong with this minimal example, and how can I prevent the segmentation fault?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions