# HG changeset patch # User Yasumasa Suenaga # Date 1500002325 -32400 # Node ID f1096afde0362035e9c9c000b6b9ae63707ee707 # Parent 5ee1c4138b6165d4528a962ff62cc73c91308675 Bug 3421: Override functions might crash on Fedora 26 Reviewed-by: ykubota https://github.com/HeapStats/heapstats/pull/110 diff -r 5ee1c4138b61 -r f1096afde036 ChangeLog --- a/ChangeLog Tue Jul 11 18:15:01 2017 +0900 +++ b/ChangeLog Fri Jul 14 12:18:45 2017 +0900 @@ -1,3 +1,7 @@ +2017-07-14 Yasumasa Suenaga + + * Bug 3421: Override functions might crash on Fedora 26 + 2017-07-11 Yasumasa Suenaga * Bug 3419: Provide FXAnalyzer RPM package for Fedora diff -r 5ee1c4138b61 -r f1096afde036 agent/src/heapstats-engines/arch/x86/overrideFunc.amd64.S --- a/agent/src/heapstats-engines/arch/x86/overrideFunc.amd64.S Tue Jul 11 18:15:01 2017 +0900 +++ b/agent/src/heapstats-engines/arch/x86/overrideFunc.amd64.S Fri Jul 14 12:18:45 2017 +0900 @@ -3,7 +3,7 @@ * \brief This file is used to override JVM inner function for AMD64.
* The function defined this file, used with v-table hook.
* So in this file, all function is written by only assembler and macro. - * Copyright (C) 2014-2015 Yasumasa Suenaga + * Copyright (C) 2014-2017 Yasumasa Suenaga * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -58,13 +58,19 @@ mov collectedHeap@GOTPCREL(%rip), %rdi; \ mov (%rdi), %rdi; \ mov oop_ofs(%rsp), %rsi; \ + push %rbp; \ + mov %rsp, %rbp; \ call *(%r11); \ + pop %rbp; \ test %al, %al; #define DO_JMP_TO_CALLBACK(header, ary_idx, oop_ofs) \ mov oop_ofs(%rsp), %rdi; \ mov header##_enter_hook_##ary_idx##@GOTPCREL(%rip), %r11; \ - call *(%r11); + push %rbp; \ + mov %rsp, %rbp; \ + call *(%r11); \ + pop %rbp; #define OVERRIDE_FUNC_DEFINE(header, ary_idx) \ .global header##_override_func_##ary_idx ; \