Commit c8fd18b
authored
fix: go panic (#2201)
This was an interesting one!
TODO: add more findings why it works on Mac and not on Linux
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fixes Go panic by adjusting memory allocation in `InvokeRuntimeCli`
and updates Dockerfile for Linux compatibility.
>
> - **Go Panic Fix**:
> - In `exports.go`, `InvokeRuntimeCli` function now allocates an extra
slot in `arg_c_strings` array to prevent out-of-bounds access.
> - Adjusts `defer` block to correctly free only initialized C strings.
> - **Dockerfile Update**:
> - In `test-package.Dockerfile`, adds `--platform=linux/amd64` to
`FROM` directive to ensure compatibility with Linux.
> - Installs Go 1.22 and protobuf Go plugin for building Go
applications.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for 6cbb8de. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent a9208b6 commit c8fd18b
2 files changed
Lines changed: 18 additions & 4 deletions
File tree
- engine/language_client_go/baml_go
- integ-tests/python/docker-tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | | - | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | 48 | | |
36 | 49 | | |
| |||
0 commit comments