JDK-8254270 : Linux 32 bit build doesn't compile libjdwp/log_messages.c
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-10-08
  • Updated: 2024-07-12
  • Resolved: 2020-11-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 15 JDK 16
11.0.13Fixed 13.0.10Fixed 15.0.6Fixed 16 b24Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Even though this isn't a supported platform, it would be nice if it built so that we can verify cross platform changes.

src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:82:29: error: '%s' directive output may be truncated writing up to 56 bytes into a region of size between 52 and 76 [-Werror=format-truncation=]
[2020-10-08T21:31:22,174Z]    82 |                    "%s.%.3d %s", timestamp_date_time,
[2020-10-08T21:31:22,174Z]       |                             ^~
[2020-10-08T21:31:22,174Z]    83 |                    (int)(millisecs), timestamp_timezone);
[2020-10-08T21:31:22,174Z]       |                                      ~~~~~~~~~~~~~~~~~~

src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:81:11: note: 'snprintf' output between 6 and 86 bytes into a destination of size 81
[2020-10-08T21:31:22,174Z]    81 |     (void)snprintf(tbuf, ltbuf,
[2020-10-08T21:31:22,174Z]       |           ^~~~~~~~~~~~~~~~~~~~~
[2020-10-08T21:31:22,174Z]    82 |                    "%s.%.3d %s", timestamp_date_time,
[2020-10-08T21:31:22,174Z]       |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2020-10-08T21:31:22,174Z]    83 |                    (int)(millisecs), timestamp_timezone);
[2020-10-08T21:31:22,174Z]       |                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Comments
Fix request (13u) I'd like to backport this fix to jdk13u for parity with jdk11u. The same issue was observed. After applying the patch the issue is eliminated. The original patch applied cleanly.
08-12-2021

Fix request (15u) Clean backport. Fixes linux 32 bit build.
22-11-2021

Fix request (11u): Clean backport of a change to enable the Github Actions workflow. This unbreaks the linux 32 bit build. Risk should be low, tested in SAP nightlies.
05-08-2021

Changeset: 0b7fba75 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2020-11-06 19:04:09 +0000 URL: https://github.com/openjdk/jdk/commit/0b7fba75
06-11-2020

I applied Claes's patch in JDK-8214854 but now there are new failures.
21-10-2020

A very similar issue was fixed in these same lines of code last year. See JDK-8214854 and http://mail.openjdk.java.net/pipermail/serviceability-dev/2019-March/027314.html
08-10-2020