Closed WarrenWeckesser closed 3 years ago
Thanks for filing this. Top of tree (ed55ead) builds cleanly for me now on Linux pop-os 5.13.0-7620-generic #20~1634827117~21.04~874b071-Ubuntu SMP Fri Oct 29 15:06:55 UTC x86_64 x86_64 x86_64 GNU/Linux
and seems to work okay, though the test harness is failing with a kernel oops. Let me know if you run into any more problems.
Thanks! It compiles cleanly now.
I also see a bunch of "Segmentation fault (core dumped)", "Aborted (core dumped)" and "critical error" messages in the output files generated by make test
. E.g.
warren@pop-os:~/repos/git/forks/owl$ make
cc -O3 -std=c11 -pedantic -Wall -Wno-missing-braces -Wno-overlength-strings -o owl src/*.c -ldl
warren@pop-os:~/repos/git/forks/owl$ make test
sh -c 'cd test; for i in *.owltest; do ../owl -T "$i" > "results/$i.stdout" 2> "results/$i.stderr"; done;:'
sh -c 'TMP=`mktemp`; cd test; for i in *.owltest; do ../owl -T -c -o "$TMP" "$i" > "results/$i.cc-stdout" 2> "results/$i.cc-stderr"; done; rm "$TMP";:'
git diff --stat --exit-code test/results
test/results/afl-crash-e.owltest.cc-stderr | 8 +++-
test/results/bracket-states.owltest.cc-stderr | 6 +++
test/results/bracket-states.owltest.cc-stdout | 1 -
test/results/expr-flat.owltest.cc-stderr | 8 +++-
test/results/expr.owltest.cc-stderr | 8 +++-
test/results/grammar.owltest.cc-stderr | 6 +++
test/results/grammar.owltest.cc-stdout | 178 --------------------------------------------------------------------------------
test/results/json.owltest.cc-stderr | 9 +++-
test/results/something.owltest.cc-stderr | 6 +++
test/results/something.owltest.cc-stdout | 1 -
test/results/stmt-crash.owltest.cc-stderr | 6 +++
test/results/stmt-crash.owltest.cc-stdout | 7 ----
test/results/treehouse.owltest.cc-stderr | 6 +++
test/results/treehouse.owltest.cc-stdout | 1 -
14 files changed, 55 insertions(+), 196 deletions(-)
make: *** [Makefile:35: test] Error 1
A few of the diffs:
warren@pop-os:~/repos/git/forks/owl$ git diff test/results/json.owltest.cc-stderr
diff --git a/test/results/json.owltest.cc-stderr b/test/results/json.owltest.cc-stderr
index d0bf8c8..a874a2d 100644
--- a/test/results/json.owltest.cc-stderr
+++ b/test/results/json.owltest.cc-stderr
@@ -1,2 +1,7 @@
-parse error: more input needed
-error: 'test executable' exited with status 255
+malloc(): smallbin double linked list corrupted
+Aborted (core dumped)
+<stdin>:1: warning: ISO C forbids an empty translation unit [-Wpedantic]
+cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
+/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
+(.text+0x24): undefined reference to `main'
+collect2: error: ld returned 1 exit status
warren@pop-os:~/repos/git/forks/owl$ git diff test/results/stmt-crash.owltest.cc-stderr
diff --git a/test/results/stmt-crash.owltest.cc-stderr b/test/results/stmt-crash.owltest.cc-stderr
index e69de29..2160bbb 100644
--- a/test/results/stmt-crash.owltest.cc-stderr
+++ b/test/results/stmt-crash.owltest.cc-stderr
@@ -0,0 +1,6 @@
+Segmentation fault (core dumped)
+<stdin>:1: warning: ISO C forbids an empty translation unit [-Wpedantic]
+cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
+/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
+(.text+0x24): undefined reference to `main'
+collect2: error: ld returned 1 exit status
warren@pop-os:~/repos/git/forks/owl$ git diff test/results/treehouse.owltest.cc-stderr
diff --git a/test/results/treehouse.owltest.cc-stderr b/test/results/treehouse.owltest.cc-stderr
index e69de29..5211f41 100644
--- a/test/results/treehouse.owltest.cc-stderr
+++ b/test/results/treehouse.owltest.cc-stderr
@@ -0,0 +1,6 @@
+critical error: write to output file failed
+<stdin>:1: warning: ISO C forbids an empty translation unit [-Wpedantic]
+cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
+/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
+(.text+0x24): undefined reference to `main'
+collect2: error: ld returned 1 exit status
Running in valgrind
, it looks like the test harness was writing generated source code to the old, closed FILE instead of the file created by fdopen
. I'm surprised this ever worked (across three different OSes, no less!). In any case, I'm seeing all the tests pass on PopOS using 1c131b9.
Great, all tests pass now.
I am running PopOS (an Ubuntu derivative):
When I run
make
with commit db462c6, I get the following errors and warnings:See, for example this stackoverflow question for a discussion of the problem with the definition of
pid_t
. I can fix that by adding#include <sys/types.h>
insrc/test.h
.The issue with
fdopen
is that it is POSIX-only, and not part of C11.