Skip to content

Tests: add ChibiOS crt0 entry fixtures - #203

Open
zardus wants to merge 2 commits into
masterfrom
codex/chibios-crt0-entry-fixtures
Open

Tests: add ChibiOS crt0 entry fixtures#203
zardus wants to merge 2 commits into
masterfrom
codex/chibios-crt0-entry-fixtures

Conversation

@zardus

@zardus zardus commented Aug 27, 2026

Copy link
Copy Markdown
Member

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Problem

The convergent-exit decompiler regression in the linked angr consumer needs compiler-produced Thumb code from ChibiOS _crt0_entry at 0x080001e0. The binaries baseline has no fixture for any of the three optimization variants.

Root cause

The behavior was isolated in public DecBench ELF files, but the consumer test needs stable raw code slices and cannot download or extract them at run time.

Fix

Add the exact 134-byte _crt0_entry body from each O0, O2, and O2-noinline ChibiOS ELF. Record pinned DecBench and ChibiOS revisions, source hashes, load address, extraction offset, and the upstream GPLv3 license.

Testing

Extracting 134 bytes at file offset 0x11e0 reproduces every committed slice byte-for-byte. The validation record includes all source and fixture hashes, modes, consumer-gate evidence, and content-identical rebase proof.

Validation: #203 (comment)

sync: angr/angr#6697

session: sharpen

@zardus

zardus commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Validation record for head fbb5b07ee17f0653583f27be08a2c46b38454794 against baseline a87538bc248531d2a1d22434143e8b9752459bac.

  • Format/header: O0.bin, O2.bin, and O2-noinline.bin are raw 134-byte Thumb code slices, not object files; class, endianness, object type, and machine headers are therefore not applicable
  • Source headers: all three source files are ELF32, little-endian, ET_EXEC, ARM EABI5 soft-float; file offset 0x11e0 is .text address 0x080001e0, and readelf -sW reports Thumb _crt0_entry at 0x080001e1
  • Source identities: O0 SHA-256 275e02bf674b30c532bd52c3f725c08803b3a50f4af1eca53a3e3b4e687cae82; O2 93c66042d92118f1762e3b638f441889ee2e8117c4e24147ac1cb58979937ef4; O2-noinline ab1ca2ae291d4aa14729ec5163c75046236397e6cf9d979f89809c3b0e2d5fa4
  • Reproduction: extracting exactly 134 bytes at source offset 0x11e0 reproduced all three committed slices byte-for-byte
  • Fixture identities: O0 SHA-256 04fb3da906b18e90974107ddec9a9c2eab502ffd1071690925388edb79b293ab; O2 9d9433c2259734e6aa1a00cdf43f798d600bf415747fb535ad3f11ecddcdeedf; O2-noinline 126a82c94f7ef90e7a2a94b1ae587df6be534af85144f0f3bd2f1fc1f988aed0; each has Git mode 0644
  • Provenance: public DecBench revision e5eb576d66ee36793b800a4dd45e291e0add4472; matching ChibiOS 21.11.5 commit f4bbadf964fc746aef8bbcf34135c7d8fabb8eae; pinned upstream GPLv3 license is adjacent
  • Consumer: Decompiler: recognize convergent conditional exits angr#6697 remains open, non-draft, mergeable, and clean at 8d8223b09e34c8e233e875cc9ab490bbd8736527, with sync: angr/binaries#203
  • Integrated validation: test-input policy and configured hooks passed; the adopted consumer gate passed 2,533 tests, 46 skipped, 2 xfailed, 260 subtests, and 35 Rust tests
  • Hosted checks: angr/binaries has no hosted check contexts on this head

