Open arnesahlberg opened 1 year ago
Please don't post an archive of your project because anonymous archived files are dangerous, instead share your minimal repro project in a github repo.
Please don't post an archive of your project because anonymous archived files are dangerous, instead share your minimal repro project in a github repo.
Good point. Removed it. May add repo later.
Seems like it might be something crashing in some underlying contract in IIOReadPlugin::callInitialize() being broken, I've been running into this issue on my M1 mac for various other projects (namely GNURadio and occasionally another opencv project).
(edit: these other projects worked fine not long ago, and now they're crashing... I think it's something upstream from tauri)
Not sure whether this is related, but I encountered a similar issue with egui that on M1 the app crashed with EXC_BAD_ACCESS (SIGBUS)
. Remove /opt/homebrew/lib
from env DYLD_LIBRARY_PATH
resolved the issue
Not sure whether this is related, but I encountered a similar issue with egui that on M1 the app crashed with
EXC_BAD_ACCESS (SIGBUS)
. Remove/opt/homebrew/lib
from envDYLD_LIBRARY_PATH
resolved the issue
/opt/homebrew/lib/libgl.dylib was the offending file, I think this was also affecting solvespace. Comes down to how CMAKE on MacOS links libGL: it should compile with the -framework flag instead of linking it as a dylib
I ran into the same problem but I do not have /opt/homebrew/lib/libgl.dylib
on my system.
I've stepped through with a debugger and this is where it crashes: https://github.com/tauri-apps/tauri/blob/3cca5c2be88bbd52139e7dda371e88510d28bc8e/core/tauri/src/app.rs#L1910
This is the stack reported by RustRover:
<unknown> 0x000000000bad4007
PNGReadPlugin::InitializePluginData(IIOImageReadSession*, IIODictionary*, IIODictionary*, CGImageMetadata*, CGColorSpace**, ReadPluginData&, PNGPluginData&, __CFDictionary*) 0x0000000193708c9c
IIOReadPlugin::callInitialize() 0x0000000193700ff4
IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) 0x0000000193700dbc
IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) 0x00000001936fe75c
IIOImageSource::getPropertiesAtIndexInternal(unsigned long, IIODictionary*) 0x00000001936fe030
IIOImageSource::copyPropertiesAtIndex(unsigned long, IIODictionary*) 0x00000001936fdf4c
CGImageSourceCopyPropertiesAtIndex 0x00000001936fddf0
ImageSourceOptionsForCGImageSource_index_ 0x000000018c5b2bf8
+[NSBitmapImageRep _imagesWithData:hfsFileType:extension:zone:expandImageContentNow:includeAllReps:] 0x000000018c5b2a78
+[NSBitmapImageRep imageRepsWithData:] 0x000000018c6ca1ec
-[NSImage initWithData:] 0x000000018c6c9abc
<(A,) as objc::message::MessageArguments>::invoke mod.rs:128
objc::message::platform::send_unverified::{{closure}} mod.rs:27
objc_exception::try::{{closure}} lib.rs:68
objc_exception::try_no_ret::try_objc_execute_closure lib.rs:34
RustObjCExceptionTryCatch exception.m:10
objc_exception::try_no_ret lib.rs:44
objc_exception::try lib.rs:67
objc::exception::try exception.rs:8
objc::message::platform::send_unverified mod.rs:26
[Inlined] objc::message::send_message mod.rs:178
<*mut objc::runtime::Object as cocoa::appkit::NSImage>::initWithData_ appkit.rs:3292
tauri::app::on_event_loop_event app.rs:1780
tauri::app::App<R>::run::{{closure}} app.rs:879
tauri_runtime_wry::handle_event_loop lib.rs:2823
<tauri_runtime_wry::Wry<T> as tauri_runtime::Runtime<T>>::run::{{closure}} lib.rs:2325
<tao::platform_impl::platform::app_state::EventLoopHandler<T> as tao::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event::{{closure}} app_state.rs:105
tao::platform_impl::platform::app_state::EventLoopHandler<T>::with_callback app_state.rs:79
<tao::platform_impl::platform::app_state::EventLoopHandler<T> as tao::platform_impl::platform::app_state::EventHandler>::handle_nonuser_event app_state.rs:100
tao::platform_impl::platform::app_state::Handler::handle_nonuser_event app_state.rs:208
tao::platform_impl::platform::app_state::AppState::launched app_state.rs:299
tao::platform_impl::platform::app_delegate::did_finish_launching app_delegate.rs:94
__CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ 0x0000000188c62b1c
___CFXRegistrationPost_block_invoke 0x0000000188cf6db8
_CFXRegistrationPost 0x0000000188cf6d00
_CFXNotificationPost 0x0000000188c31648
-[NSNotificationCenter postNotificationName:object:userInfo:] 0x0000000189d4d464
-[NSApplication _postDidFinishNotification] 0x000000018c4cc37c
-[NSApplication _sendFinishLaunchingNotification] 0x000000018c4cc12c
-[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:] 0x000000018c4ca674
-[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] 0x000000018c4ca270
-[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] 0x0000000189d75914
_NSAppleEventManagerGenericHandler 0x0000000189d75708
<unknown> 0x000000018fc869c4
<unknown> 0x000000018fc862ec
aeProcessAppleEvent 0x000000018fc7f8a8
AEProcessAppleEvent 0x0000000193416e90
_DPSNextEvent 0x000000018c4c4c7c
-[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 0x000000018ccb6dec
-[NSApplication run] 0x000000018c4b7cb8
<() as objc::message::MessageArguments>::invoke mod.rs:128
objc::message::platform::send_unverified::{{closure}} mod.rs:27
objc_exception::try::{{closure}} lib.rs:68
objc_exception::try_no_ret::try_objc_execute_closure lib.rs:34
RustObjCExceptionTryCatch exception.m:10
objc_exception::try_no_ret lib.rs:44
objc_exception::try lib.rs:67
objc::exception::try exception.rs:8
objc::message::platform::send_unverified mod.rs:26
[Inlined] objc::message::send_message mod.rs:178
tao::platform_impl::platform::event_loop::EventLoop<T>::run_return event_loop.rs:193
tao::platform_impl::platform::event_loop::EventLoop<T>::run event_loop.rs:160
tao::event_loop::EventLoop<T>::run event_loop.rs:179
<tauri_runtime_wry::Wry<T> as tauri_runtime::Runtime<T>>::run lib.rs:2299
tauri::app::App<R>::run app.rs:868
tauri::app::Builder<R>::run app.rs:1723
rezasm_tauri::main main.rs:127
core::ops::function::FnOnce::call_once function.rs:250
std::sys_common::backtrace::__rust_begin_short_backtrace backtrace.rs:155
std::rt::lang_start::{{closure}} rt.rs:166
[Inlined] core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once function.rs:284
[Inlined] std::panicking::try::do_call panicking.rs:552
[Inlined] std::panicking::try panicking.rs:516
[Inlined] std::panic::catch_unwind panic.rs:146
[Inlined] std::rt::lang_start_internal::{{closure}} rt.rs:148
[Inlined] std::panicking::try::do_call panicking.rs:552
[Inlined] std::panicking::try panicking.rs:516
[Inlined] std::panic::catch_unwind panic.rs:146
std::rt::lang_start_internal rt.rs:148
std::rt::lang_start rt.rs:165
main 0x0000000100a8e950
start 0x00000001888060e0
Final investigation reveals that libpng
from Homebrew is the culprit -- uninstalling it stopped the crashing.
But why do it crash when "libpng" from Homebrew is installed ?
Where is the "other" "libpng" that it conflicts with ?
So the problem is that "dotnet" links to "CoreServices" that uses "ImageIO" framework. The ImageIO framework is using a "libPng.dylib" (I assume is very old). But if another "libpng" is installed from Homebrew or any other. Then normally you would have this:
libpng16.16.dylib
libpng.dylib -> libpng16.16.dylib
libpng16.dylib -> libpng16.16.dylib
The crash is because the "libpng.dylib" symbolic link is present, then the ImageIO framework tries to load that "libpng" and it do not match the API it expected.
So the simple solution is to delete the "libpng.dylib" symbolic link.
I would think the same solution could be used here. But not sure.
Describe the bug
I'm trying out Tauri on m M1 macbook air. Every time I try to run a tauri app it crashes. It comiles without issue, but as soon as I try to run it it crashes showing no error message in the terminal. However, I get an error report window saying:
Anyone else encountering the same problem or know if I'm doing something wrong.
Reproduction
I see the error when doing the basic html display app shown here: https://tauri.app/v1/guides/getting-started/setup/html-css-js/
Expected behavior
I expect the window to open and show the html contents.
Platform and versions
Stack trace
Additional context
No response