Template crashes on M1 mac

Open
#103 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust

Research direction

Start by reproducing the native M1 failure with cargo run in the eframe_template project and compare it with the working wasm build. Use the crash report's AppKit/ImageIO and eframe::native::app_icon frames to locate the relevant startup path; done means the template runs natively on an M1 Mac without the SIGBUS crash.

Written by the indexing model from the issue text.

Description

I try compiling and running the template natively on my M1 MacBook air and it crashes with the message:

cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/eframe_template`
fish: Job 1, 'cargo run' terminated by signal SIGBUS (Misaligned address error)

An error reporting window compiles the report:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               eframe_template [9468]
Path:                  /Users/USER/Documents/*/eframe_template
Identifier:            eframe_template
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        fish [6166]
Responsible:           iTerm2 [1407]
User ID:               501

Date/Time:             2023-07-04 10:10:42.6998 +0200
OS Version:            macOS 13.4.1 (22F82)
Report Version:        12
Anonymous UUID:        A0084DB1-8AEA-596D-03B6-D711C864AD81

Sleep/Wake UUID:       C055D727-CF4F-45C5-B42C-B23FBE7D3BE2

Time Awake Since Boot: 220000 seconds
Time Since Wake:       2663 seconds

System Integrity Protection: enabled

Crashed Thread:        0  main  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGBUS)
Exception Codes:       UNKNOWN_0x101 at 0x000000000bad4007
Exception Codes:       0x0000000000000101, 0x000000000bad4007

Termination Reason:    Namespace SIGNAL, Code 10 Bus error: 10
Terminating Process:   exc handler [9468]

VM Region Info: 0xbad4007 is not in any region.  Bytes before following region: 4142219257
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      102928000-102e04000    [ 4976K] r-x/r-x SM=COW  ...rame_template

Thread 0 Crashed:: main Dispatch queue: com.apple.main-thread
0   ???                           	         0xbad4007 ???
1   ImageIO                       	       0x18d2d1064 IIOReadPlugin::callInitialize() + 136
2   ImageIO                       	       0x18d2d0d78 IIO_Reader::initImageAtOffset(CGImagePlugin*, unsigned long, unsigned long, unsigned long) + 124
3   ImageIO                       	       0x18d2ce60c IIOImageSource::makeImagePlus(unsigned long, IIODictionary*) + 808
4   ImageIO                       	       0x18d2cdee8 IIOImageSource::getPropertiesAtIndexInternal(unsigned long, IIODictionary*) + 72
5   ImageIO                       	       0x18d2cde24 IIOImageSource::copyPropertiesAtIndex(unsigned long, IIODictionary*) + 24
6   ImageIO                       	       0x18d2cdd2c CGImageSourceCopyPropertiesAtIndex + 276
7   AppKit                        	       0x186a2d008 ImageSourceOptionsForCGImageSource_index_ + 64
8   AppKit                        	       0x186a2ce88 +[NSBitmapImageRep _imagesWithData:hfsFileType:extension:zone:expandImageContentNow:includeAllReps:] + 428
9   AppKit                        	       0x186b4a4d8 +[NSBitmapImageRep imageRepsWithData:] + 68
10  AppKit                        	       0x186b49e34 -[NSImage initWithData:] + 76
11  eframe_template               	       0x102a22668 eframe::native::app_icon::AppTitleIconSe

Etc...

Anyone else having a similar problem? It works in wasm, but not natively.

Dominant language
Rust
Stars
1.2k
Forks
235
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from emilk/eframe_template

All issues in emilk/eframe_template

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.