Caveat: the fixture repository has no independent executable suite; the raw slices are exercised by the coordinated consumer regression.

  • Rebase verification: rebased 3bfd1de09dd357deafbe29b4075aa55a9379ce50..59cfa9d45b0c09b2d967dae2119a2b9d7713a580 onto binaries master a87538bc248531d2a1d22434143e8b9752459bac, yielding fbb5b07ee17f0653583f27be08a2c46b38454794 with 1 commit before and after. Full git range-diff --no-dual-color reads 1: 59cfa9d = 1: fbb5b07 Add ChibiOS crt0 entry fixtures. The context-discarded patch comparison is empty, and raw status, modes, paths, and blob IDs are identical. Plain git diff 59cfa9d45b0c09b2d967dae2119a2b9d7713a580 fbb5b07ee17f0653583f27be08a2c46b38454794 adds only master content: tests/aarch64/windows/fastfail_arm64.exe, tests/armel/windows/fastfail_armnt.exe, tests_src/windows/fastfail_arm/build.sh, tests_src/windows/fastfail_arm/fastfail.c. All pull-request paths retain their exact modes, blob IDs, sizes, and SHA-256 hashes.

session: decbench

@zardus

zardus commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

THIS MESSAGE WAS GENERATED BY AN AUTOMATED PROCESS

Full fixture state for _crt0_entry at 0x080001e0 in the three ChibiOS optimization variants, before and after this change.

Before — the exact baseline has no ChibiOS slice directory:

binaries master a87538b
$ git ls-tree -r --name-only a87538bc248531d2a1d22434143e8b9752459bac -- tests/armel/chibios_crt0_entry
(no output; paths absent)

After — all three committed raw slices and their pinned public source ELFs are identified exactly:

with this change at fbb5b07
$ git ls-tree fbb5b07ee17f0653583f27be08a2c46b38454794 -- tests/armel/chibios_crt0_entry/O0.bin tests/armel/chibios_crt0_entry/O2.bin tests/armel/chibios_crt0_entry/O2-noinline.bin
100644 blob 00b5e43fcf1ff7c7821ea14a44754e91bcfe0bd4	tests/armel/chibios_crt0_entry/O0.bin
100644 blob 35b786e9861f090204cb30cdd674b2ed24248f69	tests/armel/chibios_crt0_entry/O2-noinline.bin
100644 blob f249fa9e448728d27c80c7dde0cd14cfa6066061	tests/armel/chibios_crt0_entry/O2.bin
$ stat -c '%n size=%s mode=%a' tests/armel/chibios_crt0_entry/O0.bin tests/armel/chibios_crt0_entry/O2.bin tests/armel/chibios_crt0_entry/O2-noinline.bin
tests/armel/chibios_crt0_entry/O0.bin size=134 mode=644
tests/armel/chibios_crt0_entry/O2.bin size=134 mode=644
tests/armel/chibios_crt0_entry/O2-noinline.bin size=134 mode=644
$ sha256sum tests/armel/chibios_crt0_entry/O0.bin tests/armel/chibios_crt0_entry/O2.bin tests/armel/chibios_crt0_entry/O2-noinline.bin
04fb3da906b18e90974107ddec9a9c2eab502ffd1071690925388edb79b293ab  tests/armel/chibios_crt0_entry/O0.bin
9d9433c2259734e6aa1a00cdf43f798d600bf415747fb535ad3f11ecddcdeedf  tests/armel/chibios_crt0_entry/O2.bin
126a82c94f7ef90e7a2a94b1ae587df6be534af85144f0f3bd2f1fc1f988aed0  tests/armel/chibios_crt0_entry/O2-noinline.bin
$ cmp -n 134 -i 4576:0 datasets/decbench/binaries/O0/chibios/ch.elf tests/armel/chibios_crt0_entry/O0.bin; echo $?
0
$ cmp -n 134 -i 4576:0 datasets/decbench/binaries/O2/chibios/ch.elf tests/armel/chibios_crt0_entry/O2.bin; echo $?
0
$ cmp -n 134 -i 4576:0 datasets/decbench/binaries/O2-noinline/chibios/ch.elf tests/armel/chibios_crt0_entry/O2-noinline.bin; echo $?
0

@zardus
zardus force-pushed the codex/chibios-crt0-entry-fixtures branch from 59cfa9d to fbb5b07 Compare August 28, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant