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

Debugging Julia with OMJulia gives ZMQ.StateError #66

Open
AnHeuermann opened this issue Sep 26, 2022 · 0 comments
Open

Debugging Julia with OMJulia gives ZMQ.StateError #66

AnHeuermann opened this issue Sep 26, 2022 · 0 comments

Comments

@AnHeuermann
Copy link
Member

AnHeuermann commented Sep 26, 2022

Description

I'm using VS Code and the Julia extension to debug my Julia projects.
When debugging code that also uses OMJulia I'm hitting errors I don't see when running the code without the debugger.

How to reproduce

When starting to debug a file with

using OMJulia
using OMJulia: sendExpression

omc = OMCSession()
sendExpression(omc, "loadModel(Modelica)")
sendExpression(omc, "simulate(Modelica.Electrical.Analog.Examples.CauerLowPassAnalog)")
sendExpression(omc, "quit()", parsed=false)

@error "Try to break before you hit me!"

I'm hitting an error in ZMQ.jl package:

Exception has occurred: ZMQ.StateError
ZMQ.StateError("Success")

Stacktrace:
 [1] _recv!(socket::ZMQ.Socket, zmsg::ZMQ.Message)
   @ ZMQ ~/.julia/packages/ZMQ/R3wSD/src/comm.jl:73
 [2] recv(socket::ZMQ.Socket)
   @ ZMQ ~/.julia/packages/ZMQ/R3wSD/src/comm.jl:94
 [3] sendExpression(omc::OMJulia.OMCSession, expr::String; parsed::Bool)
   @ OMJulia ~/workdir/julia/OMJulia.jl/src/OMJulia.jl:183
 [4] sendExpression(omc::OMJulia.OMCSession, expr::String)
   @ OMJulia ~/workdir/julia/OMJulia.jl/src/OMJulia.jl:180
 [5] top-level scope
   @ ~/workdir/julia/OMJulia.jl/bug.jl:6

I'm not sure if this is a ZMQ problem or the omc.socket from OMJulia is different when I'm debugging.

Without debugging

omc.socket = ZMQ.Socket(Ptr{Nothing} @0x0000000003818660, FileWatching._FDWatcher(Ptr{Nothing} @0x0000000003b9c910, 35, (1, 0), Base.GenericCondition{Base.Threads.SpinLock}(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), 0, (false, false)))

with debugging

omc.socket = ZMQ.Socket(Ptr{Nothing} @0x000000000305cce0, FileWatching._FDWatcher(Ptr{Nothing} @0x0000000002a8a950, 34, (1, 0), Base.GenericCondition{Base.Threads.SpinLock}(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), 0, (false, false)))

Versions 'n stuff

  • OS: Ubuntu Focal
  • julia> versioninfo()
    Julia Version 1.8.1
    Commit afb6c60d69a (2022-09-06 15:09 UTC)
    Platform Info:
      OS: Linux (x86_64-linux-gnu)
      CPU: 48 × Intel(R) Xeon(R) Gold 6248R CPU @ 3.00GHz
      WORD_SIZE: 64
      LIBM: libopenlibm
      LLVM: libLLVM-13.0.1 (ORCJIT, cascadelake)
      Threads: 1 on 48 virtual cores
  • OMJulia v0.2.0 @d1e889924f0940dc9bbbc0bd13f676b1cb297151
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant