google / google/jsonnet

Incorrect handling of left shift overflow on non-x86_64 (returns value instead of runtime error)

Open
#1,315 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jsonnet
Stars
7.6k
Forks
475
PR merge metrics
No merged PRs in 30d

Description

Summary

On non-x86_64 architectures, Jsonnet does not raise a runtime error for integer left shift overflow. Instead, it returns a wrapped negative value and exits successfully (code 0). This contradicts expected behavior and causes regression test failure.

Affected Version:
* Jsonnet 0.22.0
* Observed on: non-x86_64 architectures (e.g., aarch64, ppc64le) in Fedora rawhide
* Not reproducible on: x86_64 (https://koji.fedoraproject.org/koji/taskinfo?taskID=143856012)

Reproduction:
```
jsonnet --ext-str var1=test --ext-code var2='{x:1,y:2}' error.integer_left_shift_runtime.jsonnet

Test case (error.integer_left_shift_runtime.jsonnet):

(1 << 63)
```

Built at:
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856013
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856014
https://koji.fedoraproject.org/koji/taskinfo?taskID=143856015

Which contains both a `root.log` showing installed packages and a `build.log` showing the output from the compile/test

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.