Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on Ubuntu 23.04 w/gcc 12.3.0 #3918

Open
1 of 4 tasks
jwhited opened this issue Oct 13, 2023 · 3 comments
Open
1 of 4 tasks

Build fails on Ubuntu 23.04 w/gcc 12.3.0 #3918

jwhited opened this issue Oct 13, 2023 · 3 comments
Labels
Milestone

Comments

@jwhited
Copy link
Contributor

jwhited commented Oct 13, 2023

Describe the bug

Building @ HEAD on Ubuntu 23.04 w/gcc 12.3.0 fails with:

/home/jwhited/msquic/src/inc/msquichelper.h:268:28: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
  268 |         HexString[i*2 + 1] = HEX_TO_CHAR(Buffer[i] & 0xf);

Ignoring stringop-overflow enables the build to succeed:

jwhited@i5-12400-2:~/msquic/artifacts/bin/linux/x64_Release_openssl3$ git diff
diff --git a/src/inc/msquichelper.h b/src/inc/msquichelper.h
index 232ea616..8579961e 100644
--- a/src/inc/msquichelper.h
+++ b/src/inc/msquichelper.h
@@ -265,6 +265,7 @@ EncodeHexBuffer(
     #define HEX_TO_CHAR(x) ((x) > 9 ? ('a' + ((x) - 10)) : '0' + (x))
     for (uint8_t i = 0; i < BufferLen; i++) {
         HexString[i*2]     = HEX_TO_CHAR(Buffer[i] >> 4);
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
         HexString[i*2 + 1] = HEX_TO_CHAR(Buffer[i] & 0xf);
     }
 }

The same commit of msquic builds on Ubuntu 22.04 without issue last I checked (GCC version not at hand), so appears to be due to a toolchain change. Not sure if it's a false positive or legitimate issue, there are reports of stringop-overflow false positives in newer versions of GCC.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

Ubuntu 23.04 gcc 12.3.0

MsQuic version

main

Steps taken to reproduce bug

  1. ./scripts/build.ps1 -Config Release -Clean
  2. Observe build failure

Expected behavior

The build succeeds

Actual outcome

The build fails due to:

/home/jwhited/msquic/src/inc/msquichelper.h:268:28: error: writing 16 bytes into a region of size 0 [-Werror=stringop-overflow=]
  268 |         HexString[i*2 + 1] = HEX_TO_CHAR(Buffer[i] & 0xf);

Additional details

No response

@nibanks
Copy link
Member

nibanks commented Oct 17, 2023

I'm pretty sure this is a false positive. Mind making a PR to ignore this? Is this OS version available in GitHub to add automation?

@nibanks nibanks added this to the Future milestone Oct 17, 2023
@PWisPeterWang
Copy link

Reproduced with GCC 13.2.0 on Red Hat 7.9

jwhited added a commit to jwhited/msquic that referenced this issue Oct 30, 2023
Updates microsoft#3918

Signed-off-by: Jordan Whited <jordan@tailscale.com>
@jwhited
Copy link
Contributor Author

jwhited commented Oct 30, 2023

I'm pretty sure this is a false positive. Mind making a PR to ignore this? Is this OS version available in GitHub to add automation?

https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources

Doesn't look like it's available yet. ubuntu-latest is ubuntu-22.04 at time of writing.

#3949

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants