dmlc / dmlc/decord

pytest crashes when I import "from decord import VideoReader"

Open
#274 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
232
PR merge metrics
No merged PRs in 30d

Description

[strace.zip](https://github.com/dmlc/decord/files/12340584/strace.zip)

I tried for hours to create simple repro, but my python project is too complex and could not figure out the magic ingredients that would make it do this, so I included an strace instead. But my project uses the following dependencies.

The interesting thing is I would get an abort with just "pytest --help", so it didn't even need to run any of my tests. I hope this helps narrow it down. The other interesting thing is that if I moved the `from decord import VideoReader` so it is not at the top of the python file but instead it is inside the function that needs to use the VideoReader, then pytest no longer crashes, even the test that uses this code passes. Very weird.

Also this crash only happens on Ubuntu, but not on Windows. On Windows everything works fine.

```
dependencies = [
"azure-data-tables",
"azure-identity",
"azure-storage-blob",
"decord",
"torch",
"ray===2.6.2",
"ray[rllib]===2.6.2",
"ray[tune]===2.6.2",
"pygame",
"psutil",
"schema",
"keyboard",
"numba", # for jitting the dtw algorithm
"opencv-python",
"winput",
"pywin32; sys_platform == 'win32'",
"protobuf==3.20.3" # if we install BE externally, make sure we keep this version of protobuf
]

[project.optional-dependencies]
dev = [
"black",
"isort",
"flake8",
"Flake8-pyproject",
"mypy",
"mypy-extensions",
"types-PyYAML",
"toml",
"pre-commit",
"tqdm",
"matplotlib"
]
test = [
"fastdtw",
"pytest==7.3.1",
"Mock",
]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.