- 
    Bug 
- 
    Resolution: Fixed
- 
     P4 P4
- 
    11, 13
- 
        b11
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build | 
|---|---|---|---|---|---|---|
| JDK-8270936 | 11.0.13-oracle | Kevin Walls | P4 | Resolved | Fixed | b03 | 
| JDK-8266617 | 11.0.12 | Matthias Baesken | P4 | Resolved | Fixed | b02 | 
                    GCC 8 reports an error:
src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:24: error: '%.3d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 80 [-Werror=format-truncation=]
"%s.%.3d %s", timestamp_prefix,
^~~~
The call is:
(void)snprintf(tbuf, ltbuf,
"%s.%.3d %s", timestamp_prefix,
(int)(millisecs), timestamp_postfix);
It can be fixed by making prefix and postfix reasonably short, like:
char timestamp_prefix[MAXLEN_TIMESTAMP / 2 - 4];
char timestamp_postfix[MAXLEN_TIMESTAMP / 2];
src/jdk.jdwp.agent/share/native/libjdwp/log_messages.c:75:24: error: '%.3d' directive output may be truncated writing between 3 and 11 bytes into a region of size between 0 and 80 [-Werror=format-truncation=]
"%s.%.3d %s", timestamp_prefix,
^~~~
The call is:
(void)snprintf(tbuf, ltbuf,
"%s.%.3d %s", timestamp_prefix,
(int)(millisecs), timestamp_postfix);
It can be fixed by making prefix and postfix reasonably short, like:
char timestamp_prefix[MAXLEN_TIMESTAMP / 2 - 4];
char timestamp_postfix[MAXLEN_TIMESTAMP / 2];
- backported by
- 
                    JDK-8266617 JDWP: Unforseen output truncation in logging -           
- Resolved
 
-         
- 
                    JDK-8270936 JDWP: Unforseen output truncation in logging -           
- Resolved
 
-         
- relates to
- 
                    JDK-8213153 Clean up GCC 8 errors -           
- Closed
 
-         
- 
                    JDK-8248271 linux-x86-zero build failure -           
- Resolved
 
-         
- 
                    JDK-8254270 Linux 32 bit build doesn't compile libjdwp/log_messages.c -           
- Resolved
 
-