Skip to content

Releases: Techcable/libabort.rs

Handle removal of `core::intrinsics::abort()` on nightly.

Choose a tag to compare

@Techcable Techcable released this 04 Oct 08:19
4044f56

Now uses autocfg so build won't fail when nightly functions are removed in the future.
We migrated to the replacement function core::process::abort_immediate() (still nightly).

Changes

  • Prefer core::process::abort_immediate() to core::arch::wasm64::unreachable() (tnyxtmnq)

Fixes

  • Use autocfg to check if nightly features work before using them (wulnptwt)
    • Avoids build failures caused by the removal of nightly functions.
  • Document use of unwinding past extern "C" on 1.81 (qmvsysnu)
  • On nightly, use core::process::abort_immediately() instead of core::intrinsics::abort() (mxmspryo)
    • The latter has been removed on recent nightly versions.

On Rust 1.81, abort by unwinding past extern "C"

Choose a tag to compare

@Techcable Techcable released this 06 Sep 04:53
ac8d729

In Rust 1.81, unwinding past an extern "C" is guaranteed to produce an abort. This is preferable to the previous fallback behavior of triggering a double panic because it doesn't produce a backtrace.

On previous versions, this functionality is disabled because it triggers undefined behavior.

This only affects the "fallback" behavior when there is no other implementation of abort.

Decrease minimum supported rust version to 1.31.
Use Github Actions for automated testing.

Implement a `trap()` function

Choose a tag to compare

@Techcable Techcable released this 20 Jun 01:26
ba73973

The trap() function issues an illegal instruction on supported architectures, falling back to calling abort() elsewhere. It is semantically equivalent to the llvm.trap and __builtin_abort() intrinsics.

On some architectures, issuing an illegal instruction is cheaper than calling an abort function.

The trap function can be used to implement the abort() function by enabling the trap-via-abort feature. This feature does nothing if the architecture is unsupported.

Currently supported architectures for trap:

  • x86_64
  • i686 (x86)
  • aarch64
  • arm
  • wasm32
  • wasm64

On nightly, the trap function wraps the core::intrisnics::abort() function.

Additional fixes:

  • Use doc(cfg(...)) to document feature requirements
  • Properly configure feature flags for docs.rs
  • Drop rustversion dependency in favor of detection in build.rs script.

Document clear distinction between immediate & fallback aborts

Choose a tag to compare

@Techcable Techcable released this 11 Jun 01:33
e09bb21

Could be important in some safety scenarios, and explains why fallback implementation prints to stderr.

The README.md file could use some cleanup after this.

Forgot to number a version v0.1.5 and made a silly mistake in v0.1.6 which I fixed in the next commit. I yanked v0.1.6 from crates.io because it has no changes except a missing feature-declaration.
I also combined the release notes for v0.1.6 and v0.1.7.

Fix compilation errors with bad config flags

Choose a tag to compare

@Techcable Techcable released this 11 Jun 01:30
9feb6a8

Before this release, the crate didn't really work.
As a result, previous versions will be yanked because they don't reliably work and violate safety guarantees.

Other changes:

  • Support rust versions since 1.54
    • Document MSRV
  • Add abortcli example which just prints & aborts

Add constructor for AbortGuard

Pre-release

Choose a tag to compare

@Techcable Techcable released this 20 May 17:07
048a334

Implement Clone and Default for AbortGuard

Can't believe I forgot a constructor...

Finish describing fallback impl in README

Choose a tag to compare

@Techcable Techcable released this 20 May 17:01
6e11efc

Before this, the sentence was not finished.

Stop using cfg_if! macro

Pre-release

Choose a tag to compare

@Techcable Techcable released this 20 May 16:57
1b3a883

This is an unnecessary dependency.

Initial Release

Initial Release Pre-release
Pre-release

Choose a tag to compare

@Techcable Techcable released this 20 May 16:56
2b46531

An implementation of the abort function that works without the standard library.