daphne-eu / daphne

DAPHNE: An Open and Extensible System Infrastructure for Integrated Data Analysis Pipelines
Apache License 2.0
67 stars 62 forks source link

ErrorHandler segfaults when provided a mlir::FusedLoc #875

Open philipportner opened 4 weeks ago

philipportner commented 4 weeks ago

See #874 , part of the stack trace from there:

#0  0x00000000020f3293 in mlir::FileLineColLoc::getFilename() const ()
#1  0x000000000162bda9 in ErrorHandler::compilerError(mlir::Location, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#2  0x000000000162c5fd in ErrorHandler::compilerError(mlir::Operation*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#3  0x00000000016a0235 in VectorizedPipelineOpLowering::matchAndRewrite(mlir::daphne::VectorizedPipelineOp, mlir::daphne::VectorizedPipelineOpAdaptor, mlir::ConversionPatternRewriter&) const ()
#4  0x0000000001688273 in mlir::OpConversionPattern<mlir::daphne::VectorizedPipelineOp>::matchAndRewrite(mlir::Operation*, llvm::ArrayRef<mlir::Value>, mlir::ConversionPatternRewriter&) const ()

The stack trace displays what happens when the ErrorHandler is passed an instance of mlir::FusedLoc, instead of an instance of mlir::FileLineColLoc as it casts the provided loc without any checks.