Closed fullofcaffeine closed 5 years ago
Retried the test suite after pulling the latest updates, the function.txt
test case still fails with a StackOverflow
error:
Running test case `function.txt`...
Stack overflow
wow, I even added tests for this
The Stack overflow
comes from OCaml code, could you try setting env var OCAMLRUNPARAM=b
and see if that gives a stacktrace?
@nadako An excerpt of the stacktrace follows. The Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
line just repeats until it ends in the stack overflow ~3000 iterations afterwards (found out by counting the lines of the stacktrace):
Fatal error: exception Stack overflow
Raised by primitive operation at file "hashtbl.ml", line 163, characters 11-24
Called from file "hashtbl.ml", line 169, characters 18-34
Called from file "_build/src/macro/eval/evalHash.ml", line 26, characters 1-32
Called from file "_build/src/macro/eval/evalEncode.ml", line 125, characters 36-44
Called from file "list.ml", line 55, characters 20-23
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "list.ml", line 55, characters 32-39
Called from file "_build/src/macro/eval/evalEncode.ml", line 125, characters 12-50
Called from file "_build/src/macro/eval/evalEmitter.ml", line 441, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 79, characters 23-31
Called from file "_build/src/macro/eval/evalEmitter.ml", line 245, characters 7-18
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
Called from file "_build/src/macro/eval/evalEmitter.ml", line 744, characters 9-17
...
Using Haxe 4.0.0-rc.2+77068e1
on Linux Mint.
If you need any additional info, let me know.
Hmm, this looks to me like some self-referencing object is tried to get encoded from/to macro, or something...
In theory, OCaml errors should not surface to the user, but I'm not sure about cases like this. cc @Simn
@nadako Reported this issue @ the Haxe repo as well seems it seems it's an issue in the eval target.
@RealyUniqueName found the root of the issue, it's not really a Haxe bug, but happened due to a change in the way Null<>
is represented by Haxe 4:
This is indeed self-recursive function.
This line: https://github.com/nadako/hxtsdgen/blob/8244c17/src/hxtsdgen/TypeRenderer.hx#L51
It recurses infinitely on Null<Int>.
In Haxe 3.4 Null was a typedef and avoided that branch of renderType function. Now Null is an abstract and goes to that branch.
Source: https://github.com/HaxeFoundation/haxe/issues/8303#issuecomment-494012128.
Look like we need to fix the issue in hxtsdgen
.
Just started looking at this lib as I'd like to integrate it with hxgenjs. Checked it out locally and trying to run tests after compiling with Haxe 4RC2:
Not sure if this affects the actual usage of the lib, will report if so.