AcademySoftwareFoundation / AcademySoftwareFoundation/OpenTimelineIO

BUG: M1 builds failing on M3 and with Imath 3.19?

Open
#1,750 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
2k
Forks
351
Avg merge
1d 12h
Merged PRs (30d)
1

Description

# Required:
------------
[x ] I believe this isn't a duplicate topic
[ x] This report is not related to an adapter

## Select One:

[ ] Build problem
[x ] Incorrect Functionality or bug
[ ] New feature or functionality

## Description
I don't own any Apple Silicon machines. I build my program on GitHub Actions which builds with:

Building with Apple clang version 15.0.0 (clang-1500.0.40.1), 3 cores
Building on MacOS Brand Apple M1 (Virtual)

The code:

```
const otio::Timeline* createTimelineFromString(const std::string& s)
{
auto timeline = dynamic_cast(
otio::Timeline::from_json_string(s));
if (!timeline)
{
LOG_ERROR("Could not crete timeline object from this "
".json string:");
LOG_ERROR(s);
return nullptr;
}
return timeline;
}
```
Returns a nullptr when passed a valid json string (which was retrieved from another otio::Timeline->to_json_string()).
It seems it is a compiler issue (or a very subtle bug on OTIO).
The code works perfectly on macOS Intel, macOS M3 with Intel build under Rosseta2, Windows and Linux.

# Optional
-----------

## Environment

Operating System: macOS Sonoma - M3 chip (Built on GitHub Actions M1 build).
OTIO version: v0.16.0
Imath version: v3.19
Python version if appropriate: N/A

## Reproduction Steps

Binary reproduction (for the lazy one):

1. For a quick check on M1 binaries (run it on an M3 box), you can check:
https://sourceforge.net/projects/mrv2/files/beta/mrv2-beta-Darwin-arm64.dmg/download
2. Load a Movie File (Open->Movie or Sequence)
3. Open the Panel->Files Panel (F4 key).
4. Open the Panel->Playlist (Ctrl + P)
5. Drag the clip from the Files Panel to the Playlist. You should get an error when the timeline function fails and the .otio string that it failed with in the Logs (Panel->Logs).

Source code reproduction (cannot verify):

I've created a small stand-alone test which I am unable to test as I don't own an M1/M3 combo. You should try to compile it on an M1 box and run it on an M3 one to see if it fails.
If it fails, but it should allow you to hopefully reproduce the issue (and fix the OTIO issue or report the clang bug to Apple):

[m1_to_m3_otio_bug.zip](https://github.com/AcademySoftwareFoundation/OpenTimelineIO/files/15365721/m1_to_m3_otio_bug.zip)

## Log output if appropriate

See the output of my program when the user tried to run it on an M3 machine:
https://github.com/ggarra13/mrv2/issues/238

Contributor guide

Open the contributing guide

Research direction

Start with the attached m1_to_m3_otio_bug.zip and reproduce the M1 build running on an M3, then trace otio::Timeline::from_json_string alongside to_json_string and the dynamic_cast shown in the report. Done means determining whether the nullptr is caused by OpenTimelineIO or Apple clang and documenting a reproducible result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.