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

Constructor crashes when compiled to a bundle, and loaded into unity #1

Open
MeijisIrlnd opened this issue Oct 4, 2022 · 0 comments

Comments

@MeijisIrlnd
Copy link

MeijisIrlnd commented Oct 4, 2022

Hey, first off thanks so much for putting this guide together, super helpful!
I realise this is a suuper niche scenario, I'm working on a project which uses Juce as the audio backend, and Unity as the frontend, so we have a dynamic library that unity loads, and calls functions from. I've been trying to integrate Link into this setup, and it works fine on windows, but on mac, calling the ableton::Link constructor crashes, with the relevant stack trace being:

#0  0x0000019b8697ec in asio::detail::conditionally_enabled_mutex::scoped_lock::scoped_lock(asio::detail::conditionally_enabled_mutex&)
#1  0x0000019b86949d in asio::detail::conditionally_enabled_mutex::scoped_lock::scoped_lock(asio::detail::conditionally_enabled_mutex&)
#2  0x0000019b87b1f1 in asio::detail::scheduler::init_task()
#3  0x0000019b87b1c9 in asio::detail::kqueue_reactor::init_task()
#4  0x0000019b891dfb in asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >::deadline_timer_service(asio::execution_context&)
#5  0x0000019b891d6d in asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >::deadline_timer_service(asio::execution_context&)
#6  0x0000019b891d20 in asio::execution_context::service* asio::detail::service_registry::create<asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >, asio::io_context>(void*)
#7  0x0000019b8677ea in asio::detail::service_registry::do_use_service(asio::execution_context::service::key const&, asio::execution_context::service* (*)(void*), void*)
#8  0x0000019b891cae in asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >& asio::detail::service_registry::use_service<asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > > >(asio::io_context&)
#9  0x0000019b891bcc in asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >& asio::use_service<asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > > >(asio::io_context&)
#10 0x0000019b891af7 in asio::detail::io_object_impl<asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >, asio::any_io_executor>::io_object_impl<asio::io_context>(int, int, asio::io_context&)
#11 0x0000019b891ac9 in asio::detail::io_object_impl<asio::detail::deadline_timer_service<asio::detail::chrono_time_traits<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock> > >, asio::any_io_executor>::io_object_impl<asio::io_context>(int, int, asio::io_context&)
#12 0x0000019b891a94 in asio::basic_waitable_timer<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock>, asio::any_io_executor>::basic_waitable_timer<asio::io_context>(asio::io_context&, asio::constraint<is_convertible<asio::io_context&, asio::execution_context&>::value, int>::type)
#13 0x0000019b8919d3 in asio::basic_waitable_timer<std::__1::chrono::system_clock, asio::wait_traits<std::__1::chrono::system_clock>, asio::any_io_executor>::basic_waitable_timer<asio::io_context>(asio::io_context&, asio::constraint<is_convertible<asio::io_context&, asio::execution_context&>::value, int>::type)
#14 0x0000019b891942 in ableton::platforms::asio::AsioTimer::AsioTimer(asio::io_context&)
#15 0x0000019b8918ed in ableton::platforms::asio::AsioTimer::AsioTimer(asio::io_context&)
#16 0x0000019b8917c0 in ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>::makeTimer() const
#17 0x0000019b8f370b in ableton::link::Sessions<ableton::link::Peers<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, std::__1::reference_wrapper<ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionPeerCounter>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionTimelineCallback, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionStartStopStateCallback>&, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::MeasurePeer, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::JoinSessionCallback, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, ableton::platforms::darwin::Clock>::Sessions(ableton::link::Session, ableton::util::Injected<ableton::link::Peers<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, std::__1::reference_wrapper<ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionPeerCounter>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionTimelineCallback, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionStartStopStateCallback>&>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::MeasurePeer, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::JoinSessionCallback, ableton::util::Injected<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&>, ableton::platforms::darwin::Clock)
#18 0x0000019b864747 in ableton::link::Sessions<ableton::link::Peers<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, std::__1::reference_wrapper<ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionPeerCounter>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionTimelineCallback, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionStartStopStateCallback>&, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::MeasurePeer, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::JoinSessionCallback, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, ableton::platforms::darwin::Clock>::Sessions(ableton::link::Session, ableton::util::Injected<ableton::link::Peers<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&, std::__1::reference_wrapper<ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionPeerCounter>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionTimelineCallback, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::SessionStartStopStateCallback>&>, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::MeasurePeer, ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::JoinSessionCallback, ableton::util::Injected<ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory>&>, ableton::platforms::darwin::Clock)
#19 0x0000019b863d8e in ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::Controller(ableton::link::Tempo, std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock)
#20 0x0000019b859729 in ableton::link::Controller<std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock, ableton::platforms::stl::Random, ableton::platforms::asio::Context<ableton::platforms::posix::ScanIpIfAddrs, ableton::util::NullLog, ableton::platforms::darwin::ThreadFactory> >::Controller(ableton::link::Tempo, std::__1::function<void (unsigned long)>, std::__1::function<void (ableton::link::Tempo)>, std::__1::function<void (bool)>, ableton::platforms::darwin::Clock)
#21 0x0000019b85945d in ableton::BasicLink<ableton::platforms::darwin::Clock>::BasicLink(double)
#22 0x0000019b8592bf in ableton::Link::Link(double)
#23 0x0000019b85894f in ableton::Link::Link(double)

Upon closer inspection it seems to be that the scheduler is null.
I found a repo specifically for using Link in unity (https://github.com/comoc/UnityAbletonLink) and it works fine, but it seems like when I also include juce something goes horribly wrong. I verified this by taking the exports from the unity version repo, and compiling them with a Juce dynamic library, which crashes.

So was wondering if you'd come across anything like this (know it was 4 years ago) or had any idea where to start looking, I think it must be some xcode setting or preprocessor thats set that shouldnt be or vice versa, any advice at all is super appreciated!
(I posted a similar issue on the ableton Link repo if there's any more info there, Ableton/link#121)

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