Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

dev:tests/unit/image_stream.cpp 与实现脱节,BGRA8 断言拒绝但实现接受,Debug 下确定性 SIGABRT

Closed
#82 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
cmake, cpp

Research direction

Read tests/unit/image_stream.cpp:34 alongside core/render/image_stream.cpp, especially ImageFrame::valid() and submit(). Reproduce the failure with the supplied Debug CMake build, then confirm the intended BGRA8 behavior with a maintainer. Done means the image_stream test no longer aborts in Debug and covers the agreed BGRA8 result, including conversion content if support is retained.

Written by the indexing model from the issue text.

Description

问题

上游测试套件在 Debug 构建下,image_stream 单测确定性 SIGABRT(连跑 3 次,3/3 复现,exit 134):断言 BGRA8 帧提交必须被拒绝,但实现已显式支持 BGRA8。这是 dev HEAD 既有问题(与 #71–#78 的修复提交无关);仅 assert 生效的 Debug 构建暴露,Release 下被 NDEBUG 掩盖成"通过"。

环境

项 值
系统 Ubuntu 24.04.5,GCC 13.3.0,CMake 3.28.3
EUI-NEO dev 4691fc0a5c1fde6f3e22f1ac454ed87c7a17f722
配置 Debug + bundled(GLFW 补丁脚本哈希需先修正,与本问题无关)

复现

cmake -S . -B build-tests -DEUI_BUILD_TEST_FIXTURES=ON -DEUI_DEPS_MODE=bundled \
      -DGLFW_BUILD_WAYLAND=OFF -DCMAKE_BUILD_TYPE=Debug
cmake --build build-tests --target image_stream
./build-tests/image_stream   # 连续 3 次运行均 SIGABRT / exit 134
image_stream: tests/unit/image_stream.cpp:34: int main():
Assertion `!stream->submit({pixels, 4, 2, 16, core::render::ImagePixelFormat::BGRA8, 6})' failed.

根因

  • 测试 tests/unit/image_stream.cpp:34(源自 a969ed5)断言 !submit({... BGRA8 ...}),用例参数合法(4x2、stride 16 = width*4);
  • 实现 core/render/image_stream.cpp:ImageFrame::valid()(约 :104-105)有 case ImagePixelFormat::BGRA8: 显式接受(要求 stride ≥ width*4 且 4 字节对齐——本用例恰好满足),submit()(约 :181-191)仅做 valid() 校验后入队并返回 true;
  • 断言与实现同源自 a969ed5,语义从未对齐,后续提交也未修正。

期望(建议修复,二选一)

  1. BGRA8 既然已支持:把断言改为提交成功,并补一条 BGRA→RGBA 转换内容正确性的用例(BGRA 是相机/BMP 常见格式,覆盖有价值)——倾向此方案;
  2. 若设计上仍要拒绝 BGRA8:恢复实现侧校验。
Dominant language
C++
Stars
2k
Forks
177
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sudoevolve/EUI-NEO

All issues in sudoevolve/EUI-NEO

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.