[Integrated] RFR: 6819: Agent instrumentation causing stack map frame verification error
Kangcheng Xu
kxu at openjdk.java.net
Tue Jun 9 21:09:04 UTC 2020
On Wed, 3 Jun 2020 16:27:58 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:
> This pr fixes [JMC-6819: Agent instrumentation causing stack map frame verification
> error](https://bugs.openjdk.java.net/browse/JMC-6819).
> The issue is reproducible when the target function consists of multiple exit points, and a compressed stack map frame
> describing a jump target, followed by a function exit (eg. `*return` instructions). A simple example could be something
> like(, given `javac` writes a compressed frame instead of a new expanded frame): public int echo(int arg) {
> if (arg > 42) {
> return 42;
> }
> return arg;
> }
>
> When fixing [JMC-6532: Instrumentation fails for methods containing try-catch
> clauses](https://bugs.openjdk.java.net/browse/JMC-6532), compressed frames were [forcefully
> expanded](https://github.com/thegreystone/jmc-old/commit/e4acc9c93bfb21317caeead2d7646c7677c7a4a6#diff-af337d6e5f3fd3b585e66e0cebcb056fR132),
> but the method was faulty. It turns out the ASM lib supports expanding frames automatically, which this pr adopts.
> This pr comes with test cases generating bytecode for the example above. The generation is done by ASM lib manually to
> make sure various compressed frame types (`same_frame`, `chop_frame`, `append_frame`) are tested.
This pull request has now been integrated.
Changeset: 75c14e13
Author: Kangcheng Xu <kxu at openjdk.org>
Committer: Marcus Hirt <hirt at openjdk.org>
URL: https://git.openjdk.java.net/jmc/commit/75c14e13
Stats: 172 lines in 5 files changed: 12 ins; 158 del; 2 mod
6819: Agent instrumentation causing stack map frame verification error
Reviewed-by: hirt
-------------
PR: https://git.openjdk.java.net/jmc/pull/79
More information about the jmc-dev
mailing list