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

Changing streams on Cabana crashes on MacOS #34037

Open
pbassut opened this issue Nov 16, 2024 · 1 comment
Open

Changing streams on Cabana crashes on MacOS #34037

pbassut opened this issue Nov 16, 2024 · 1 comment
Labels

Comments

@pbassut
Copy link
Contributor

pbassut commented Nov 16, 2024

Describe the bug

Whenever you try to open another stream while already having a stream open, looks like the current socket is not closed properly and when trying to bind again it fails.

(openpilot) ~/P/c/openpilot (master|✚2) [SIGABRT]$ ./tools/cabana/cabana 625ccd09daec723c/00000055--3b455c2343/0
Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
QCommandLineParser: option not defined: "socketcan"
active services: can, carParams, driverEncodeIdx, roadEncodeIdx, wideRoadEncodeIdx
loading route 625ccd09daec723c/00000055--3b455c2343/0
load route 625ccd09daec723c|00000055--3b455c2343 with 1 valid segments
Starting listener for: camerad
Error, failed to bind PubSocket to can: Address already in use
Assertion failed: (socket), function PubMaster, file socketmaster.cc, line 191.
fish: Job 1, './tools/cabana/cabana 625ccd09d…' terminated by signal SIGABRT (Abort)

Provide a route where the issue occurs

625ccd09daec723c/00000055--3b455c2343/0

openpilot version

0.9.7

Additional info

Here's a gif showing the crash.
Kapture 2024-11-16 at 09 41 52

@pbassut pbassut added the bug label Nov 16, 2024
@deanlee
Copy link
Contributor

deanlee commented Nov 17, 2024

Cabana relies on class OpenpilotPrefix (common/prefix.h) to set different environments for different streams, allowing multiple instances of Cabana to run simultaneously or switch between streams while running. However, OpenpilotPrefix is currently only supported on Linux, which leads to this issue on MacOs.

Here is the related TODO in Cabana

// TODO: Remove when OpenpilotPrefix supports ZMQ
#ifndef __APPLE__
op_prefix = std::make_unique<OpenpilotPrefix>();
#endif
QObject::connect(&settings, &Settings::changed, this, [this]() {
if (replay) replay->setSegmentCacheLimit(settings.max_cached_minutes);
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants