What's with the "Error: hd" error in the latest Haxe?

48 views
Skip to first unread message

TopHattedCoder

unread,
Mar 2, 2013, 4:04:49 PM3/2/13
to haxe...@googlegroups.com
It's not very descriptive and is now showing up in my new project which uses a lot of Abstract Types. Is this a bug?

Simon Krajewski

unread,
Mar 2, 2013, 4:13:44 PM3/2/13
to haxe...@googlegroups.com
Am 02.03.2013 22:04, schrieb TopHattedCoder:
> It's not very descriptive and is now showing up in my new project
> which uses a lot of Abstract Types. Is this a bug? --

Are you on RC or on SVN? There were at least two bugs which caused this
that have been fixed recently.

It happens if there is a typing error somewhere and the compiler tries
to continue typing regardless, leading to an invalid state and assertion
failures.

Simon

TopHattedCoder

unread,
Mar 3, 2013, 6:01:58 AM3/3/13
to haxe...@googlegroups.com
Ah, so all I need to do is update to the latest Haxe. I've been working with SVN Haxe but from 3-4 days ago. I'll see if updating fixes it, thanks!

TopHattedCoder

unread,
Mar 3, 2013, 6:06:47 AM3/3/13
to haxe...@googlegroups.com
Weird, I'm still getting it. I'll try adding some flags and see if any of them solve it...

TopHattedCoder

unread,
Mar 3, 2013, 6:09:58 AM3/3/13
to haxe...@googlegroups.com
Full context with verbose mode:

Parsed /usr/lib/haxe/std/Date.hx
Parsed /usr/lib/haxe/std/Std.hx
Generating js : deploy/html5/deploy.js
Error: hd

Simon Krajewski

unread,
Mar 3, 2013, 6:10:00 AM3/3/13
to haxe...@googlegroups.com
Am 03.03.2013 12:06, schrieb TopHattedCoder:
> Weird, I'm still getting it. I'll try adding some flags and see if any
> of them solve it...

Are you compiling it yourself or using a nightly? Also, what OS are you on?

Simon

TopHattedCoder

unread,
Mar 3, 2013, 6:19:44 AM3/3/13
to haxe...@googlegroups.com
I'm compiling it myself on a 64-bit Linux Mint laptop using a build script I compiled from the Haxe 3 Linux Compilation guide.

Simon Krajewski

unread,
Mar 3, 2013, 6:21:58 AM3/3/13
to haxe...@googlegroups.com
Am 03.03.2013 12:19, schrieb TopHattedCoder:
> I'm compiling it myself on a 64-bit Linux Mint laptop using a build
> script I compiled from the Haxe 3 Linux Compilation guide.

Please do the following:
1. remove the "| Failure msg" from here:
https://code.google.com/p/haxe/source/browse/trunk/main.ml#1266
2. define environment variable "OCAMLRUNPARAM" with value "b"
3. try to compile again
4. paste the resulting stacktrace

Thanks!
Simon

TopHattedCoder

unread,
Mar 3, 2013, 6:34:07 AM3/3/13
to haxe...@googlegroups.com
Parsed /usr/lib/haxe/std/haxe/ds/IntMap.hx
Parsed /usr/lib/haxe/std/haxe/ds/ObjectMap.hx
Parsed /usr/lib/haxe/std/Reflect.hx

Parsed /usr/lib/haxe/std/Date.hx
Parsed /usr/lib/haxe/std/Std.hx
Generating js : deploy/html5/deploy.js
Fatal error: exception Failure("hd")
Raised at file "pervasives.ml", line 22, characters 22-33
Called from file "typer.ml", line 606, characters 48-64
Called from file "typer.ml", line 764, characters 11-76
Called from file "typer.ml", line 914, characters 2-93
Called from file "typer.ml", line 1952, characters 24-32
Called from file "list.ml", line 74, characters 24-34
Called from file "typer.ml", line 2041, characters 5-61
Called from file "typer.ml", line 2054, characters 2-20
Called from file "typer.ml", line 2150, characters 14-40
Called from file "typecore.ml", line 259, characters 32-64
Called from file "typer.ml", line 2645, characters 9-77
Called from file "typecore.ml", line 259, characters 32-64
Called from file "typer.ml", line 482, characters 4-37
Called from file "typer.ml", line 482, characters 4-37
Called from file "typer.ml", line 482, characters 4-37
Called from file "typer.ml", line 3097, characters 21-66
Called from file "typer.ml", line 2257, characters 6-31
Called from file "typer.ml", line 2254, characters 9-15
Called from file "typer.ml", line 2254, characters 9-15
Called from file "typer.ml", line 2267, characters 10-16
Called from file "typecore.ml", line 259, characters 32-64
Called from file "typeload.ml", line 1523, characters 21-58
Called from file "typecore.ml", line 336, characters 3-6
Called from file "type.ml", line 598, characters 9-15
Called from file "typer.ml", line 3035, characters 31-46
Called from file "typer.ml", line 2257, characters 6-31
Called from file "typer.ml", line 2267, characters 10-16
Called from file "typecore.ml", line 259, characters 32-64
Called from file "typeload.ml", line 1523, characters 21-58
Called from file "typecore.ml", line 336, characters 3-6
Called from file "typeload.ml", line 1759, characters 39-47
Called from file "typecore.ml", line 326, characters 3-6
Called from file "main.ml", line 1149, characters 2-21
Called from file "main.ml", line 448, characters 3-11
Called from file "main.ml", line 1357, characters 1-35

Simon Krajewski

unread,
Mar 3, 2013, 7:02:51 AM3/3/13
to haxe...@googlegroups.com
Thanks a lot, it seems to come from calling something on an abstract which should not be called. I catch the List.hd case in r6366, please try again with that. I'm also interested in what code caused it.

Simon

TopHattedCoder

unread,
Mar 3, 2013, 8:13:14 AM3/3/13
to haxe...@googlegroups.com
Thanks for the swift fix.

TopHattedCoder

unread,
Mar 3, 2013, 8:16:52 AM3/3/13
to haxe...@googlegroups.com
It was thrown because in my Graphics class I'd tried to make a way to back-reference the Texture by converting it to a bitmapdata then into a texture since they've got the same underlying type.

    inline function get_texture():Texture {
        var bd:BitmapData = this;
        return bd;
    }

TopHattedCoder

unread,
Mar 3, 2013, 8:30:04 AM3/3/13
to haxe...@googlegroups.com
I fixed it by removing the inline. Weird.

Simon Krajewski

unread,
Mar 3, 2013, 8:31:28 AM3/3/13
to haxe...@googlegroups.com
Am 03.03.2013 14:30, schrieb TopHattedCoder:
> I fixed it by removing the inline. Weird.

Sounds like another bug. Could you post an issue with a reproducible
example? https://code.google.com/p/haxe/issues

Thanks!
Simon
Reply all
Reply to author
Forward
0 new messages