Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • VILLASnode VILLASnode
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 6
    • Merge requests 6
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • ACS
  • Public
  • VILLASframework
  • VILLASnodeVILLASnode
  • Issues
  • #286

Closed
Open
Created Jan 06, 2021 by Felix Wege@felix.wegeDeveloper

mqtt_write() fails when calling io_sprint()

Writing a sample with mqtt_write() leads to a crash caused by io_sprint() called at mqtt.cpp:529.

Error message:

14:53:56 info default: MQTT: Node broker(mqtt) connected to broker localhost
14:53:56 info default: MQTT: Node broker(mqtt) subscribed to broker localhost
state = 1
villas-node: /villasnode/lib/io.cpp:516: int io_sprint(io*, char*, size_t, size_t*, sample**, unsigned int): Assertion `io->state == State::CHECKED || io->state == State::OPENED' failed.
Aborted (core dumped)

As shown by the additional debug message state = 1, current state seems to be INITIALIZED.

I assume this is a result of the call of io_init() in mqtt_start() @mqtt.cpp:397.
Manually setting the state to CHECKED (m->io.state=State::CHECKED) after the call of io_init() seems to fix the problem, but I don't think this is the proper way.

Is this error introduced or related to ffa57f5e?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking