Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVX Feature Detection in GCC Release corrupts something (but what?) #4506

Closed
tank-trax opened this issue May 7, 2021 · 6 comments · Fixed by #4512
Closed

AVX Feature Detection in GCC Release corrupts something (but what?) #4506

tank-trax opened this issue May 7, 2021 · 6 comments · Fixed by #4512
Labels
Bug Report Item submitted using the Bug Report template Linux Issues which only occur on Linux
Milestone

Comments

@tank-trax
Copy link
Collaborator

tank-trax commented May 7, 2021

@baconpaul editing this issue at the top

Basically a release build of xt blows up on the about screen. The reason is because the about screen asks if the cpu has AVX support to decorate the about info. For some reason gcc release code and our implementation of hasAVX corrupts memory somehow (how?). So for now I made hasAVX always return true. But clearly this isn't OK and we need it to actually detect without blowing up stuff so renaming this issue and leaving it open.


This is the command line output for Debug that can open About screen

JUCE v6.0.7
SurgeXT Startup
  - Version    : 1.0.main.877ba210
  - Build Info : x86_64 GNU-10.2.1
  - Build Time : 2021-05-06 23:08:06
  - CPU        :  Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz

PatchDB : Opening sqlitedb /home/studio/Documents/Surge/SurgePatches.db
        : schema check. DBVersion='2' SchemaVersion='2'
        : Schema matches. Reusing database.
SynthProcessor: /home/studio/dev/extras/surge-xt/src/surge_synth_juce/SurgeSynthStandaloneExtensions.cpp
JUCE Assertion failure in juce_PathStrokeType.cpp:267
JUCE Assertion failure in juce_PathStrokeType.cpp:267
  - efvg unimplemented : getViewAt at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1154
SynthEditor: /home/studio/dev/extras/surge-xt/src/surge_synth_juce/SurgeSynthStandaloneExtensions.cpp
  - efvg unimplemented : getViewAt at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1154
  - efvg unimplemented : localToFrame at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1289
  - efvg unimplemented : isChild at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1159
  - efvg unimplemented : localToFrame at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1289
  - efvg unimplemented : isChild at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1159

and for Release that segfaults when About is opened (you can see I opened and closed it twice)

./Surge\ XT 
SurgeXT Startup
  - Version    : 1.0.main.877ba210
  - Build Info : x86_64 GNU-10.2.1
  - Build Time : 2021-05-06 22:24:30
  - CPU        :  Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz

PatchDB : Opening sqlitedb /home/studio/Documents/Surge/SurgePatches.db
        : schema check. DBVersion='2' SchemaVersion='2'
        : Schema matches. Reusing database.
SynthProcessor: /home/studio/dev/extras/surge-xt/src/surge_synth_juce/SurgeSynthStandaloneExtensions.cpp
  - efvg unimplemented : getViewAt at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1154
SynthEditor: /home/studio/dev/extras/surge-xt/src/surge_synth_juce/SurgeSynthStandaloneExtensions.cpp
  - efvg unimplemented : getViewAt at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1154
  - efvg unimplemented : localToFrame at /home/studio/dev/extras/surge-xt/libs/escape-from-vstgui/include/efvg/escape_from_vstgui.h:1289
free(): invalid pointer
Aborted
@tank-trax tank-trax added the Bug Report Item submitted using the Bug Report template label May 7, 2021
@tank-trax
Copy link
Collaborator Author

Debian Bullseye 11

image

@tank-trax
Copy link
Collaborator Author

here's the Debug running on Mint 19

image

@tank-trax tank-trax changed the title About Screen Segfault Release - Debian/Mint SUrge XT Release version About Screen Segfault - Debian 11/Mint 19 May 7, 2021
@tank-trax tank-trax added the Linux Issues which only occur on Linux label May 7, 2021
@tank-trax tank-trax changed the title SUrge XT Release version About Screen Segfault - Debian 11/Mint 19 Surge XT Release version - About Screen Segfault - Debian 11/Mint 19 May 7, 2021
@ghost
Copy link

ghost commented May 7, 2021

Compilers...
Release build with Clang-12.0.1 : all good
with gcc i get the same as @tank-trax
Debug build with gcc 9.3.0 : all good
Release build with gcc 9.3.0 : crash when click on about
gdb says this:
crash_gcc_Release.txt
(all Mint 20.1 / Standalone at 877ba21)

@baconpaul
Copy link
Collaborator

Very useful thanks. I will take a peek

baconpaul added a commit to baconpaul/surge that referenced this issue May 7, 2021
1. Rename namespace Surge::UI to Surge::GUI
2. For now make gcc implementation of hasAVX() return true
   since it crashes the about box. Addresses surge-synthesizer#4506
@baconpaul
Copy link
Collaborator

OK I'm pushing a workaround for this and re-naming this issue to the root cause. More in a second.

@baconpaul baconpaul changed the title Surge XT Release version - About Screen Segfault - Debian 11/Mint 19 AVX Feature Detection in GCC Release corrupts something (but what?) May 7, 2021
@baconpaul baconpaul added this to the Surge XT 1.0 milestone May 7, 2021
baconpaul added a commit to baconpaul/surge that referenced this issue May 7, 2021
1. Rename namespace Surge::UI to Surge::GUI
2. For now make gcc implementation of hasAVX() return true
   since it crashes the about box. Addresses surge-synthesizer#4506
baconpaul added a commit that referenced this issue May 7, 2021
1. Rename namespace Surge::UI to Surge::GUI
2. For now make gcc implementation of hasAVX() return true
   since it crashes the about box. Addresses #4506
baconpaul added a commit to baconpaul/surge that referenced this issue May 7, 2021
@baconpaul
Copy link
Collaborator

Got it. merge shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Report Item submitted using the Bug Report template Linux Issues which only occur on Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants