Skip to content

SciMLOperators 0.3.13 ScalarOperator UniformScaling mulitplication stackoverflow #266

@LynBar

Description

@LynBar

Describe the bug 🐞
When multiplying a LinearAlgebra.UniformScaling operator with a ScalarOperator I get a stack overflow.

Expected behavior

Minimal Reproducible Example 👇

using SciMLOperators, LinearAlgebra
α = ScalarOperator(1.0)
x = I*(1.0)            
x*α

Error & Stacktrace ⚠️

ERROR: LoadError: StackOverflowError:
Stacktrace:
 [1] *::SciMLOperators.ScalarOperator{…}, x::LinearAlgebra.UniformScaling{…}) (repeats 79984 times)
   @ SciMLOperators C:\Users\barry.lynch\.julia\packages\SciMLOperators\2UPBq\src\scalar.jl:322

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
  [c0aeaf25] SciMLOperators v0.3.13
  [37e2e46d] LinearAlgebra v1.11.0
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
  [7d9f7c33] Accessors v0.1.42
  [79e6a3ab] Adapt v4.3.0
  [4fba245c] ArrayInterface v7.18.0
  [a33af91c] CompositionsBase v0.1.2
  [187b0558] ConstructionBase v1.5.8
  [ffbed154] DocStringExtensions v0.9.4
  [3587e190] InverseFunctions v0.1.17
  [1914dd2f] MacroTools v0.5.16
  [ae029012] Requires v1.3.1
  [c0aeaf25] SciMLOperators v0.3.13
  [56f22d72] Artifacts v1.11.0
  [ade2ca70] Dates v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.11.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.1.1+0
  [4536629a] OpenBLAS_jll v0.3.27+1
  [8e850b90] libblastrampoline_jll v5.11.0+0
  • Output of versioninfo()
Julia Version 1.11.5
Commit 760b2e5b73 (2025-04-14 06:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 14 × Intel(R) Core(TM) Ultra 5 125U
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, alderlake)
Threads: 1 default, 0 interactive, 1 GC (on 14 virtual cores)

Additional context

The offending code is in the multiplication function in scalar.jl line 319;

T2 = promote_type($T, eltype(α))
return ScalarOperator(convert(T2, α) * x, α.update_func)

Here T2=Any with typeof(x) = UniformScaling, so that when convert(T2,α) is called, α remains a ScalarOperator resulting in a stackoverflow.

I'm not sure if I'm meant to able to multiply by UniformScaling, but it is in the SCALINGNUMBERTYPES array so I assume it should be.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions