RFR: 8186780: clang-4.0 fastdebug assertion failure in os_linux_x86:os::verify_stack_alignment() (original) (raw)

Martin Buchholz martinrb at google.com
Wed Jun 20 23:03:13 UTC 2018


Hi David and build-dev folk,

After way too much build/hotspot hacking, I have a better fix:

clang inlined os::current_stack_pointer into its caller in the same translation unit_ (that could be fixed in a separate change) so of course in this case it didn't have to follow the ABI. Fix is obvious in hindsight:

-address os::current_stack_pointer() { +NOINLINE address os::current_stack_pointer() {

While working on this I noticed that the clang stack alignment flags on Linux are missing. They should be moved from a macosx-specific check to a clang-specific check. macosx is not synonymous with clang!

--- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 @@ -470,6 +470,14 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], # COMMON to gcc and clang TOOLCHAIN_CFLAGS_JVM="-pipe -fno-rtti -fno-exceptions
-fvisibility=hidden -fno-strict-aliasing -fno-omit-frame-pointer" +

and

-mno-omit-leaf-frame-pointer -mstack-alignment=16"

fi

if test "x$TOOLCHAIN_TYPE" = xgcc; then @@ -601,10 +609,6 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER], fi fi

-mstack-alignment=16" - fi

Optional POSIX functionality needed by the JVM

Check if clock_gettime is available and in which library. This

indicates

8186780: clang-4.0 fastdebug assertion failure in os_linux_x86:os::verify_stack_alignment() http://cr.openjdk.java.net/~martin/webrevs/jdk/clang-stack-alignment/ https://bugs.openjdk.java.net/browse/JDK-8186780

On Wed, Jun 20, 2018 at 12:30 AM, David Holmes <david.holmes at oracle.com> wrote:

Hi Martin,

On 20/06/2018 3:03 AM, Martin Buchholz wrote: (There's surely a better fix that involves refactoring os/cpu/compiler support)

8186780: clang-4.0 fastdebug assertion failure in oslinuxx86:os::verifystackalignment() http://cr.openjdk.java.net/~martin/webrevs/jdk/clang-verify stackalignment/ https://bugs.openjdk.java.net/browse/JDK-8186780 I remain concerned about what it may mean for the stack pointer to not be aligned. I would have thought stack pointer alignment was part of the ABI for a CPU architecture, not something the compiler could choose at will? What about all the other code that uses StackAlignmentInBytes ?? That aside your fix excludes the assert when building with clang for linux x86 as intended. And I see that for BSD x86 (where we also use clang) that verifystackalignment is empty. Thanks, David



More information about the build-dev mailing list