Fix the seg fault issue (108) due to mavx CFLAG #150
Open
Conversation
with the following build command: ``` cmake -DCMAKE_C_FLAGS="-mavx" .. make ``` Encode command: ``` ./xeve_app -i <input.y4m> -o <output.evc> ``` Error message: ``` XEVE: eXtra-fast Essential Video Encoder Segmentation fault ``` On passing "-mavx2" as C_Flag (cmake -DCMAKE_C_FLAGS="-mavx" ..), it sets the flag for all files in the project, including the source C files. So, the compiler is creating optimizations which are not handled properly resulting in a segmentation fault. This PR fixes the issue by updating the CmakeLists.txt files.
kpchoi
reviewed
Sep 24, 2024
Collaborator
kpchoi
left a comment
There was a problem hiding this comment.
Did you check why the 'mavx2' option generate segfault exactly?
Theoretically, it should not have problem even though we set 'mavx2' option to c-code.
There could be some buggy code for AVX2 optimization generated by c-compiler?
If we could find the weak code to avx2 optimization, it would be better to change the code itself rather than adding 'mnoavx2' cflag option.
Collaborator
|
Output form gdb: In debug build and under valgrind it works correctly in my case. |
Collaborator
|
@neergil , |
added 2 commits
November 20, 2024 19:04
* Shuffle struct member declaration in XEVE_CTX * Reorder instructions to introduce latency within `pintra_init_mt()` and `pinter_init_mt()` functions
Collaborator
|
I don't understand this code fully, because the code change is weird. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We are able to reproduce the issue #108 with the following build command:
Encode command:
Error message:
On passing "-mavx2" as C_Flag (cmake -DCMAKE_C_FLAGS="-mavx" ..), it sets the flag for all files in the project, including the source C files. So, the compiler is creating optimizations which are not handled properly resulting in a segmentation fault.
This PR fixes the issue by updating the CmakeLists.txt files.