Releases: ponylang/ponyc
0.58.7
Make actor heap allocations more efficient by recycling freed memory
Prior to this change, the actor heap garbage collection process would return freed memory back to the pony runtime at the end of a garbage collection run. The returning of memory to the pony runtime and allocating of new memory from the pony runtime are both expensive operations. This change makes it so that the actor garbage collection process keeps old freed memory chunks around with the expectation that the actor will very likely need memory again as it continues to run behaviors. This avoids the expensive return to and reallocation of memory from the pony runtime. It is possible that the overall application might end up using more memory as any freed memory chunks can only be reused by the actor that owns them and the runtime and other actors can no longer reuse that memory as they previously might have been able to.
Correctly find custom-built llc
during build process
Previously our CMake build was failing to find our custom-built llc
binary, but builds worked by accident if there was a system llc
. The build system now finds our custom llc
correctly.
Fix minor buffer out of bounds access bug in compiler
Previously, the compiler error reporting had a minor buffer out of bounds access bug where it read one byte past the end of a buffer as part of an if condition before checking that the offset was smaller than the buffer length. This was fixed by switching the order of the if condition checks so that the check that the offset is smaller than the buffer length happens before reading the value from the buffer to prefer the out of bounds access issue.
Fix bug in ASIO shutdown
There was a bug during our shutdown process that could cause a segmentation fault coming from our asynchrnous I/O subsystem. This has been fixed.
Fix early quiescence/termination bug
Previously, the logic to detect quiescence had a race condition in relation to dynamic scheduler scaling and it was possible for the runtime to incorrectly detect quiescence and termninate early if a scheduler thread suspended at just the right time.
We have now changed the quiescence logic to keep an accurate track of exactly how many scheduler threads are active at the time the quiescence detection protocol begins so it can ensure that any scheduler threads suspending or unsuspending can no longer cause an incorrect determination that might lead to early termination of the runtime.
[0.58.7] - 2024-11-30
Fixed
- Correctly find custom-built
llc
(PR #4537) - Fix buffer out of bounds access issue (PR #4540)
- Fix bug in ASIO shutdown (PR #4548)
- Fix early quiescence/termination bug (PR #4550)
Changed
- Recycle actor heap chunks after GC instead of returning to pool (PR #4531)
0.58.6
Fix use after free bug in actor heap finalisation that can lead to a segfault
The 0.45.2 release introduced an improvement to handling of objects with finalisers to make them more efficient to allocate on actor heaps. However, in the process it also introduced a potential for use after free situations that could lead to segfaults when running finalisers. With this change, we've reworked the implementation of the actor heap garbage collection to avoid the potential for use after free situations entirely.
Fix actor heap chunk size tracking bug that could cause a segfault
The 0.55.1 release included some internal actor heap implementation optimizations. Unfortunately, there was a small bug that could potentially cause a segfault due to not properly clearing some bits before setting them for some heap chunks. This change corrects that oversight to ensure the relevant bits are properly cleared before being set to ensure they final result can never be incorrect.
[0.58.6] - 2024-10-16
Fixed
0.58.5
0.58.4
Fix compiler crash
Previously the following code would cause the compiler to crash. Now it will display a helpful error message:
struct FFIBytes
var ptr: Pointer[U8 val] = Pointer[U8].create()
var length: USize = 0
fun iso string(): String val =>
recover String.from_cpointer(consume FFIBytes.ptr, consume FFIBytes.length) end
actor Main
new create(env: Env) =>
env.out.print("nothing to see here")
Add prebuilt ponyc binaries for Ubuntu 24.04
We've added prebuilt ponyc binaries specifically made to work on Ubuntu 24.04.
You can opt into using the Ubuntu binaries when using ponyup by running:
ponyup default ubuntu24.04
Fix generation of invalid LLVM IR
Previously, this code failed at LLVM module verification. Now, with this change, it's fixed by stopping the generation of ret
instructions after terminator instructions:
class Foo
new create(a: U32) ? =>
error
actor Main
new create(env: Env) =>
try
let f = Foo(1)?
end
[0.58.4] - 2024-05-01
Fixed
Added
- Add prebuilt ponyc binaries for Ubuntu 24.04 (PR #4508)
0.58.3
Fix incorrect markdown formatting for types from documentation generation
Previously, we were incorrectly creating field types in markdown documentation. The markdown for the type should have been on a single line but for long union types, it would end up crossing lines. That resulted in broken markdown that wouldn't display correctly.
[0.58.3] - 2024-03-30
Fixed
- Fix bug in documentation generation (PR #4502)
0.58.2
Fedora 39 added as a supported platform
We've added Fedora 39 as a supported platform. We'll be building ponyc releases for it until it stops receiving security updates at the end of 2024. At that point, we'll stop building releases for it.
Add support for MacOS on Apple Silicon
Back in August of 2023, we had to drop MacOS on Apple Silicon as a supported platform as we had no Apple Silicon test and build environment. We lost our existing environment when we had to migrate off of CirrusCI.
GitHub recently announced that they now have Apple Silicon MacOS machines so, we are back in business and MacOS on Apple Silicon is once again a supported platform.
Fix for potential memory corruption in Array.copy_to
Array.copy_to
did not check whether the source or destination Arrays had been initialized or whether the requested number of elements to be copied exceeded the number of available elements (allocated memory). These issues would result in potential dereferencing of a null pointer or attempts to access unallocated memory.
Before this fix, the following code would print 11
then 0
:
actor Main
new create(e: Env) =>
var src: Array[U8] = [1]
var dest: Array[U8] = [11; 1; 2; 3; 4; 5; 6]
try
e.out.print(dest(0)?.string())
end
src.copy_to(dest, 11, 0, 10)
try
e.out.print(dest(0)?.string())
end
After the fix, this code correctly prints 11
and 11
.
Fix esoteric bug with serializing bare lambdas
Almost no one uses bare lambdas. And even fewer folks end up passing them through the Pony serialization code. So, of course, Red Davies did just that. And of course, he found a bug.
When we switched to LLVM 15 in 0.54.1, we had to account for a rather large change with how LLVM handles pointer and types. In the process of doing that update, a mistake was made and serializing of bare lambdas was broken.
We've made the fix and introduced a regression test. Enjoy your fix Red!
Add constrained types package to standard library
We've added a new package to the standard library: constrained_types
.
The constrained_types
package allows you to represent in the type system, domain rules like "Username must be 6 to 12 characters in length and only container lower case ASCII letters".
To learn more about the package, checkout its documentation on the standard library docs site.
You can learn more about the motivation behind the package by reading the RFC.
[0.58.2] - 2024-02-24
Fixed
- Fix for potential memory corruption in
Array.copy_to
(PR #4490) - Fix bug when serializing bare lambdas (PR #4486)
Added
0.58.1
Fix missing "runtime_info" package documentation
The documentation for the "runtime_info" package wasn't being generated. We've fixed that oversight.
Use the correct LLVM intrinsics for powi
on *nix.
We were using outdated LLVM intrinsics llvm.powi.f32
j and llvm.powi.f64
; updated to use llvm.powi.f32.i32
and llvm.powi.f64.i32
.
[0.58.1] - 2024-01-27
Fixed
0.58.0
Disallow return
at the end of a with
block
When we reimplemented with
blocks in 2022, we allowed the usage of return
at the end of the block. Recent analysis of the generated LLVM flagged incorrect LLVM IR that was generated from such code.
Upon review, we realized that return
at the end of a with
block should be disallowed in the same way that return
at the end of a method is disallowed.
This a breaking change. If you had code such as:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
return
end
You'll need to update it to:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
end
The above examples are semantically the same. This also fixes a compiler crash if you had something along the lines of:
actor Main
new create(env: Env) =>
with d = Disposble do
d.set_exit(10)
return
end
let x = "foo"
Where you had code "after the return" which would be unexpected by the compiler.
Turn on verify
pass by default
The verify
compiler pass will check the LLVM IR generated for the program being compiled for errors. Previously, you had to turn verify on. It is now on by default and can be turned off using the new --noverify
option.
We decided to turn on the pass for two reasons. The first is that it adds very little overhead to normal compilation times. The second is it will help generate error reports from Pony users for lurking bugs in our code generation.
The errors reported don't generally result in incorrect programs, but could under the right circumstance. We feel that turning on the reports will allow us to find and fix bugs quicker and help move us closer to Pony version 1.
[0.58.0] - 2023-11-24
Changed
0.57.1
Fix compiling Pony programs on x86 MacOS when XCode 15 is the linker
With the introduction of XCode 15, you could no longer link Pony programs on x86 MacOS. We've fixed the issue. Apple Silicon was uneffected.
[0.57.1] - 2023-10-29
Fixed
- Fix compiling Pony programs on X86 MacOS when XCode 15 is the linker (PR #4466)
0.57.0
Fix broken DTrace support
Quite a while back, we broke the support in our Makefile for building the Pony runtime with support for DTrace. We've fixed that and added tests to assure it builds.
Fix compilation error when building with pool_memalign in release mode
When attempting to build the Pony runtime with the pool_memalign
option, users would encounter a compilation error if building a release
rather than debug
version of the runtime. We've fixed the compilation error and added CI testing to verify we don't get a regression.
Fix compiler bug that allows an unsafe data access pattern
In November of last year, core team member Gordon Tisher identified a bug in the type system implementation that allowed sharing of data that shouldn't be shareable.
The following code should not compile:
class Foo
let s: String box
new create(s': String box) =>
s = s'
fun get_s(): String val =>
// this is unsafe and shouldn't be allowed
recover val s end
actor Main
new create(env: Env) =>
let s = String
s.append("world")
let foo = Foo(s)
env.out.print("hello " + foo.get_s())
Upon investigation, we found that this bug goes back about 8 or 9 years to the when viewpoint adaptation was introduced into the Pony compiler.
We've fixed the logic flaw and added tests to verify that it can't be reintroduced.
This will potentially break your code if you coded an unsafe recover block that the compiler previously allowed.
[0.57.0] - 2023-10-08
Fixed
- Fix broken DTrace support (PR #4453)
- Fix compilation error when building with pool_memalign in release mode (PR #4455)
- Fix compiler bug that allows an unsafe data access pattern (PR #4458)
Changed
- Fix compiler bug that allows an unsafe data access pattern (PR #4458)