Troubleshooting (flowlog.c)

Code references (section markers in flowlog.c):

Stack overflows / crashes under OR-par

OR-par workers run deep recursive solver code and can overflow small pthread stacks.

Try:

Stack overflows on Linux / small ulimit -s

Many Linux distributions default to a small main-thread stack (often 8 MiB, see ulimit -s). Deep interpreter recursion (for example make quad, which runs --engine tree) can overflow this stack.

Options:

By default, Flowlog auto-enables this boost when it detects a small RLIMIT_STACK (below ~16 MiB).

“It’s only using one core”

Parallelism is enabled by default (flowlog_parallel_profile=fast) (SECTION 25).

If you only see one core in use, check:

Also confirm Flowlog sees your CPU count (SUBSECTION 04.2):

Notes:

REPL editing keys don’t work

The line editor is enabled only when stdin/stdout are TTYs (SUBSECTION 26.2). If you run the REPL via redirected input/output, Flowlog falls back to plain line reads (SECTION 26).

History file issues

History is written to (SUBSECTION 26.2):

Override with:

“My terminal output is staircasing / newlines look wrong”

If your terminal looks like output is indented further and further to the right, your terminal may have been left in a bad termios state after a crash.

Fix:

reset

[file]. doesn’t load my program”

Flowlog supports the common top-level consult shorthand, but it only works when the file can be resolved on disk (SECTION 25 and SECTION 26).

Try:

Parse and syntax errors (with context)

When Flowlog fails to parse a program, it reports the unexpected token (or expected token), file/line/column, and a one-line source excerpt with a caret (SECTION 10 and SECTION 25):

flowlog: fatal error (240): flowlog: unexpected token while parsing term: ) (TOK_RPAREN)
  at program.pl:1:6
  expected one of: '(', '[', atom, string, number, variable
  (')' closes a group/call; a term was expected before it)
  1 | p :- ).
    |      ^

For read/1,2 and read_term/2,3, lexer syntax errors (for example illegal_character_escape) also print the same kind of file context to stderr, in addition to throwing the usual error(syntax_error(...), read_term/N) exception (SECTION 17):

flowlog: syntax error: illegal_character_escape
  at data.term:1:3
  (invalid character escape in a quoted atom/string)
  1 | "a\q".
    |   ^