# Qt Warning: \*path/to/file.qml\*: RangeError: Maximum call stack size exceeded

**URL:** <https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130>\
**Category:** Specific Domains\
**Tags:** package, vscode, qml\
**Created:** [November 1, 2024, 1:20pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130 "2024-11-01T13:20:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Valery](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/valery/32/21803_2.png) [@Valery](https://discourse.julialang.org/u/Valery)\
**Post date:** [November 1, 2024, 1:20pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/1 "2024-11-01T13:20:04Z")

</div>

When runing this

```julia
using QML
using Observables

slidervalue = Observable(0.0)

loadqml(
  joinpath(pwd(),"slider.qml"),
  variables = JuliaPropertyMap(
    "slidervalue" => slidervalue
  )
)

exec()

```

and the content of “slider.qml” being

```julia
import QtQuick 2.6
import QtQuick.Controls 2.3
import org.julialang 1.0

ApplicationWindow {
  id: mainWin
  title: "My Application"
  width: 100
  height: 100
  visible: true

  Rectangle {
    anchors.fill: parent
    color: "red"

    Text {
      anchors.centerIn: parent
      text: props.hi + Julia.world()
    }
  }
}

```

I get the following error

> Qt Warning: qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/ApplicationWindow.qml:2134880960: RangeError: Maximum call stack size exceeded. (qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/ApplicationWindow.qml:2134880960, (null))  
> Qt Warning: _path_/slider.qml:2134880912: RangeError: Maximum call stack size exceeded. (_path_/slider.qml:2134880912, (null))  
> Qt Warning: _path_/slider.qml:2134880912: RangeError: Maximum call stack size exceeded. (_path_/slider.qml:2134880912, (null))  
> Qt Warning: _path_/slider.qml:2134880912: RangeError: Maximum call stack size exceeded. (_path_/slider.qml:2134880912, (null))

where I manually replaced the displayed path with _path_ for the purpose of this post.

General informations:

- Julia v.1.11.1
- Package status:
  - QML v0.9.1
  - Observables v0.5.5

- OS: Debian GNU/Linux 12 (bookworm)
- Processor: Intel Core i7-7500U x4
- Graphics NV117/Mesa Intel HD Graphics 620 (KBL GT2)

What is the problem and how to solve it ?

For your information, this code example comes from a talk given by Bart Janssens at the JuliaCon 2020 and correspnods to the first example in this video: [https://youtu.be/AddbHe05yRg?si=rMqBECxDDAnKFK4I&t=38](https://youtu.be/AddbHe05yRg?si=rMqBECxDDAnKFK4I&t=38)  
If needed, the corresponding source material can be found here [GitHub - barche/juliacon2020-qml: Juliacon 2020 slides for the QML.jl talk](https://github.com/barche/juliacon2020-qml)

Note that I changed the `exec_async()` from the example to `exec()` in order for it to run.

---

<div class="post-metadata">

**Author:** ![Schurke](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Schurke](https://discourse.julialang.org/u/Schurke)\
**Post date:** [January 2, 2025, 7:19pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/2 "2025-01-02T19:19:08Z")

</div>

I have the same issue and can reproduce it by two means:

1. Running the code from inside VSCode.
2. Wrapping code like OP’s into one function and call it from the REPL in a terminal e.g. by prefixing @async or Threads.@spawn,

Running it from the REPL without async/threading is fine in my setup.

Julia 1.11.2, QML 0.9.1, CxxWrap 0.16, Observables 0.5.5, Ubuntu 22.04.5 LTS

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 2, 2025, 11:48pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/3 "2025-01-02T23:48:36Z")

</div>

If you are using Julia 1.11.x, make sure you have in your project file these entries:

```julia
CxxWrap = "0.16"
QML = "0.9"

```

---

<div class="post-metadata">

**Author:** ![Schurke](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Schurke](https://discourse.julialang.org/u/Schurke)\
**Post date:** [January 3, 2025, 10:22am UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/4 "2025-01-03T10:22:24Z")

</div>

Thanks for the reminder. I double checked and the dependencies are there as indicated by you. Point is, currently I seem not to be able to make QML.jl work from inside VSCode, where with the same code as OP I’m getting the same error messages plus a zombie ApplicationWindow. As I do not know how to properly share my complete VSCode config and project setup, I added another direct method that produces the same error messages without VSCode.

To be more explicit, here are some steps to reproduce:

- Clone [QmlJuliaExamples](https://github.com/barche/QmlJuliaExamples)
- Make a copy of `QmlJuliaExamples/basic/drag.jl` and name it `QmlJuliaExamples/basic/drag2.jl`
- Modify `QmlJuliaExamples/basic/drag2.jl` as follows:

```julia
using QML

@qmlfunction println

function run()
  loadqml(joinpath(dirname(@ __FILE__ ), "qml", "drag.qml"))
  exec()
end

```

- In the terminal, `cd <wherever you cloned it>/QmlJuliaExamples/basic/` and run the Julia REPL and type:
- `]`
- `activate .`
- `instantiate`
- `<backspace>`
- `include("drag2.jl")`
- `run()`

This will run fine and you can play with the dragging example now. However, the following instead will produce OP’s error messages and a dead window:

- `Threads.@spawn run()`

To reproduce this in VSCode (I’m using the extension `julialang v1.127.2`) without explicit `Threads.@spawn`, do the following steps:

- Go to `File -> Open Folder...` and open `<wherever you cloned it>/QmlJuliaExamples/basic/`
- In the file explorer, double click on `drag2.jl`.
- Click the run button at the upper right of the code window.
- The terminal should show with the message `run (generic function with 1 method)` and the Julia prompt.
- Type `run()`

These steps will also produce a dead window and the following messages (I have anonymized some file paths):

```julia
Qt Warning: qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/ApplicationWindow.qml:794814400: RangeError: Maximum call stack size exceeded. (qrc:/qt-project.org/imports/QtQuick/Controls/Fusion/ApplicationWindow.qml:794814400, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))
Qt Warning: file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352: RangeError: Maximum call stack size exceeded. (file:///***/QmlJuliaExamples/basic/qml/drag.qml:794814352, (null))

```

---

<div class="post-metadata">

**Author:** ![Schurke](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Schurke](https://discourse.julialang.org/u/Schurke)\
**Post date:** [January 3, 2025, 10:25am UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/5 "2025-01-03T10:25:06Z")

</div>

Of course, this also happens in VSCode when you try to run the original `drag.jl` directly.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [January 3, 2025, 11:48am UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/6 "2025-01-03T11:48:51Z")

</div>

Well, you could create an issue at [GitHub · Where software is built](https://github.com/julia-vscode/julia-vscode/issues), but the maintainers are overloaded and I would not expect a quick fix.

Myself, I do not use the VSCode Julia terminal. Instead, I launch a normal (Bash) terminal and start julia with the required parameter from there, usually:

```julia
julia --project

```

Then everything should work.

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [January 3, 2025, 1:08pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/7 "2025-01-03T13:08:41Z")

</div>

Can you check whether this example works correctly with Julia 1.10?

---

<div class="post-metadata">

**Author:** ![Schurke](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@Schurke](https://discourse.julialang.org/u/Schurke)\
**Post date:** [January 3, 2025, 1:31pm UTC](https://discourse.julialang.org/t/qt-warning-path-to-file-qml-rangeerror-maximum-call-stack-size-exceeded/122130/8 "2025-01-03T13:31:52Z")

</div>

I currently don’t have a 1.10 installation of Julia, but I tried 1.9 instead.

Same results for `drag2.jl` in Julia REPL in Ubuntu terminal:

- `run()` works fine.
- ’ Threads.@spawn run()’ throws errors.

I didn’t check running from VSCode.
