Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interacting with browser from web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) [regression between Emscripten 3.1.39 and 3.1.53] #88249

Closed
DusanFedorcak opened this issue Feb 12, 2024 · 4 comments · Fixed by #88594

Comments

@DusanFedorcak
Copy link

DusanFedorcak commented Feb 12, 2024

Tested versions

  • Reproducible in v4.3.dev3.official [36e943b]
  • No such problems in 4.2 [stable]

System information

MacOS Ventura 13.5.2 (22G91), Chrome 121.0.6167.160 (arm64)

Issue description

Almost any interaction with browser from a running web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) e.g.

  • document.createElement() call from the game
  • calls to custom functions from modules imported in page head
  • but console.log() calls work from within godot

Steps to reproduce

  • create a new project
  • add a new script to the main node with the following code
  • add web export and run the game using Run In Browser option in the Godot editor
extends Node2D


var _document = JavaScriptBridge.get_interface('document')
var _window = JavaScriptBridge.get_interface('window')
var _console = JavaScriptBridge.get_interface('console')


# Called when the node enters the scene tree for the first time.
func _ready():
	_add_js_function()


func _add_js_function():
	_console.log("HELLO FROM GODOT!")	
	var script_txt = "function testFunction() { console.log('Hello from test function!') }"
	# Create the block - here it raises the error
	var script_block = _document.createElement('script')
	script_block.id = 'testFunction'
	var text_block = _document.createTextNode(script_txt)
	script_block.appendChild(text_block)
	_document.head.appendChild(script_block)
	_console.log("FINISH!")

Minimal reproduction project (MRP)

web3_test_dev4.3.zip

Production edit: added the gdscript syntax highlighting

@DusanFedorcak DusanFedorcak changed the title Interacting with browser from web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) [4.3.dev] Interacting with browser from web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) Feb 12, 2024
@mfmoreno
Copy link

Works fine with 4.3dev2. It seems this issue was introduced on 4.3dev3

@TechnoLukas
Copy link

Confirm. Having same issue on 4.3dev3.

@akien-mga akien-mga added this to the 4.3 milestone Feb 15, 2024
@akien-mga akien-mga changed the title [4.3.dev] Interacting with browser from web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) Interacting with browser from web-exported game results in Aborted(to do setValue(i64) use WASM_BIGINT) [regression between Emscripten 3.1.39 and 3.1.53] Feb 15, 2024
@akien-mga
Copy link
Member

For 4.3-dev3 we updated Emscripten from 3.1.39 to 3.1.53. The error is likely caused by this.

@akien-mga akien-mga moved this from Unassessed to Immediate Blocker in 4.x Release Blockers Feb 15, 2024
@akien-mga
Copy link
Member

I bisected Emscripten versions, the issue was introduced in 3.1.41: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#3141---060623

    A new setting (CHECK_NULL_WRITES) was added to disabled the checking of address zero that is normally done when STACK_OVERFLOW_CHECK is enabled. (#19487)
    compiler-rt updated to LLVM 16. (#19506)
    libcxx and libcxxabi updated to LLVM 16. (#)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Immediate Blocker
Development

Successfully merging a pull request may close this issue.

6 participants