Integrated: 8343618: Stack smashing in awt_InputMethod.c on Linux s390x

Zdenek Zambersky zzambers at openjdk.org
Thu May 22 03:42:58 UTC 2025


On Mon, 24 Mar 2025 13:41:44 GMT, Zdenek Zambersky <zzambers at openjdk.org> wrote:

> This fixes stack smashing issue in awt library on linux s390x. (jdk compiled with `-fstack-protector-strong`)
> 
> Fix is based on patch [submitted](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015337.html) in JDK-8227919 review thread, rebased to master. They decided to go for Solaris only fix there, with [expected follow-up](https://mail.openjdk.org/pipermail/awt-dev/2019-July/015347.html) for linux/s390x. But that never happened.
> 
> I was not able to get response from original author for this issue, so I am creating PR myself.
> 
> **Testing:**
> I tested jdk with and without this fix on linux/s390x (using Xvfb). It fixes the issue (reproducer for this bug no longer crashes the JVM). I have also tried to run `jdk_awt` tests, where lot of tests was also affected by this. With this patch amount of failures dropped by ~100. 
> 
> Without fix:
> 
>    TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>>> jtreg:test/jdk:jdk_awt                             2171  1063   415     6   687 <<
> 
> 
> With fix
> 
>    TEST                                              TOTAL  PASS  FAIL ERROR  SKIP   
>>> jtreg:test/jdk:jdk_awt                             2171  1162   316     6   687 <<
> 
> 
> Many tests are no longer crashing the VM:
> 
> -java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java                                                      Failed. Unexpected exit from test [exit code: 134]
> +java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.java                                                      Passed. Execution successful
> 
> There seem to be few unstable tests in jdk_awt. (Ones that fail in one or another run, but seem unrelated to this fix)
> 
> I have not done any additional manual testing of XIM as did original author (in review thread mentioned higher), as I am not at all familiar with input method for Japanese (or other Asian characters), or how that supposed to work. (So I cannot verify that input of Asian characters works as expected on linux/s390x, but at least JVM no longer crashes.)

This pull request has now been integrated.

Changeset: ee689145
Author:    Zdenek Zambersky <zzambers at openjdk.org>
Committer: SendaoYan <syan at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/ee6891456ed672305d9b48846b5a7977373e1284
Stats:     20 lines in 1 file changed: 10 ins; 10 del; 0 mod

8343618: Stack smashing in awt_InputMethod.c on Linux s390x

Co-authored-by: Ichiroh Takiguchi <itakiguchi at openjdk.org>
Reviewed-by: prr, aph, amitkumar

-------------

PR: https://git.openjdk.org/jdk/pull/24197


More information about the client-libs-dev mailing list