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

runtime-community: Failure to build System.Security.Cryptography.Native/opensslshim.c due to overflow in expression with type long #104333

Open
carlossanlop opened this issue Jul 2, 2024 · 9 comments
Labels
area-Infrastructure Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Milestone

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Jul 2, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=728088
Build error leg or test failing: runtime-community - linux-armv6 Release AllSubsets_Mono

Error Message

{
  "ErrorMessage" : [
    "overflow in expression; result is -2147483648 with type 'long' [-Werror,-Winteger-overflow]",
    "time_t timeVal = (time_t)INT_MAX + 1"
  ],
  "BuildRetry" : false,
  "ExcludeConsoleLog" : false
}
[ 88%] Building C object System.IO.Compression.Native/CMakeFiles/System.IO.Compression.Native.dir/__w/1/s/src/native/external/brotli/enc/bit_cost.c.o
/__w/1/s/src/native/libs/System.Security.Cryptography.Native/opensslshim.c(238,38): error G7D1C1CEA: overflow in expression; result is -2147483648 with type 'long' [-Werror,-Winteger-overflow] [/__w/1/s/src/native/libs/build-native.proj]
##[error]src/native/libs/System.Security.Cryptography.Native/opensslshim.c(238,38): error G7D1C1CEA: (NETCORE_ENGINEERING_TELEMETRY=Build) overflow in expression; result is -2147483648 with type 'long' [-Werror,-Winteger-overflow]
      time_t timeVal = (time_t)INT_MAX + 1;
                                       ^
  1 error generated

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=728088
Error message validated: [overflow in expression; result is -2147483648 with type 'long' [-Werror,-Winteger-overflow] time_t timeVal = (time_t)INT_MAX + 1]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 7/2/2024 10:30:44 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
@carlossanlop carlossanlop added os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime Known Build Error Use this to report build issues in the .NET Helix tab labels Jul 2, 2024
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Jul 2, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@vcsjones
Copy link
Member

vcsjones commented Jul 2, 2024

cc @sbomer, looks related to the changes for ARM32 64-bit time_t support.

@carlossanlop
Copy link
Member Author

I found it in the official rolling build but I noticed it first in my PR where I was fixing a build failure in armv6: #102403

Here's the failing CI leg: https://dev.azure.com/dnceng-public/public/_build/results?buildId=728642&view=logs&j=db8e93a1-262e-5037-1aaf-a14621311ed2&t=df0c0844-666d-543b-d576-d26fca1aab72&l=3498

@buyaa-n
Copy link
Contributor

buyaa-n commented Jul 3, 2024

akoeplinger pushed a commit that referenced this issue Jul 4, 2024
We now require a 64-bit time_t, even on ARM32. This adds a static_assert to ensure time_t is 64-bit, and if not, produce a compile time error.

This also uses a constant instead of `(time_t)INT_MAX + 1` since, if that overflows, it is UB because time_t is a signed type.

Contributes to #104333
@vcsjones
Copy link
Member

vcsjones commented Jul 4, 2024

I think we should move this back to Infrastructure.

Based on a conversation in #104368, the runtime now requires systems that have a 64-bit time_t. This also aligns with the Y2038 announcement. The armv6 community pipeline is using a 32-bit time_t, which is what should be fixed.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@agocke agocke added this to the Future milestone Jul 8, 2024
@agocke agocke removed the untriaged New issue has not been triaged by the area owner label Jul 8, 2024
@carlossanlop
Copy link
Member Author

I'm seeing the same failure but happening in the static_assert check from two lines above, so the error message is different:

/__w/1/s/src/native/libs/System.Security.Cryptography.Native/opensslshim.c(236,5): error G0D02855E: static_assert failed due to requirement 'sizeof(long) == 8' "Build requires 64-bit time_t." [/__w/1/s/src/native/libs/build-native.proj]
##[error]src/native/libs/System.Security.Cryptography.Native/opensslshim.c(236,5): error G0D02855E: (NETCORE_ENGINEERING_TELEMETRY=Build) static_assert failed due to requirement 'sizeof(long) == 8' "Build requires 64-bit time_t."
      c_static_assert_msg(sizeof(time_t) == 8, "Build requires 64-bit time_t.");
      ^                   ~~~~~~~~~~~~~~~~~~~
  /__w/1/s/src/native/libs/Common/pal_compiler.h:20:37: note: expanded from macro 'c_static_assert_msg'
  #define c_static_assert_msg(e, msg) static_assert((e), msg)
                                      ^              ~
  /crossrootfs/armv6/usr/include/assert.h:143:24: note: expanded from macro 'static_assert'
  # define static_assert _Static_assert
                         ^
  1 error generated.

@vcsjones
Copy link
Member

@carlossanlop I think you can change the ErrorMessage for the know build error to Build requires 64-bit time_t.

The best I could do is improve the error message, but the issue remains that the image used in CI is not a supported configuration anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure Known Build Error Use this to report build issues in the .NET Helix tab os-linux Linux OS (any supported distro) runtime-mono specific to the Mono runtime
Projects
Status: Done
Development

No branches or pull requests

5 participants