obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
60.31k stars 7.99k forks source link

Crash on boot for particular `basic/scenes/Untitled.json` #10682

Open Glitched opened 6 months ago

Glitched commented 6 months ago

Operating System Info

macOS 14

Other OS

No response

OBS Studio Version

30.1.2

OBS Studio Version (Other)

No response

OBS Studio Log URL

https://obsproject.com/logs/PoDNSobWHFldo2Nz

OBS Studio Crash Log URL

No crash logs generated

Expected Behavior

OBS not to crash on startup.

I don't think those OBS logs will be super useful -- I looked at all my logs and they don't seem to have anything related to the crash.

I also found making a more than few websocket requests back to back consistently creates bad Untitled.json files which cause my OBS to crash on startup.

Current Behavior

OBS crashes on startup with seemingly no relevant logs.

Steps to Reproduce

I got here from programmatically making a number of (valid) websocket requests, but I found I the source of. the crash to be in the Untitled.json that OBS created.

  1. Starting from a fresh install
  2. Open OBS so files in ~/Library/Application Support/obs-studio/ are created
  3. Replace ~/Library/Application Support/obs-studio/basic/scenes/Untitled.json with the following contents:
    {
    "AuxAudioDevice1": {
        "prev_ver": 503382018,
        "name": "Mic/Aux",
        "uuid": "44d819e4-36e9-42d8-adac-d94909f8dfec",
        "id": "coreaudio_input_capture",
        "versioned_id": "coreaudio_input_capture",
        "settings": {
            "device_id": "default"
        },
        "mixers": 255,
        "sync": 0,
        "flags": 0,
        "volume": 1.0,
        "balance": 0.5,
        "enabled": true,
        "muted": false,
        "push-to-mute": false,
        "push-to-mute-delay": 0,
        "push-to-talk": false,
        "push-to-talk-delay": 0,
        "hotkeys": {
            "libobs.mute": [],
            "libobs.unmute": [],
            "libobs.push-to-mute": [],
            "libobs.push-to-talk": []
        },
        "deinterlace_mode": 0,
        "deinterlace_field_order": 0,
        "monitoring_type": 0,
        "private_settings": {}
    },
    "current_scene": "",
    "current_program_scene": "",
    "scene_order": [],
    "name": "Untitled",
    "sources": [
        {
            "prev_ver": 503382018,
            "name": "Countdown Timer • 0b391f21-41d9-4600-8f00-9d0287851f4c",
            "uuid": "48c11126-c4e9-406d-88e5-829edda05999",
            "id": "text_ft2_source",
            "versioned_id": "text_ft2_source_v2",
            "settings": {
                "color": 4294967295,
                "text": "4:08",
                "font": {
                    "face": "Avenir",
                    "size": 120
                },
                "color1": 4278198255,
                "color2": 4278190185
            },
            "mixers": 0,
            "sync": 0,
            "flags": 0,
            "volume": 1.0,
            "balance": 0.5,
            "enabled": true,
            "muted": false,
            "push-to-mute": false,
            "push-to-mute-delay": 0,
            "push-to-talk": false,
            "push-to-talk-delay": 0,
            "hotkeys": {},
            "deinterlace_mode": 0,
            "deinterlace_field_order": 0,
            "monitoring_type": 0,
            "private_settings": {}
        },
        {
            "prev_ver": 503382018,
            "name": "Execution Text • 0b391f21-41d9-4600-8f00-9d0287851f4c",
            "uuid": "9d260956-d599-4c97-8c2f-882552682978",
            "id": "text_ft2_source",
            "versioned_id": "text_ft2_source_v2",
            "settings": {
                "color": 4294967295,
                "text": "Execution",
                "font": {
                    "face": "Avenir",
                    "size": 120
                },
                "color1": 4278198255,
                "color2": 4278190185
            },
            "mixers": 0,
            "sync": 0,
            "flags": 0,
            "volume": 1.0,
            "balance": 0.5,
            "enabled": true,
            "muted": false,
            "push-to-mute": false,
            "push-to-mute-delay": 0,
            "push-to-talk": false,
            "push-to-talk-delay": 0,
            "hotkeys": {},
            "deinterlace_mode": 0,
            "deinterlace_field_order": 0,
            "monitoring_type": 0,
            "private_settings": {}
        }
    ],
    "groups": [],
    "quick_transitions": [
        {
            "name": "Cut",
            "duration": 300,
            "hotkeys": [],
            "id": 1,
            "fade_to_black": false
        },
        {
            "name": "Fade",
            "duration": 300,
            "hotkeys": [],
            "id": 2,
            "fade_to_black": false
        },
        {
            "name": "Fade",
            "duration": 300,
            "hotkeys": [],
            "id": 3,
            "fade_to_black": true
        }
    ],
    "transitions": [],
    "saved_projectors": [],
    "current_transition": "Fade",
    "transition_duration": 300,
    "preview_locked": false,
    "scaling_enabled": false,
    "scaling_level": 0,
    "scaling_off_x": 0.0,
    "scaling_off_y": 0.0,
    "virtual-camera": {
        "type2": 3
    },
    "modules": {
        "scripts-tool": [],
        "output-timer": {
            "streamTimerHours": 0,
            "streamTimerMinutes": 0,
            "streamTimerSeconds": 30,
            "recordTimerHours": 0,
            "recordTimerMinutes": 0,
            "recordTimerSeconds": 30,
            "autoStartStreamTimer": false,
            "autoStartRecordTimer": false,
            "pauseRecordTimer": true
        },
        "auto-scene-switcher": {
            "interval": 300,
            "non_matching_scene": "",
            "switch_if_not_matching": false,
            "active": false,
            "switches": []
        }
    }
    }

Anything else we should know?

No response

RytoEX commented 6 months ago

macOS application crash logs are handled by macOS and available on application crash or via Console.app.

  1. Open Console.app (Located in /Applications/Utilities).
  2. Navigate to the Crash Reports view along the left sidebar, then sort the table by date to find the most recent crash with the OBS process name.
  3. Drag and drop the selected crash onto the comment box to upload the file, or zip it and upload it, or copy-and-paste the report text here.

Strangely, this crash looks like it occurs within obs-websocket itself. Worth noting that this does not cause a crash on Windows. However, since there are no scenes defined in the scene collection, nothing is displayed.

The key here seems to be that there are no scenes in the scene collection file, which causes a crash deep in obs-websocket/nlohmann-json/stdlib when trying to get the name of the current scene (there is none).

Did you delete all scenes via websocket calls?

cc @tt2468