xiph / xiph/opus

`opus_cpu_feature_check` doesn't check XState

Open
#475 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
3.3k
Forks
808
PR merge metrics
No merged PRs in 30d

Description

opus_cpu_feature_check only checks cpuid today and not xgetbv which can cause crashes when AVX is disabled there.

The code should also check if it's enabled using GetEnabledXStateFeatures on Windows and _xgetbv otherwise.

https://github.com/xiph/opus/blob/f18e26e648e0b7d0ad3db5b98eca461c937ee757/celt/x86/x86cpu.c#L111-L138

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start in celt/x86/x86cpu.c at lines 111-138 and trace how opus_cpu_feature_check currently handles cpuid. Compare the Windows GetEnabledXStateFeatures path with the non-Windows _xgetbv path, then build or run the relevant CPU feature checks to verify AVX is rejected when XState does not enable it.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
70/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.