HaxeFoundation / hashlink

A virtual machine for Haxe
https://hashlink.haxe.org/
MIT License
813 stars 158 forks source link

Latest Flixel causes segfault in HashLink #399

Closed TheSpydog closed 4 years ago

TheSpydog commented 4 years ago

I originally filed this issue in the flixel repo, but I very strongly suspect this is a HashLink bug since all other targets are fine. Unfortunately I was unable to write a minimal test program to demonstrate this behavior, so flixel will need to be installed for testing.


Steps to reproduce:

  1. Install Flixel 4.8.0 and its dependencies from the instructions on this page.
  2. Run flixel c 13 to create a Flappybalt demo project (chosen arbitrarily).
  3. cd Flappybalt
  4. lime test hl

Observed behavior: The game crashes as soon as the "HaxeFlixel" logo text appears. Sometimes (but not always) it provides the following dump:

SIGNAL 11
flixel.input.FlxKeyManager.checkStatus(flixel/input/FlxKeyManager.hx:148)
flixel.input.FlxKeyManager.checkKeyArrayState(flixel/input/FlxKeyManager.hx:270)
flixel.system.frontEnds.SoundFrontEnd.update(flixel/system/frontEnds/SoundFrontEnd.hx:342)
flixel.FlxGame.update(flixel/FlxGame.hx:743)
flixel.FlxGame.step(flixel/FlxGame.hx:677)
flixel.FlxGame.onEnterFrame(flixel/FlxGame.hx:551)
openfl.text.TextField.~set_type.1(lime/app/Module.hx:0)
openfl.events.EventDispatcher.__dispatchEvent(openfl/events/EventDispatcher.hx:402)
openfl.display.DisplayObject.__dispatch(openfl/display/DisplayObject.hx:1407)
openfl.display.Stage.__broadcastEvent(openfl/display/Stage.hx:1158)
openfl.display.Stage.__onLimeRender(openfl/display/Stage.hx:1876)
lime.app._Event_lime_graphics_RenderContext_Void.dispatch(lime/_internal/macros/EventMacro.hx:91)
lime._internal.backend.native.NativeApplication.handleRenderEvent(lime/_internal/backend/native/NativeApplication.hx:370)
@0xAD8EB40
lime._internal.backend.native.NativeApplication.exec(lime/_internal/backend/native/NativeApplication.hx:146)
lime.app.Application.exec(lime/app/Application.hx:150)
$ApplicationMain.create(ApplicationMain.hx:130)
$ApplicationMain.main(ApplicationMain.hx:25)
fun$10476(?:1)
@0xB294FA0
ncannasse commented 4 years ago

You can try to compile with -D hl-check to see if it's a VM typing bug. Also it can come from Lime/Hashlink that could have some bug in C++ side.

Le ven. 10 juil. 2020 à 03:08, Caleb Cornett notifications@github.com a écrit :

  • Haxe version: 4.1.2
  • HashLink version: 1.11.0, haxelib 0.1.0
  • Platforms: macOS, Linux

I originally filed this issue in the flixel repo https://github.com/HaxeFlixel/flixel/issues/2260, but I very strongly suspect this is a HashLink bug since all other targets are fine. Unfortunately I was unable to write a minimal test program to demonstrate this behavior, so flixel will need to be installed for testing.

Steps to reproduce::

  1. Install Flixel 4.8.0 and its dependencies from the instructions on this page https://haxeflixel.com/documentation/install-haxeflixel/.
  2. Run flixel c 13 to create a Flappybalt demo project (chosen arbitrarily).
  3. cd Flappybalt
  4. lime test hl

Observed behavior: The game crashes as soon as the "HaxeFlixel" logo text appears. Sometimes (but not always) it provides the following dump:

SIGNAL 11 flixel.input.FlxKeyManager.checkStatus(flixel/input/FlxKeyManager.hx:148) flixel.input.FlxKeyManager.checkKeyArrayState(flixel/input/FlxKeyManager.hx:270) flixel.system.frontEnds.SoundFrontEnd.update(flixel/system/frontEnds/SoundFrontEnd.hx:342) flixel.FlxGame.update(flixel/FlxGame.hx:743) flixel.FlxGame.step(flixel/FlxGame.hx:677) flixel.FlxGame.onEnterFrame(flixel/FlxGame.hx:551) openfl.text.TextField.~set_type.1(lime/app/Module.hx:0) openfl.events.EventDispatcher.dispatchEvent(openfl/events/EventDispatcher.hx:402) openfl.display.DisplayObject.dispatch(openfl/display/DisplayObject.hx:1407) openfl.display.Stage.broadcastEvent(openfl/display/Stage.hx:1158) openfl.display.Stage.onLimeRender(openfl/display/Stage.hx:1876) lime.app._Event_lime_graphics_RenderContext_Void.dispatch(lime/_internal/macros/EventMacro.hx:91) lime._internal.backend.native.NativeApplication.handleRenderEvent(lime/_internal/backend/native/NativeApplication.hx:370) @0xAD8EB40 lime._internal.backend.native.NativeApplication.exec(lime/_internal/backend/native/NativeApplication.hx:146) lime.app.Application.exec(lime/app/Application.hx:150) $ApplicationMain.create(ApplicationMain.hx:130) $ApplicationMain.main(ApplicationMain.hx:25) fun$10476(?:1) @0xB294FA0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hashlink/issues/399, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZXQDRIWVRMCV2KFK7ZBDR2ZSXZANCNFSM4OWD3Q3A .

TheSpydog commented 4 years ago

I compiled the app with -D hl-check and it displayed the following:

Error: 
flixel/input/FlxKeyManager.hx:147: Check failure at fun@5447 @1 - Register 4(f64) should be dyn and not f64
ncannasse commented 4 years ago

Seems like either a Haxe compiler bug or a Flixel sources bug wrongly using HL low level arrays.

Le ven. 10 juil. 2020 à 13:59, Caleb Cornett notifications@github.com a écrit :

I compiled the app with -D hl-check and it displayed the following:

Error: flixel/input/FlxKeyManager.hx:147: Check failure at fun@5447 @1 - Register 4(f64) should be dyn and not f64

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hashlink/issues/399#issuecomment-656638204, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZXQAZTCWNZCLR6Q35JULR237B3ANCNFSM4OWD3Q3A .

TheSpydog commented 4 years ago

After more testing I was able to reproduce the issue with a small test case completely separate from flixel, so I'll open an issue on the main Haxe repo. Thanks for the guidance.