swiftDialog icon indicating copy to clipboard operation
swiftDialog copied to clipboard

swiftDialog crashes with macOS Sequoia Beta 1

Open FranckSartori opened this issue 1 year ago • 10 comments

When running the same workflow, swiftDialog crashes with macOS Sequoia Beta 1 but not with macOS Sonoma. At the moment the crash happens, 2 reports are available in the Console, one for Dialog and one for sudo. For one workflow, the crash happens always at the exact same step when the interface is updated through the command file. The issue is observed with macOS Sequoia Beta 1 using swiftDialog 2.4.2 and 2.5.0. So far, we are at the stage where we have samples of the Crash Reports and a sample of swiftDialog executed using --debug --verbose 2>/Users/Shared/swiftdialog.log Today, I have no idea of the difficulty to build an autonomous script that will make possible to reproduce easily the issue. I imagine that it may be possible to rewrite a demo script based on the latest commands sent originally by the main script to swiftDialog. But I bear in mind that we are only with macOS Sequoia Beta 1 so if the logs do not reveal insights, maybe it's not worth to use too much time on this topic right now. CrashReports.zip swiftdialog.log

FranckSartori avatar Jun 18 '24 20:06 FranckSartori

Strange. I have been running swiftdialog 2.5.0-4768 with Sequoia macOS 15, through setup-your-mac and I havent had a single crash. I have about 50 mac's in my lab and we have been roating the provisioning on these systems daily and have not seen any issues.

tempusthales avatar Jun 18 '24 21:06 tempusthales

This is where the variable may not be obvious to find out. In my workflows, many actions sent to swiftDialog are executed perfectly until one of them specifically triggers the crash. By chance, the crash does not appear randomly as far as I observed on one of the workflow, and what I send is not so creative, so at some point and with time, I will be able to find which action sent to the command file is eventually the root cause. But before digging into it, I prefer to wait for any insight of the developer.

FranckSartori avatar Jun 18 '24 22:06 FranckSartori

@tempusthales Hi. Is it possible to know on which hardware you are using swiftdialog 2.5.0-4768 with Sequoia Beta 1 ? Are they Apple silicon Mac ? Intel Mac ?

FranckSartori avatar Jun 20 '24 18:06 FranckSartori

@tempusthales Hi. Also may I know if you are executing swiftDialog from a script executed as root ? I ask because when the swiftDialog process crashes ("User" type on the console > Crash Report), I have in the same second, just before or after, a crash from a "sudo" process ("System" type in the console > Crash Report). I double checked that my crashing scripts do not execute any sudo before the /usr/local/bin/dialog command. I have run several tiny scripts but there are not really representative of the target (too simplistic), they are not executed from the root user by default, and yes, they do not trigger crashes. This WE, I will test with a previous version of swiftDialog to see if it can help the author to know that some changes at some point play a role in the issue.

FranckSartori avatar Jun 21 '24 07:06 FranckSartori

I have tested with version 2.2.1, with and without prefixing the dialog command with launchctl asuser $LOGGEDINACCOUNTUID sudo -u "$LOGGEDINACCOUNT" which I need for copy/pasting with this version. That does not prevent the crashes to happen after several actions sent to the command file.

FranckSartori avatar Jun 22 '24 11:06 FranckSartori

Hi. I observe the same crash with macOS Sequoia Beta 2.

FranckSartori avatar Jun 24 '24 19:06 FranckSartori

Hi. I eventually found a sequence that triggers a crash of swiftDialog with macOS Sequoia Beta 2.

#!/bin/bash

/usr/local/bin/dialog --width 800 --height 690 --moveable --commandfile /var/tmp/dialog_main.log --titlefont size=26 --messagefont size=14 --progress --icon /var/tmp/icon1.png --infobox "A" --infotext "B" --title "C" --message "D" --progresstext ' ' --button1text E --button1disabled & sleep 0.5

# When the following list is displayed, swiftDialog will crash with macOS Sequoia only, when the following echo happens

echo "list: 1,2" >> /var/tmp/dialog_main.log

sleep 5

echo "message: New text" >> /var/tmp/dialog_main.log

sleep 5

FranckSartori avatar Jun 27 '24 04:06 FranckSartori

This might be related, since the error seems similar, but I am seeing:

/usr/local/bin/dialog: line 18: 2101 Illegal instruction: 4 launchctl asuser "$uid" sudo -u "$currentUser" "$@"

On MacOS 12, and it only happens when I include the --message flag.

jarrodCoombes avatar Jul 02 '24 23:07 jarrodCoombes

Following @jarrodCoombes report, I was able to ascertain that the crash triggered by the above sequence cannot be reproduced with swiftDialog 2.0.1-3814 but does occur with swiftDialog 2.1.0-4009 and later.

FranckSartori avatar Jul 04 '24 06:07 FranckSartori

I'm also seeing this behavior on Sequoia beta 2 (24A5279h) using Dialog v2.5.0.4766. Whenever trying to update the message, icon, or clear a list of a running Dialog prompt it will result in a crash, however I am able to update individual list items in a running prompt. Same issue occurs if running as root or user.

dialog_logs.zip

burnsburns avatar Jul 05 '24 18:07 burnsburns

I am able to confirm that this issue is still happing in Sequoia beta 6

lincolnep avatar Aug 14 '24 06:08 lincolnep

Version 2.5.1b3 fixes the crashes I was observing with macOS Sequoia.

FranckSartori avatar Aug 16 '24 23:08 FranckSartori