Skip to content

chore: add filc compile target - #11

Merged
steve-chavez merged 5 commits into
PostgREST:masterfrom
steve-chavez:master
Sep 7, 2026
Merged

steve-chavez merged 5 commits into
PostgREST:masterfrom
steve-chavez:master

Conversation

@steve-chavez

Copy link
Copy Markdown
Member

@steve-chavez

Copy link
Copy Markdown
Member Author

fil-c fails with an interesting error:

=== TEST: basic parsers

filc safety error: cannot read pointer with null object.
    pointer: 0x10,<null>
    expected 8 bytes.
semantic origin:
    (basic) <somewhere>: cpc_basic_test_run
check scheduled at:
    (basic) <somewhere>: cpc_basic_test_run
    (basic) <somewhere>: main
    (libc.so.6666) ../sysdeps/nptl/libc_start_call_main.h:58:16: __libc_start_call_main
    (libc.so.6666) ../csu/libc-start.c:161:3: __libc_start_main
    (libpizlo.so) <runtime>: start_program
[3397] filc panic: thwarted a futile attempt to violate memory safety.
./test/test.sh: line 13:  3397 Trace/breakpoint trap   (core dumped) ./build/basic

@steve-chavez
steve-chavez force-pushed the master branch 2 times, most recently from a26cdf0 to 043832f Compare September 7, 2026 02:15
@steve-chavez

steve-chavez commented Sep 7, 2026 •

Copy link
Copy Markdown
Member Author

So the underlying bug (676d272) was not surfaced with gcc because of the optimizer dead code elimination, we compiled with -O3. Now with -O0 (043832f) a segfault appears with gcc and clang too.


The freestanding test fails on clang, see #12, for now we skip this test ( 248bdb5)

otherwise it fails the freestanding test
This surfaces a match parser segfault, otherwise it gets eliminated by
the optimizer.

The bench target keeps its -O3.
It fails, because for some reason it calls memset/memcpy
The match parser referenced a null pointer when passing a null arena.

This was caught by filc:

```
The match parser works...
filc safety error: cannot read pointer with null object.
[3397] filc panic: thwarted a futile attempt to violate memory safety.
```

And also segfaults under gcc/clang when compiled with `-O0`.
@steve-chavez
steve-chavez marked this pull request as ready for review September 7, 2026 02:56
@steve-chavez
steve-chavez merged commit 9f45164 into PostgREST:master Sep 7, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant