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

Loading expressions throws RuntimeError #5

Closed
wonder-sk opened this issue Sep 26, 2023 · 4 comments
Closed

Loading expressions throws RuntimeError #5

wonder-sk opened this issue Sep 26, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@wonder-sk
Copy link
Member

When using a QGIS project containing vector tiles layer with a couple of styling rules, it failed to load with this RuntimeError:

qgis-js.wasm:0x56fcf5 Uncaught (in promise) RuntimeError: memory access out of bounds
    at QgsExpressionNodeFunction::QgsExpressionNodeFunction(int, QgsExpressionNode::NodeList*) (qgis-js.wasm:0x56fcf5)
    at exp_parse(expression_parser_context*) (qgis-js.wasm:0x54bcd8)
    at parseExpression(QString const&, QString&, QList<QgsExpression::ParserError>&) (qgis-js.wasm:0x54e28d)
    at QgsExpression::QgsExpression(QString const&) (qgis-js.wasm:0x55145b)
    at QgsProperty::loadVariant(QVariant const&) (qgis-js.wasm:0x9d9bd2)
    at QgsPropertyCollection::loadVariant(QVariant const&, QMap<int, QgsPropertyDefinition> const&) (qgis-js.wasm:0x9dfd97)
    at QgsAbstractPropertyCollection::readXml(QDomElement const&, QMap<int, QgsPropertyDefinition> const&) (qgis-js.wasm:0x9dce89)
    at QgsSymbolLayerUtils::loadSymbolLayer(QDomElement&, QgsReadWriteContext const&) (qgis-js.wasm:0x447961)
    at QgsSymbolLayerUtils::loadSymbol(QDomElement const&, QgsReadWriteContext const&) (qgis-js.wasm:0x4455a1)
    at QgsSymbolLayerUtils::loadSymbols(QDomElement&, QgsReadWriteContext const&) (qgis-js.wasm:0x45d3f7)

QgsExpressionNodeFunction tries to lock a recursive mutex, maybe that's the reason (possibly related to #3 which also fails when locking mutex, but with a different error message)

@boardend
Copy link
Collaborator

FYI: @andreasneumann hit that issue too and provided me a test project. I'm currently looking into this.

@boardend
Copy link
Collaborator

The old patch to get the QGIS expressions "working" in a debug build was way too aggressive. Basically removing all expression functions, which made the whole expression evaluation useless/failing 🙈

This is now fixed with afbdda9 which adds the needed flag (forcing optimization in debug builds) only to expression/qgsexpressionfunction.cpp in QGIS (see also the upstream emscripten issue). QgsExpressions are now working with all build types in Chormium/Firefox 🥳

The fix is also published to the temporary demo site. The test project form @andreasneumann seems to work fine. Please report back so we can close this issue.

@andreasneumann
Copy link
Member

@boardend and @wonder-sk - looks good. I tested with my project and it loads fine.

There are a few issues with this project still (text size too small, cut-off-labels), but for these we should open separate issues.

@boardend
Copy link
Collaborator

Thanks for your feedback. See #8 and feel free to open a new issue for the cut-off-labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants