oneflow icon indicating copy to clipboard operation
oneflow copied to clipboard

Aborted (core dumped) in `flow.empty`

Open Daisy2ang opened this issue 1 year ago • 0 comments

Summary

When calling flow.empty(), an invalid dimension value is passed, causing a dimension mismatch check to fail, resulting in a crash and a core dump. This occurs with both negative and excessively large dimension values.

Code to reproduce bug

import oneflow as flow
y = flow.empty(-1)
print(y)

output:

F20250701 00:23:47.846668 33098 util.h:44] Check failed: src_dims_or_strides[i] == dst_dims_or_strides[i] (-1 vs. 1) 
*** Check failure stack trace: ***
    @     0x7fd77cfd09ca  google::LogMessage::Fail()
    @     0x7fd77cfd0cb2  google::LogMessage::SendToLog()
    @     0x7fd77cfd0537  google::LogMessage::Flush()
    @     0x7fd77cfd30a9  google::LogMessageFatal::~LogMessageFatal()
    @     0x7fd772a9b2b3  oneflow::ep::primitive::CheckInplace()
    @     0x7fd772aa52a0  _ZZN7oneflow2ep9primitive28broadcast_elementwise_binary12_GLOBAL__N_136OneDnnBroadcastElementwiseBinaryImplIfLN4dnnl9algorithmE131067ELNS5_6memory9data_typeE3ELS8_6EE6LaunchEPNS0_6StreamEmPKlPKvmSD_SF_PvENKUlPNS5_6engineEPNS5_6streamEE_clESI_SK_
    @     0x7fd772aa571b  oneflow::ep::primitive::broadcast_elementwise_binary::(anonymous namespace)::OneDnnBroadcastElementwiseBinaryImpl<>::Launch()
    @     0x7fd778bb9160  oneflow::(anonymous namespace)::ScalarLogicalKernel<>::Compute()
    @     0x7fd778d4e54d  oneflow::one::StatefulOpKernel::Compute()
    @     0x7fd776fe8cab  oneflow::vm::OpCallInstructionUtil::Compute()
    @     0x7fd776fe6787  oneflow::vm::OpCallInstructionPolicy::Compute()
    @     0x7fd776fe25bc  oneflow::vm::Instruction::Compute()
    @     0x7fd776fe0a6f  oneflow::vm::EpStreamPolicyBase::Run()
    @     0x7fd776fec086  oneflow::vm::StreamPolicy::RunIf()
    @     0x7fd776ff36de  oneflow::vm::ThreadCtx::TryReceiveAndRun()
    @     0x7fd776ff5d18  oneflow::(anonymous namespace)::WorkerLoop()
    @     0x7fd776ff611f  _ZNSt6thread11_State_implINS_8_InvokerISt5tupleIJPFvPN7oneflow2vm9ThreadCtxERKSt8functionIFvS6_EEES6_ZNS3_14VirtualMachine15CreateThreadCtxENS3_6SymbolINS3_6DeviceEEENS3_10StreamTypeEmEUlS6_E3_EEEEE6_M_runEv
    @     0x7fd77cfe540f  execute_native_thread_routine
    @     0x7fd864190ac3  (unknown)
    @     0x7fd864222850  (unknown)
Aborted (core dumped)

System Information

  • What is your OneFlow installation (pip, source, dockerhub): pip
  • OS: Ubuntu 22.04.5 LTS
  • OneFlow version (run python3 -m oneflow --doctor): path: ['/root/anaconda3/envs/oneflow1.0.0/lib/python3.10/site-packages/oneflow'] version: 0.9.0 git_commit: https://github.com/Oneflow-Inc/oneflow/commit/381b12cb083a1cf0ad2376dae047f058f26ad284 cmake_build_type: Release rdma: True mlir: True
  • Python version: 3.10.0
  • CUDA driver version: 12.2
  • GPU models: NVIDIA GeForce RTX 4090
  • Other info: None

Daisy2ang avatar Jun 30 '25 15:06 Daisy2ang