Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2023-03

WebAssembly compilation problems - Wasm32 symbol xxx without index value error

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michalis Kamburelis

Hi,

We're experimenting with compiling Castle Game Engine using FPC WebAssembly target.

A lot of units and classes compiled smoothly, however we hit a weird bug(s) at compiling our (big, too big!) unit X3DNodes. We get errors "Wasm32 symbol xxx without index value error" at the code trying to use various property setters or methods. Examples:

x3dcamerautils.pas(344,0) Error: Wasm32 symbol
X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index value error

// where TSFRotation.Value is a property with record type, with getter
and setter methods

x3dcamerautils.pas(344,0) Error: Wasm32 symbol
X3DFIELDS$_$TX3DSIMPLEMULTFIELD$3$CRCD1E2ED59_CRCAB5A7799_$__$$_GETITEMS$$TSINGLELIST without index value error

// where TX3DSimpleMultField.GetItems is a method of a generic class)
x3dcamerautils.pas(344,0) Error: Wasm32 symbol
X3DFIELDS$_$TSFFLOAT_$__$$_SETVALUE$SINGLE without index value error
x3dcamerautils.pas(344,0) Error: Wasm32 symbol
// where TSFFloat.SetValue is a simple setter for a Single property, no generics

castlescenecore.pas(8822,0) Error: Wasm32 symbol
CASTLESHAPEINTERNALSHADOWVOLUMES$_$TSHAPESHADOWVOLUMES_$__$$_PREPARERESOURCES without index value error

// where TShapeShadowVolumes.PrepareResources is a simple method,
without any parameters, in a simple non-generic class

Weirder, on another machine, the symbols reported contain some exe filenames at the place of initial "$_$" (maybe independent compiler bug at message display?):

x3dloadinternalgeo.pas(234,0) Error: Wasm32 symbol X3DFIELDS/usr/bin/dbus-update-activation-environmentTSFFLOAT_$__$$_SETVALUE$SINGLE without index value error

x3dloadinternalgeo.pas(234) Error: Wasm32 symbol
X3DFIELDS/home/michalis/bin/castle-engineTSFFLOAT_$__$$_SETVALUE$SINGLE without index value error

Sometimes the errors can be workarounded by some simple actions -- like moving the property getter/setter protected->private, or avoiding the call to that particular method. But the solutions, as well as causes, seem ~random from our perspective. And all in all, we didn't finish the compilation of X3DNodes unit because after each fix/workaround/hack for a specific case, another similar error pops up.

Grepping FPC for the asmw_e_illegal_unset_index (this is "Wasm32 symbol $1 without index value error"), the error can occur when symbol cannot be found in the list where compiler expected it to be.

We don't have any simple bugreport about it (yet), as the error really manifests only in a big unit, that is interconnected with a few other big units. Isolating the testcase (and/or doing much needed refactor of this unit :) ) will take a while.

Does anyone have a hint:

- What does this error really mean? What is internally wrong at compilation to cause it? What could be the culprit?

- Is there some universal workaround for it (on CGE side) or fix on the compiler side?

Even a vague hint could at least help us prepare an isolated bugreport, because otherwise we have a rather big chunk of code to dissect in order to provide a simple FPC testcase :)

Regards,
Michalis

Reply by email

Kostas Michalopoulos
to Michalis Kamburelis
Michalis Kamburelis wrote 6 lines
We're experimenting with compiling Castle Game Engine using FPC WebAssembly target. [..] x3dcamerautils.pas(344,0) Error: Wasm32 symbol X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index value error

FWIW i experienced the same problem when trying to build my Post Apocalyptic Petra game some months ago as i posted back then:

https://lists.freepascal.org/pipermail/fpc-devel/2022-July/044721.html

Sadly i never found a workaround but it does sound like an issue with whatever generates the wasm code itself instead of the assembler - as mentioned in the message above, trying other assemblers produced different errors.

The errors also seem to be more of a symptom than a cause as, as you also figured out, trying to fix things just move the error around and it happens in various places that do not seem to have much in common.

But i didn't look further into it because i was busy with other stuff. I mainly wanted to make the wasm build for fun and perhaps to put it on the itch.io landing page if it worked fine but that was very low priority.

Kostas

Reply by email

Nikolay Nikolov
to Michalis Kamburelis: We're experimenting with compiling Castle Game Engine using FPC WebAssembly target. A lot…
Michalis Kamburelis wrote 76 lines
Hi, We're experimenting with compiling Castle Game Engine using FPC WebAssembly target. A lot of units and classes compiled smoothly, however we hit a weird bug(s) at compiling our (big, too big!) unit X3DNodes. We get errors "Wasm32 symbol xxx without index value error" at the code trying to use various property setters or methods. Examples: x3dcamerautils.pas(344,0) Error: Wasm32 symbol X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index value error // where TSFRotation.Value is a property with record type, with getter and setter methods x3dcamerautils.pas(344,0) Error: Wasm32 symbol X3DFIELDS$_$TX3DSIMPLEMULTFIELD$3$CRCD1E2ED59_CRCAB5A7799_$__$$_GETITEMS$$TSINGLELIST without index value error // where TX3DSimpleMultField.GetItems is a method of a generic class) x3dcamerautils.pas(344,0) Error: Wasm32 symbol X3DFIELDS$_$TSFFLOAT_$__$$_SETVALUE$SINGLE without index value error x3dcamerautils.pas(344,0) Error: Wasm32 symbol // where TSFFloat.SetValue is a simple setter for a Single property, no generics castlescenecore.pas(8822,0) Error: Wasm32 symbol CASTLESHAPEINTERNALSHADOWVOLUMES$_$TSHAPESHADOWVOLUMES_$__$$_PREPARERESOURCES without index value error // where TShapeShadowVolumes.PrepareResources is a simple method, without any parameters, in a simple non-generic class Weirder, on another machine, the symbols reported contain some exe filenames at the place of initial "$_$" (maybe independent compiler bug at message display?): x3dloadinternalgeo.pas(234,0) Error: Wasm32 symbol X3DFIELDS/usr/bin/dbus-update-activation-environmentTSFFLOAT_$__$$_SETVALUE$SINGLE without index value error x3dloadinternalgeo.pas(234) Error: Wasm32 symbol X3DFIELDS/home/michalis/bin/castle-engineTSFFLOAT_$__$$_SETVALUE$SINGLE without index value error Sometimes the errors can be workarounded by some simple actions -- like moving the property getter/setter protected->private, or avoiding the call to that particular method. But the solutions, as well as causes, seem ~random from our perspective. And all in all, we didn't finish the compilation of X3DNodes unit because after each fix/workaround/hack for a specific case, another similar error pops up. Grepping FPC for the asmw_e_illegal_unset_index (this is "Wasm32 symbol $1 without index value error"), the error can occur when symbol cannot be found in the list where compiler expected it to be. We don't have any simple bugreport about it (yet), as the error really manifests only in a big unit, that is interconnected with a few other big units. Isolating the testcase (and/or doing much needed refactor of this unit :) ) will take a while. Does anyone have a hint: - What does this error really mean? What is internally wrong at compilation to cause it? What could be the culprit? - Is there some universal workaround for it (on CGE side) or fix on the compiler side? Even a vague hint could at least help us prepare an isolated bugreport, because otherwise we have a rather big chunk of code to dissect in order to provide a simple FPC testcase :)

Even a big unit is fine for a bug report, as long as all the code is publicly available for download. If you can't seem to get it to reproduce with a small test case, you can mention in the bug report that you tried, but didn't succeed and still provide the full code needed. AFAIK, the Castle Game Engine is open-source, so this shouldn't be a problem?

Nikolay

Show quoted text 6 lines
Regards, Michalis _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Michalis Kamburelis
to Nikolay Nikolov

Thanks for the answers,

I have submitted issue
https://gitlab.com/freepascal.org/fpc/source/-/issues/40229 describing how to reproduce the problem.

Hopefully it can get some attention :) I would very much like to add "web" target to CGE, to be able to just run CGE games in a browser. It's going to be my highest-priority thing after upcoming CGE 7.0 release.

Regards,
Michalis

czw., 30 mar 2023 o 21:11 Nikolay Nikolov via fpc-devel napisał(a):

Show quoted text 98 lines
On 3/28/23 02:12, Michalis Kamburelis via fpc-devel wrote: > Hi, > > We're experimenting with compiling Castle Game Engine using FPC > WebAssembly target. > > A lot of units and classes compiled smoothly, however we hit a weird > bug(s) at compiling our (big, too big!) unit X3DNodes. We get errors > "Wasm32 symbol xxx without index value error" at the code trying to > use various property setters or methods. Examples: > > x3dcamerautils.pas(344,0) Error: Wasm32 symbol > X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index > value error > > // where TSFRotation.Value is a property with record type, with getter > and setter methods > > x3dcamerautils.pas(344,0) Error: Wasm32 symbol > X3DFIELDS$_$TX3DSIMPLEMULTFIELD$3$CRCD1E2ED59_CRCAB5A7799_$__$$_GETITEMS$$TSINGLELIST > without index value error > > // where TX3DSimpleMultField.GetItems is a method of a generic class) > > x3dcamerautils.pas(344,0) Error: Wasm32 symbol > X3DFIELDS$_$TSFFLOAT_$__$$_SETVALUE$SINGLE without index value error > x3dcamerautils.pas(344,0) Error: Wasm32 symbol > > // where TSFFloat.SetValue is a simple setter for a Single property, no generics > > castlescenecore.pas(8822,0) Error: Wasm32 symbol > CASTLESHAPEINTERNALSHADOWVOLUMES$_$TSHAPESHADOWVOLUMES_$__$$_PREPARERESOURCES > without index value error > > // where TShapeShadowVolumes.PrepareResources is a simple method, > without any parameters, in a simple non-generic class > > Weirder, on another machine, the symbols reported contain some exe > filenames at the place of initial "$_$" (maybe independent compiler > bug at message display?): > > x3dloadinternalgeo.pas(234,0) Error: Wasm32 symbol > X3DFIELDS/usr/bin/dbus-update-activation-environmentTSFFLOAT_$__$$_SETVALUE$SINGLE > without index value error > > x3dloadinternalgeo.pas(234) Error: Wasm32 symbol > X3DFIELDS/home/michalis/bin/castle-engineTSFFLOAT_$__$$_SETVALUE$SINGLE > without index value error > > Sometimes the errors can be workarounded by some simple actions -- > like moving the property getter/setter protected->private, or avoiding > the call to that particular method. But the solutions, as well as > causes, seem ~random from our perspective. And all in all, we didn't > finish the compilation of X3DNodes unit because after each > fix/workaround/hack for a specific case, another similar error pops > up. > > Grepping FPC for the asmw_e_illegal_unset_index (this is "Wasm32 > symbol $1 without index value error"), the error can occur when symbol > cannot be found in the list where compiler expected it to be. > > We don't have any simple bugreport about it (yet), as the error really > manifests only in a big unit, that is interconnected with a few other > big units. Isolating the testcase (and/or doing much needed refactor > of this unit :) ) will take a while. > > Does anyone have a hint: > > - What does this error really mean? What is internally wrong at > compilation to cause it? What could be the culprit? > > - Is there some universal workaround for it (on CGE side) or fix on > the compiler side? > > Even a vague hint could at least help us prepare an isolated > bugreport, because otherwise we have a rather big chunk of code to > dissect in order to provide a simple FPC testcase :) Even a big unit is fine for a bug report, as long as all the code is publicly available for download. If you can't seem to get it to reproduce with a small test case, you can mention in the bug report that you tried, but didn't succeed and still provide the full code needed. AFAIK, the Castle Game Engine is open-source, so this shouldn't be a problem? Nikolay > > Regards, > Michalis > _______________________________________________ > fpc-devel maillist - > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email

Nikolay Nikolov
to Michalis Kamburelis
Michalis Kamburelis wrote 5 lines
Thanks for the answers, I have submitted issue https://gitlab.com/freepascal.org/fpc/source/-/issues/40229 describing how to reproduce the problem.

I think I fixed it. At least compilation now continues and fails later, due to lack of goto support, so this particular bug should be fixed.

Nikolay

Show quoted text 109 lines
Hopefully it can get some attention :) I would very much like to add "web" target to CGE, to be able to just run CGE games in a browser. It's going to be my highest-priority thing after upcoming CGE 7.0 release. Regards, Michalis czw., 30 mar 2023 o 21:11 Nikolay Nikolov via fpc-devel napisał(a): > > On 3/28/23 02:12, Michalis Kamburelis via fpc-devel wrote: >> Hi, >> >> We're experimenting with compiling Castle Game Engine using FPC >> WebAssembly target. >> >> A lot of units and classes compiled smoothly, however we hit a weird >> bug(s) at compiling our (big, too big!) unit X3DNodes. We get errors >> "Wasm32 symbol xxx without index value error" at the code trying to >> use various property setters or methods. Examples: >> >> x3dcamerautils.pas(344,0) Error: Wasm32 symbol >> X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index >> value error >> >> // where TSFRotation.Value is a property with record type, with getter >> and setter methods >> >> x3dcamerautils.pas(344,0) Error: Wasm32 symbol >> X3DFIELDS$_$TX3DSIMPLEMULTFIELD$3$CRCD1E2ED59_CRCAB5A7799_$__$$_GETITEMS$$TSINGLELIST >> without index value error >> >> // where TX3DSimpleMultField.GetItems is a method of a generic class) >> >> x3dcamerautils.pas(344,0) Error: Wasm32 symbol >> X3DFIELDS$_$TSFFLOAT_$__$$_SETVALUE$SINGLE without index value error >> x3dcamerautils.pas(344,0) Error: Wasm32 symbol >> >> // where TSFFloat.SetValue is a simple setter for a Single property, no generics >> >> castlescenecore.pas(8822,0) Error: Wasm32 symbol >> CASTLESHAPEINTERNALSHADOWVOLUMES$_$TSHAPESHADOWVOLUMES_$__$$_PREPARERESOURCES >> without index value error >> >> // where TShapeShadowVolumes.PrepareResources is a simple method, >> without any parameters, in a simple non-generic class >> >> Weirder, on another machine, the symbols reported contain some exe >> filenames at the place of initial "$_$" (maybe independent compiler >> bug at message display?): >> >> x3dloadinternalgeo.pas(234,0) Error: Wasm32 symbol >> X3DFIELDS/usr/bin/dbus-update-activation-environmentTSFFLOAT_$__$$_SETVALUE$SINGLE >> without index value error >> >> x3dloadinternalgeo.pas(234) Error: Wasm32 symbol >> X3DFIELDS/home/michalis/bin/castle-engineTSFFLOAT_$__$$_SETVALUE$SINGLE >> without index value error >> >> Sometimes the errors can be workarounded by some simple actions -- >> like moving the property getter/setter protected->private, or avoiding >> the call to that particular method. But the solutions, as well as >> causes, seem ~random from our perspective. And all in all, we didn't >> finish the compilation of X3DNodes unit because after each >> fix/workaround/hack for a specific case, another similar error pops >> up. >> >> Grepping FPC for the asmw_e_illegal_unset_index (this is "Wasm32 >> symbol $1 without index value error"), the error can occur when symbol >> cannot be found in the list where compiler expected it to be. >> >> We don't have any simple bugreport about it (yet), as the error really >> manifests only in a big unit, that is interconnected with a few other >> big units. Isolating the testcase (and/or doing much needed refactor >> of this unit :) ) will take a while. >> >> Does anyone have a hint: >> >> - What does this error really mean? What is internally wrong at >> compilation to cause it? What could be the culprit? >> >> - Is there some universal workaround for it (on CGE side) or fix on >> the compiler side? >> >> Even a vague hint could at least help us prepare an isolated >> bugreport, because otherwise we have a rather big chunk of code to >> dissect in order to provide a simple FPC testcase :) > Even a big unit is fine for a bug report, as long as all the code is > publicly available for download. If you can't seem to get it to > reproduce with a small test case, you can mention in the bug report that > you tried, but didn't succeed and still provide the full code needed. > AFAIK, the Castle Game Engine is open-source, so this shouldn't be a > problem? > > Nikolay > >> Regards, >> Michalis >> _______________________________________________ >> fpc-devel maillist - >> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel > _______________________________________________ > fpc-devel maillist - > https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel _______________________________________________ fpc-devel maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email