Skip to content

3d: fix static init in test#24517

Merged
opencv-pushbot merged 1 commit into
opencv:5.xfrom
mshabunin:fix-3d-test
Nov 9, 2023
Merged

3d: fix static init in test#24517
opencv-pushbot merged 1 commit into
opencv:5.xfrom
mshabunin:fix-3d-test

Conversation

@mshabunin
Copy link
Copy Markdown
Contributor

@mshabunin mshabunin commented Nov 9, 2023

Platform: RISC-V board LicheePi4A
Version: 5.x
Configuration: static build, OpenCL OFF, Release/Debug

Apparently calling inv() expression during static initialization might cause segmentation fault. Use lazy-initialized singletone instead.

Program received signal SIGSEGV, Segmentation fault.
0x00000000000dd6c0 in cv::MatExpr::operator cv::Mat (this=0x3fffffef58) at /work/opencv/modules/core/include/opencv2/core/mat.inl.hpp:3183
3183	    op->assign(*this, m);

(gdb) bt
#0  0x00000000000dd6c0 in cv::MatExpr::operator cv::Mat (this=0x3fffffef58) at /work/opencv/modules/core/include/opencv2/core/mat.inl.hpp:3183
#1  0x000000000012510a in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at /work/opencv/modules/3d/test/test_normal.cpp:19
#2  0x000000000012d4e6 in _GLOBAL__sub_I_test_normal.cpp(void) () at /work/opencv/modules/3d/test/test_normal.cpp:723
#3  0x0000000000a3b28a in __libc_csu_init (argc=<optimized out>, argv=0x3ffffff368, envp=0x3ffffff378) at ../csu/elf-init.c:88
#4  0x0000003ff7c1cb8e in ?? ()
Backtrace stopped: frame did not save the PC

Related workflow PR in progress: opencv/ci-gha-workflow#119

@opencv-alalek opencv-alalek self-assigned this Nov 9, 2023
@opencv-alalek opencv-alalek added this to the 5.0 milestone Nov 9, 2023
@opencv-alalek
Copy link
Copy Markdown
Contributor

@asmorkalov There is unrelated failure in CUDA build:

[ RUN      ] DNNTestNetwork.FastNeuralStyle_eccv16/0, where GetParam() = CUDA/CUDA
/home/ci/opencv/modules/dnn/test/test_common.impl.hpp:75: Failure
Expected: (normL1) <= (l1), actual: 0.000733157 vs 0.0007
First run  |ref| = 348.9931640625
[  FAILED  ] DNNTestNetwork.FastNeuralStyle_eccv16/0, where GetParam() = CUDA/CUDA (302 ms)

@opencv-pushbot opencv-pushbot merged commit 3af68fa into opencv:5.x Nov 9, 2023
@mshabunin mshabunin deleted the fix-3d-test branch November 10, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants