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

Building app with Go 1.23 OpenSSL backend emits a build warning #1305

Closed
dagood opened this issue Sep 3, 2024 · 2 comments · Fixed by golang-fips/openssl#162
Closed

Building app with Go 1.23 OpenSSL backend emits a build warning #1305

dagood opened this issue Sep 3, 2024 · 2 comments · Fixed by golang-fips/openssl#162
Assignees
Labels
bug Something isn't working fips

Comments

@dagood
Copy link
Member

dagood commented Sep 3, 2024

When I use mcr.microsoft.com/oss/go/microsoft/golang:1.23-fips-cbl-mariner2.0 to build a simple app targeting linux-amd64 I get this output:

# vendor/github.com/golang-fips/openssl/v2
thread_setup_unix.c: In function 'thread_id':
thread_setup_unix.c:32:12: warning: 'pthread_setspecific' expecting 1 byte in a region of size 0 [-Wstringop-overread]
   32 |     (void) pthread_setspecific(destructor_key, (void*)1);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from thread_setup_unix.c:5:
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/include-fixed/pthread.h:1317:12: note: in a call to function 'pthread_setspecific' declared with attribute 'access (none, 2)'
 1317 | extern int pthread_setspecific (pthread_key_t __key,
      |            ^~~~~~~~~~~~~~~~~~~

Dockerfile repro: https://github.com/dagood/msftgoex/blob/dev/dagood/1.23-warn/sum/Dockerfile

Repeating the repro with mcr.microsoft.com/oss/go/microsoft/golang:1.22-fips-cbl-mariner2.0 does not emit the warning.

Note: the build succeeds.

@dagood dagood added bug Something isn't working fips labels Sep 3, 2024
@dagood
Copy link
Member Author

dagood commented Sep 3, 2024

1.23-fips-bookworm and 1.23-fips-azurelinux3.0 don't emit the warning. So far I've only seen 1.23-fips-cbl-mariner2.0 (and equivalent tags) emit it.

@qmuntal
Copy link
Contributor

qmuntal commented Sep 4, 2024

1.23-fips-bookworm and 1.23-fips-azurelinux3.0 don't emit the warning. So far I've only seen 1.23-fips-cbl-mariner2.0 (and equivalent tags) emit it.

This is libc version dependent. See golang-fips/openssl#162 for a complete explanation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fips
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants