Message ID | 20191120125113.89779-1-kernrj@gmail.com |
---|---|
State | New |
Headers | show |
On 20.11.2019 13:51, Rick Kern wrote: > The current version of clang enables stack checking by default, causing > a crash when binaries are run. Why does it trigger a crash? Doesn't it indicate something is wrong that should be fixed instead?
On Wed, Nov 20, 2019 at 5:00 PM Timo Rothenpieler <timo@rothenpieler.org> wrote: > > On 20.11.2019 13:51, Rick Kern wrote: > > The current version of clang enables stack checking by default, causing > > a crash when binaries are run. > > Why does it trigger a crash? Doesn't it indicate something is wrong that > should be fixed instead? Its a bug in the Apple compiler (not in Clang in general afaik) that causes stack alignment to be thrown off. The commit should probably indicate that this is a Apple compiler bug. - Hendrik
On Wed, Nov 20, 2019 at 11:29 AM Hendrik Leppkes <h.leppkes@gmail.com> wrote: > On Wed, Nov 20, 2019 at 5:00 PM Timo Rothenpieler <timo@rothenpieler.org> > wrote: > > > > On 20.11.2019 13:51, Rick Kern wrote: > > > The current version of clang enables stack checking by default, causing > > > a crash when binaries are run. > > > > Why does it trigger a crash? Doesn't it indicate something is wrong that > > should be fixed instead? > Here's the discussion about the compiler bug - https://forums.developer.apple.com/thread/121887 Maybe this is too heavy-handed. Disabling avx, avx2, and avx512 fixes the issue too, so maybe this is the better than disabling a security feature. Detecting the compiler bug in configure and disabling only when present would have less impact on performance. I'm torn between automatically disabling it when the bug is detected, or bailing from configure with an error message to disable it. What's the best option? > > Its a bug in the Apple compiler (not in Clang in general afaik) that > causes stack alignment to be thrown off. > > The commit should probably indicate that this is a Apple compiler bug. > > - Hendrik > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
On Thu, Nov 21, 2019 at 09:44:56AM -0500, Rick Kern wrote: > On Wed, Nov 20, 2019 at 11:29 AM Hendrik Leppkes <h.leppkes@gmail.com> > wrote: > > > On Wed, Nov 20, 2019 at 5:00 PM Timo Rothenpieler <timo@rothenpieler.org> > > wrote: > > > > > > On 20.11.2019 13:51, Rick Kern wrote: > > > > The current version of clang enables stack checking by default, causing > > > > a crash when binaries are run. > > > > > > Why does it trigger a crash? Doesn't it indicate something is wrong that > > > should be fixed instead? > > > > Here's the discussion about the compiler bug - > https://forums.developer.apple.com/thread/121887 > > Maybe this is too heavy-handed. Disabling avx, avx2, and avx512 fixes the > issue too, so maybe this is the better than disabling a security feature. > Detecting the compiler bug in configure and disabling only when present > would have less impact on performance. > > I'm torn between automatically disabling it when the bug is detected, or > bailing from configure with an error message to disable it. What's the > best option? can it be worked around automatically ? IIUC one workaround reduces speed, the other reduces security. its maybe better to "ask" the user what she cares more about if theres no "universal" workaround and either means loosing something or at least give a clear warning at the end of configure that describes the issue and what the user can do to get the other workaround. Thanks [...]
diff --git a/configure b/configure index 8f4f2884cf..97e614f18a 100755 --- a/configure +++ b/configure @@ -6880,6 +6880,7 @@ elif enabled clang; then check_cflags -Werror=implicit-function-declaration check_cflags -Werror=missing-prototypes check_cflags -Werror=return-type + check_cflags -fno-stack-check elif enabled cparser; then add_cflags -Wno-missing-variable-declarations add_cflags -Wno-empty-statement