Skip to content

32-bit graph copying from client broken after enabling position-independent code in GraphCopy

Summary

The jsSerializeOnClient function with deserialize_from_prelinked_interpreter is broken since the GraphCopy libraries are built with position-independent code for this platform (clean-libraries!21), causing segmentation faults.

Steps to reproduce

The following program runs fine on x64 linux, and on x86 with clean-libraries!21 reverted. On the current x86 build it fails with a segmentation fault.

module WasmTest

import StdEnv
import Text.Encodings.Base64
import iTasks
import iTasks.Extensions.JavaScript
import iTasks.Internal.IWorld
import iTasks.Internal.Task
import ABC.Interpreter
import ABC.Interpreter.JavaScript

Start w = doTasks task w
where
	task =
		accJSWorld
			(\w
				# (v,w) = jsSerializeOnClient [1,2,3] w
				# (v,w) = jsForceFetch v w
				-> v .?? ("???", w)) >>~ \val ->
		mkInstantTask
			(\_ iworld=:{IWorld | abcInterpreterEnv} ->
				case deserialize_from_prelinked_interpreter (base64Decode val) abcInterpreterEnv of
					(val, 0) -> (Ok val, iworld)
					_ -> (Error (exception "deserialization failed"), iworld)) @ integers >>-
		viewInformation [] o toSingleLineText
	with
		integers :: [Int] -> [Int]
		integers xs = xs

Possible fixes

Unknown as yet.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information