lpub3d icon indicating copy to clipboard operation
lpub3d copied to clipboard

LPub3D crashes on Mac

Open lujstn opened this issue 2 years ago • 1 comments

Subject

Unfortunately LPub3D crashes when attempting to open any file with macOS, after displaying the following errors on launch. I'm imagining this is because brew on Apple Silicon stores files at /opt/homebrew/Cellar instead... Screenshot 2024-04-03 at 18 38 30 Screenshot 2024-04-03 at 18 38 28

Environment

  • Version of LPub3D: Release 2.4.7 Revision 75 Build 3551
  • Operating system: macOS 14.4.1, x86_64, 4.1 Metal - 88 (Apple M2 Max)

Configuration

  • LPub3D installation path: /Applications/LPub3D.app
  • Application data path: ~/Library/Application\ Support/LPub3D\ Software/LPub3D/
  • Registry Extract: Cannot find

lujstn avatar Apr 03 '24 17:04 lujstn

I've tested 2.4.5-2.4.7 and have the same problem. If there is anyone with that can help how to install the required library or a better solution, please show how it's done. Thank you

citrasusanto avatar Jul 02 '24 03:07 citrasusanto

Thank you for reporting this behaviour. I'll take a look.

Cheers,

trevorsandy avatar Sep 22 '24 04:09 trevorsandy

Current versions of LPub3D and its renderers are not compiled for the Apple silicon ARM (M1, M2...) processor platforms running macOS 14+. Consequently, running LPub3D on an Apple silicon PC will require Rosetta which, if not already installed on your PC will, you will be prompted to install it on your attempt to run LPub3D.

More importantly, current versions of LPub3D will require Homebrew for Intel (x86_64) processors. As you may know, the default Homebrew install location has changed for Apple silicon PCs moreover these libraries are arm64 compatible and will not work with current versions of LPub3D. All this means you will have to install in Intel instance of Homebrew in the traditional location (/usr/local/opt) to run current versions of LPub3D successfully.

This behaviour has been treated with the enhancement to support Apple silicon arm64 platforms running macOS 14+. This is to say LPub3D will look for its required libraries in the default Intel Homebrew location , but beginning with v2.4.8, you will have the ability to define where LPub3D should look for Homebrew Intel libraries in the event your Intel Homebrew install location is not exposed to /usr/local/opt.

However, beginning with v2.4.8, it will not be necessary to install Intel Homebrew (i.e. setup x86_64 libraries) as Apple silicon compliant LPub3D distributions will be available - see ticket #761 for more info. Complete details are available in the updated README.txt for macOS distributions.

Cheers,

trevorsandy avatar Oct 10 '24 10:10 trevorsandy

Hi @trevorsandy,

I hope you’re doing well! I wanted to commend you on your excellent work with LPub3D 2.4.8. I tried downloading the ARM64 version from both GitHub and SourceForge today, but I encountered an error when trying to run it on my M1 MacBook Air (2020).

Could you please take a look at this issue?

Screenshot 2024-10-19 at 12 30 44

citrasusanto avatar Oct 19 '24 05:10 citrasusanto

Hello Citra - Thank you for reporting this behaviour. I will take a look.

I do not personally have an arm64/M1/2 Mac.

I am using the GitHub macOS 14 runner to build LPub3D arm64 for Apple silicon processor platforms.

This behaviour is quite strange as my build checks do not show any adverse activity - see details if you like:

Start build_checks.sh execution at /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx...

--Buld Check Settings:
--LPUB3D_EXE.........LPub3D.app/Contents/MacOS/LPub3D
--SOURCE_DIR.........../..
--LP3D_OS_NAME.......Darwin
--LP3D_TARGET_ARCH...arm64
--LP3D_PLATFORM......macOS


------------Build Checks Start--------------

- Check 1 of 7: Native File Process Check... PASSED, ELAPSED TIME [21sec]
Native File Process Command: --no-stdout-log --process-file --liblego --preferred-renderer native /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/build_checks.mpd

- Check 2 of 7: LDView File Process Check... PASSED, ELAPSED TIME [21sec]
LDView File Process Command: --no-stdout-log --process-file --clear-cache --liblego --preferred-renderer ldview /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/build_checks.mpd

- Check 3 of 7: LDView (Single Call) File Process Check... PASSED, ELAPSED TIME [27sec]
LDView (Single Call) File Process Command: --no-stdout-log --process-file --clear-cache --liblego --preferred-renderer ldview-sc /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/build_checks.mpd

- Check 4 of 7: LDGLite Export Range Check... PASSED, ELAPSED TIME [22sec]
LDGLite Export Range Command: --no-stdout-log --process-export --range 1-3 --clear-cache --liblego --preferred-renderer ldglite /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/build_checks.mpd

- Check 5 of 7: Native POV Generation Check... PASSED, ELAPSED TIME [54sec]
Native POV Generation Command: --no-stdout-log --process-file --clear-cache --liblego --preferred-renderer povray /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/build_checks.mpd

- Check 6 of 7: LDView TENTE Model Check... PASSED, ELAPSED TIME [17sec]
LDView TENTE Model Command: --no-stdout-log --process-file --clear-cache --libtente --preferred-renderer ldview /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/TENTE/astromovil.ldr

- Check 7 of 7: LDView (Snapshot List) VEXIQ Model Check... PASSED, ELAPSED TIME [23sec]
LDView (Snapshot List) VEXIQ Model Command: --no-stdout-log --process-file --clear-cache --libvexiq --preferred-renderer ldview-scsl /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/../builds/check/VEXIQ/spider.mpd

Moved /Users/runner/Library/Application Support/LPub3D Software/LPub3D/logs/LPub3DLog.txt to /Users/runner/work/lpub3d/buildpkg/LPub3DRun.log

----Build Check Completed: PASS (7)[1,2,3,4,5,6,7], FAIL (0)[], ELAPSED TIME [3mins 5sec]----

- setup dmg source dir /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx/DMGSRC...
- move LPub3D.app to /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx/DMGSRC...
- setup dmg output directory /Users/runner/work/lpub3d/dmgbuild/DMGS...
- created dmg output directory /Users/runner/work/lpub3d/dmgbuild/DMGS
- generate README file and dmg make script...
- copy lpub3d package assets to to /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx/....
- set create-dmg build scrpt permissions...
- copy README to Resources/README_macOS.txt...
- generate makedmg script...
- create LPub3D dmg package in /Users/runner/work/lpub3d/dmgbuild/DMGS...
    __VOLUME_NAME.....................: LPub3D-Installer
    __VOLUME_ICON_FILE................: setup.icns
    __BACKGROUND_FILE.................: lpub3dbkg.png
    __BACKGROUND_FILE_NAME............: lpub3dbkg.png
    __BACKGROUND_CLAUSE...............: set background picture of opts to file ".background:lpub3dbkg.png"
    __REPOSITION_HIDDEN_FILES_CLAUSE..: set position of every item to {theBottomRightX + 100, 100}
    __ICON_SIZE.......................: 90
    __TEXT_SIZE.......................: 10
    __WINDOW_POSITION WINX, WINY......: 200, 120
    __WINDOW_SIZE WINW, WINH..........: 640, 480
    __ICON_POSITION_CLAUSE............: 
    __HIDE_EXTENSION HIDING_CLAUSE....: set the extension hidden of item "LPub3D.app" to true
			
    __ADD_FILE_TARGETS................: Readme
    __ADD_FILE_SOURCES................: README
    __POSITION_CLAUSE.................: set position of item "LPub3D.app" to {192, 344}
			
			set position of item "Readme" to {512, 128}
			
    __APPLICATION_LINK X, Y...........: 448, 344
    __APPLICATION_CLAUSE..............: set position of item "Applications" to {448, 344}
			
    __EULA_RSRC.......................: .COPYING
    __SCRIPT_DIR......................: /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/utilities/dmg-utils
    __DMG_PATH........................: ../../../DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
    __DMG_DIRNAME.....................: ../../../DMGS
    __DMG_DIR.........................: /Users/runner/work/lpub3d/dmgbuild/DMGS
    __DMG_NAME........................: LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
    __DMG_TEMP_NAME...................: /Users/runner/work/lpub3d/dmgbuild/DMGS/rw.33554.LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
    __SRC_FOLDER......................: /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx/DMGSRC
    __CDMG_SUPPORT_DIR................: /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/utilities/dmg-utils/support
Creating disk image...
created: /Users/runner/work/lpub3d/dmgbuild/DMGS/rw.33554.LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
Mounting disk image...
Device name:     /dev/disk4
Searching for mounted interstitial disk image using /dev/disk4s... 
Mount dir:       /Volumes/dmg.CjT8yY
Copying background file 'lpub3dbkg.png'...
Making link to Applications dir...
/Volumes/dmg.CjT8yY
Copying volume icon file 'setup.icns'...
Copying custom files...
README
Will sleep for 2 seconds to workaround occasions "Can't get disk (-1728)" issues...
Running AppleScript to make Finder stuff pretty: /usr/bin/osascript "/var/folders/q5/6nls1_g145s2fl1lbvx2zby40000gn/T/createdmg.tmp.XXXXXXXXXX.ZqEwMKPuX3" "dmg.CjT8yY"
waited 1 seconds for .DS_STORE to be created.
Done running the AppleScript...
Fixing permissions...
Done fixing permissions
Skipping blessing on sandbox
Deleting .fseventsd
Unmounting disk image...
"disk4" ejected.
Compressing disk image...
Preparing imaging engine…
Reading Protective Master Boot Record (MBR : 0)…
   (CRC32 $A5E4DD33: Protective Master Boot Record (MBR : 0))
Reading GPT Header (Primary GPT Header : 1)…
   (CRC32 $4B5154AB: GPT Header (Primary GPT Header : 1))
Reading GPT Partition Data (Primary GPT Table : 2)…
   (CRC32 $236BEC7F: GPT Partition Data (Primary GPT Table : 2))
Reading  (Apple_Free : 3)…
   (CRC32 $00000000:  (Apple_Free : 3))
Reading disk image (Apple_HFS : 4)…
   (CRC32 $7F2FF628: disk image (Apple_HFS : 4))
Reading  (Apple_Free : 5)…
   (CRC32 $00000000:  (Apple_Free : 5))
Reading GPT Partition Data (Backup GPT Table : 6)…
   (CRC32 $236BEC7F: GPT Partition Data (Backup GPT Table : 6))
Reading GPT Header (Backup GPT Header : 7)…
   (CRC32 $33354F93: GPT Header (Backup GPT Header : 7))
Adding resources…
Elapsed Time:  5.365s
File size: 225[2938](https://github.com/trevorsandy/lpub3d/actions/runs/11398330823/job/31715187432#step:6:2939)72 bytes, Checksum: CRC32 $19E2E6A3
Sectors processed: 610380, 536588 compressed
Speed: 48.8MB/s
Savings: 27.9%
created: /Users/runner/work/lpub3d/dmgbuild/DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
Adding EULA resources...
Successfully added the EULA license
hdiutil does not support internet-enable. Note it was removed in macOS 10.15.
Disk image done
      Distribution package.: LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
      Package path.........: /Users/runner/work/lpub3d/dmgbuild/lpub3d/builds/macx/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
- cleanup...
----------------------------------------------------
CreateDmg.sh for (arm64) Finished!
Elapsed build time: 0hrs 9min 50sec
----------------------------------------------------
+ '[' -d /Users/runner/work/lpub3d/dmgbuild/DMGS ']'
+ cd /Users/runner/work/lpub3d/dmgbuild/DMGS
++ find . -name LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg -type f
+ file_DPkg=./LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
+ '[' -n ./LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg ']'
+ sha512sum ./LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
+ echo 'Package Files:'
+ find /Users/runner/work/lpub3d/dmgbuild/DMGS -type f
Package Files:
/Users/runner/work/lpub3d/dmgbuild/DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg
/Users/runner/work/lpub3d/dmgbuild/DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg.sha512
+ echo 'Moving build assets and logs to output folder...'
Moving build assets and logs to output folder...
+ cd /Users/runner/
+ mv -f /Users/runner/work/lpub3d/dmgbuild/DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg /Users/runner/work/lpub3d/dmgbuild/DMGS/LPub3D-2.4.8.0.3723_20241018-arm64-macos.dmg.sha512 /Users/runner/work/lpub3d/buildpkg/
+ mv -f '/Users/runner/work/lpub3d/lpub3d/*.log' /Users/runner/work/lpub3d/buildpkg
+ :
+ mv -f '/Users/runner/work/lpub3d/dmgbuild/*.log' /Users/runner/work/lpub3d/buildpkg
+ :
+ mv -f './*.log' /Users/runner/work/lpub3d/buildpkg
+ :
+ mv -f './*_assets.tar.gz' /Users/runner/work/lpub3d/buildpkg
+ :
+ exit 0
+ FinishElapsedTime
+ set +x
----------------------------------------------------
macos-build.sh for (arm64) Finished!
Elapsed build time: 0hrs 10min 53sec
----------------------------------------------------

Perhaps the problem is introduced during the packaging process...

Can you access the contents of LPub3D.app ?

Cheers,

trevorsandy avatar Oct 19 '24 07:10 trevorsandy

Hi Citra - after a quick google search, I came across this post on Apple's discussion website:

XYZ Is Damaged and Can’t Be Opened. You Should Move It To The Trash

From what I have read, the following command, when run from a console session, may correct this macOS behaviour:

xattr -c /Applications/LPub3D.app

Cheers,

trevorsandy avatar Oct 19 '24 08:10 trevorsandy

Hi Citra - after a quick google search, I came across this post from Apple's website itself:

XYZ Is Damaged and Can’t Be Opened. You Should Move It To The Trash

From what I have read, the following command, when run from a console session, may correct this macOS behaviour:

xattr -c /Applications/LPub3D.app

Cheers,

I'm glad to report that I can open the app now. However, Iam still receiving the same problem with the x86_64 version.

  1. LDView Error on Startup: I continue to receive an error message when starting LDView (repeatedly). Screenshot 2024-10-19 at 22 29 20

  2. Renderer Issues:

a. The only renderer that works is LDGLite b. The native renderer takes a long time to process and consumes all available memory, leading to an overload. Screenshot 2024-10-19 at 22 33 25

c. LDView displays nothing at all d. I've not used POV-Ray or Blender for this.

Thank you for your fast reply

citrasusanto avatar Oct 19 '24 15:10 citrasusanto

  1. LDView Error on Startup: I continue to receive an error message when starting LDView (repeatedly).

FYI, LPub3D uses the OSMesa console version of LDView. Can you confirm that XQuartz (OSMesa) is installed and that the version is compatible with the requirements for the LDView renderer ? See #761 (or the LPub3D macOS README.txt for further details).

1, 2a., 2b., 2c.

POVRay needs x11 and will likely have the same behaviour as LDView as they both depend on the XQuartz library. See 1.

2c.

FYI, on ARM processors, the LDView renderer (using XQuartz x11) may be unstable when using OpenGL's GLES vs the traditional GLU/GLUT. ARM platforms are usually using the newer GLES libraries. This may be contributing to the unexpected behavior of LDView on your machine. Counter to this hypothesis, is the fact that build checks are successful on GitHub macOS 14 which uses an arm64 runner. As a result, this conclusion is not yet certain as I am still investigating.

Note: Following from above, I also want to share this LDView ticket which may explain the empty LDView snapshot renders. To implement the recommended LDView arguments discussed in the referenced ticket, you can use the following LPub3D additional arguments meta commands:

0 !LPUB SUBMODEL_DISPLAY LDVIEW_PARMS "IgnoreFramebufferObject=1"
0 !LPUB ASSEM LDVIEW_PARMS "IgnoreFramebufferObject=1"
0 !LPUB BOM LDVIEW_PARMS "IgnoreFramebufferObject=1"
0 !LPUB PLI LDVIEW_PARMS "IgnoreFramebufferObject=1"

2d.

FYI, Blender is not a STEP/Page renderer, its use cases are for high-quality photo-realistic model rendering - similar to POVRay. However, while POVRay is enabled in LPub3D to provide STEP/Page rendering, Blender is not - as the rendering process takes too long.

Finally, please provide the following if you can - this will help me alot to 'see' what is going on as I do not have an Apple silicon machine. Many thanks.

Logs

  • Application Log: [Application data path]/logs/LPub3DLog.txt

Configuration

  • LPub3D installation path

    • macOS: /Applications/LPub3D.app
  • Application data path

    • macOS: ~/Library/Application Support/LPub3D Software/LPub3D/
  • Registry Extract

    • macOS: ~/Library/Preferences/com.lpub3d-software.LPub3D.plist
  • Renderer configuration files

    • [Application data path]/ldv/ldvExport.ini
    • [Application data path]/3rdParty/ldglite-1.3/config/ldglite.ini
    • [Application data path]/3rdParty/ldview-4.5/config/ldview.ini
    • [Application data path]/3rdParty/ldview-4.5/config/ldviewPOV.ini
    • [Application data path]/3rdParty/lpub3d_trace_cui-3.8/config/povray.conf
    • [Application data path]/3rdParty/lpub3d_trace_cui-3.8/config/povray.ini
  • List of required library paths and version

Here are the details on how to gather the library information - see #761 or the LPub3D macOS README.txt for the full library list.

Install libraries

For an Apple silicon or Apple Intel processor:

brew update
brew reinstall libpng tinyxml gl2ps libjpeg minizip openexr sdl2 libtiff
brew install --cask xquartz

For an x86_64 brew installation on an Apple silicon arm64 processor:

arch -x86_64 /usr/local/homebrew/bin/brew reinstall libpng tinyxml gl2ps libjpeg minizip openexr sdl2 libtiff
arch -x86_64 /usr/local/homebrew/bin/brew install --cask xquartz

Check installed library using otool (e.g. libpng)

otool -L $(brew list libpng | grep dylib$)

Object Tool (otool) output:

/usr/local/Cellar/libpng/1.6.35/lib/libpng.dylib:
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 52.0.0, current version 52.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

Cheers,

trevorsandy avatar Oct 19 '24 19:10 trevorsandy

Hello. I made a mistake, probably.

New problems have arisen:

  1. I saw the log and thought I was dealing with amd64 architecture, but I mistakenly decided to install a new version of LPub3D for ARM.

  2. I managed to install the ARM version, but it simply won’t run anymore, even after I ran xattr -c /Applications/LPub3D.app

    then a new error showing up. Screenshot 2024-10-22 at 14 18 39

  3. I tried the new x86 architecture version, which ran, but for some reason, I can only change the renderer; the dropdown list only shows native options. Screenshot 2024-10-22 at 14 20 56

  4. Then I attempted to load the previous app that I deleted, and it behaved like in point 2.

citrasusanto avatar Oct 22 '24 07:10 citrasusanto

1. 2. - Ok - Can you share the 'LPub3D arm quit unexpectedly' log ? Thanks!

3. You cannot successfully run an Intel build of LPub3D without first installing an Intel instance of Homebrew - Your renderers simply won't work as they are compiled for the Intel x86_64 libraries which are not installed.. At this point, I would not recommend install the Intel instance of Homebrew as it requires a good level of comfort navigating the underside of your operating system.

4. You should remove any/all instance of LPub3D (delete all items in the 'Log' and 'Configuration' post above) and start over with a download of an arm64 instance of LPub3D.

Cheers,

trevorsandy avatar Oct 22 '24 08:10 trevorsandy

I imagine you are already aware that you are attempting to run an Intel instance of LPub3D on your Apple silicon machine without having an instance of Intel Homebrew or any of the Intel-based dependent libraries installed.

Your Runtime log header shows an Intel (AMD) instance of LPub3D:

INFO ----------------------------- 
INFO LPub3D v2.4.8 for macOS AMD 64bit 
INFO ============================= 
...
INFO LPub3D Homebrew Installation.(Apple Silicon) 
INFO LPub3D Homebrew Path Prefix..(/opt/homebrew/opt) 
...

...It should show an ARM instance and look like this:

INFO ----------------------------- 
INFO LPub3D v2.4.8 for macOS ARM 64bit 
INFO ============================= 
...
INFO LPub3D Homebrew Installation.(Apple Silicon) 
INFO LPub3D Homebrew Path Prefix..(/opt/homebrew/opt)
...

Cheers,

trevorsandy avatar Oct 22 '24 08:10 trevorsandy

Hi @trevorsandy, sorry for the late reply!

I’ve removed all previous x64 versions to prevent future issues and tried downloading the new ARM version from your link, but it's still not working.

I couldn’t find the related folder under Application Support, but I do have the translated report meant for Apple. Let me know if you'd like me to send it over.

I’m considering reformatting my macOS to test again since I upgraded to Sequoia 15.1, which may be contributing to the issue. I’ll reformat first, just to be safe.

citrasusanto avatar Nov 05 '24 07:11 citrasusanto

Hi Citra - very well.

Cheers,

trevorsandy avatar Nov 05 '24 17:11 trevorsandy

Okay, I reformatted back to Sonoma and reinstalled Homebrew. After applying the xattr -c /Applications/LPub3D.app command, which then allow it to run, I was able to open LPub3D, but it crashed with the 'Quit unexpectedly' error, as I mentioned earlier.

I tried checking the logs in the Library/Application Support folder, but there is no LPub3D folder, so no log was recorded.

Is there any other initialization log I could check to provide you with more information?

citrasusanto avatar Nov 05 '24 18:11 citrasusanto

I’ve removed all previous x64 versions to prevent future issues and tried downloading the new ARM version from your link, but it's still not working.

What version of LPub3D are you using ?

If you are using a Development build after 2.4.8 r11 - see the workaround in #782.

Cheers,

trevorsandy avatar Nov 05 '24 19:11 trevorsandy

What version of LPub3D are you using ?

If you are using a Development build after 2.4.8 r11 - see the workaround in #782.

I'm using LPub3D-2.4.8.0.3723_20241019-arm64-macos.dmg. I downloaded it from the release page, but I have tried the suggested workaround, and it still doesn't resolve the issue. The same problem occurs every time I run the app.

citrasusanto avatar Nov 06 '24 16:11 citrasusanto

When you click the Report... button at this message, is there any information reported ? If yes, can you share what is presented ?

Screenshot 2024-10-22 at 14 18 39

Cheers,

trevorsandy avatar Nov 06 '24 19:11 trevorsandy

sure, here. lpub3d startup report.txt

citrasusanto avatar Nov 08 '24 08:11 citrasusanto

Unfortunately, I have bad news. It turns out that Apple requires that every native ARM64 application is code signed (this restriction does not apply to x86-64 applications).

Currently, LPub3D is not code signed. At the moment, I am looking into the requirements to enable this capability on my GitHub action builds.

It is somewhat strange that my GitHub builds are installed and run without error.

Cheers,

trevorsandy avatar Nov 09 '24 00:11 trevorsandy

Ok - more bad news. Apple requires a 100Euro Developer subscription in order to gain access to a certificate which is needed to successfully codesign LPub3D.

The core LPub3D application is free open source software where my only expense, to produce it, is my hardware, time and effort. I am not pleased to have to also pay Apple.

Cheers,

trevorsandy avatar Nov 09 '24 01:11 trevorsandy

Please correct me if I’m wrong. I read that ‘codesign by Apple’ will become compulsory starting with macOS 15.1, which is why I downgraded to macOS 14 (Sonoma).

Before downgrading, I made sure that other open-source software, such as LeoCAD, could still run. I’m not sure if they’re paying Apple for codesigning or not, but I can confirm that LeoCAD runs on macOS 15.1 and any earlier versions. On my current version, macOS 14.7.1, other open-source software also runs fine, including Krita, Godot, LeoCAD, and LDView. If there’s any other open-source software you’d like me to test, I’d be happy to try it.

This leads me to conclude that the issue may not be related to codesigning. Or, perhaps only ARM app versions require codesigning, since I have only tested the Intel versions of these open-source applications. If that’s the case, shouldn’t it be possible to fix and run the Intel version of LPub3D?

NB: Not sure if this is helping. Have you heard of Sigstore? (Open-source & free to provide secure sign and verify software artifacts)

citrasusanto avatar Nov 09 '24 05:11 citrasusanto

Very well.

Did you read the this lpub3d startup report you posted ?

Here is an excerpt:

Process:               LPub3D [27560]\
Path:                  /Applications/LPub3D.app/Contents/MacOS/LPub3D\
Identifier:            com.trevorsandy.lpub3d\
Version:               2.4.8.0 (2.4.8.0.3723-fefe3daca)\
Code Type:             ARM-64 (Native)\
Parent Process:        launchd [1]\
User ID:               501\
\
Date/Time:             2024-11-08 15:42:06.8975 +0700\
OS Version:            macOS 14.7.1 (23H222)\
Report Version:        12\
Anonymous UUID:        2AC18EE3-EE79-63BD-D2B6-B070CBFF7D0E\
\
Sleep/Wake UUID:       48443390-AC5B-47A6-8BB8-EA67C0016095\
\
Time Awake Since Boot: 45000 seconds\
Time Since Wake:       31 seconds\
\
System Integrity Protection: enabled\
\
Crashed Thread:        0\
\
Exception Type:        EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid))\
Exception Codes:       UNKNOWN_0x32 at 0x000000010624c000\
Exception Codes:       0x0000000000000032, 0x000000010624c000\
\
Termination Reason:    Namespace CODESIGNING, Code 2 Invalid Page\

While the OS is indeed not 15.1 - OS Version: macOS 14.7.1, the exception type and termination reason is explicit: Exception Type: EXC_BAD_ACCESS (SIGKILL (Code Signature Invalid)) and Termination Reason: Namespace CODESIGNING, Code 2 Invalid Page.

Please note that the LPub3D arm build is Arm64 native (not x86_64): Code Type: ARM-64 (Native)

I can confirm that LeoCAD runs on macOS 15.1 and any earlier versions. On my current version, macOS 14.7.1, other open-source software also runs fine, including Krita, Godot, LeoCAD, and LDView.

From what I understand, both LeoCAD and LDView are also natively built using the latest macOS GitHub runner. In fact, while LDView uses X-Code which may offer automatic code signing, LeoCAD is built, just as LPub3D is, using Qt and clang. Of course, LPub3D does have significantly more 3rd party dependencies than LeoCAD and the GUI instance of LDView (the OSMesa console version has same requirements to LPub3D). So it is indeed strange that you are having this 'signing' issue only with LPub3D.

Perhaps you can investigate disabling the system integrity (System Integrity Protection: enabled) to check if taking this action would help.

Cheers,

trevorsandy avatar Nov 09 '24 06:11 trevorsandy

Having come this far, perhaps you can try your hand at building LPub3D from source ?

Here is the markdown for the 6 steps (5 if you don't drink beer).

Cheers,

trevorsandy avatar Nov 09 '24 06:11 trevorsandy

Ok - I have some good news. I found the reason for the invalid codesigning and it is on my part. It turns out that the steps I'm taking to add 2 required libraries I am building is causing Xcode to invalidate the LPub3D app bundle code signature. Here is an excerpt from my GitHub build log...

- copy lpub3d-ci bundle components to /Users/runner/work/lpub3d-ci/dmgbuild/lpub3d-ci/builds/macx/....
- install LDrawIni and QuaZIP library links...
- change LDrawIni and QuaZIP mapping to LPub3D...
- bundle LPub3D...
- change LDrawIni and QuaZIP library dependency mapping...
/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: LPub3D.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: LPub3D.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore

Cheers,

trevorsandy avatar Nov 09 '24 13:11 trevorsandy

I have tested the build process correction which looks promising.

Build excerpt:

- copy lpub3d-ci bundle components to /Users/runner/work/lpub3d-ci/dmgbuild/lpub3d-ci/builds/macx/....
- install LDrawIni and QuaZIP library links...
- change LDrawIni and QuaZIP mapping to LPub3D...
- bundle LPub3D to add Qt framework...
- change LDrawIni and QuaZIP library dependency mapping to Qt framework...
/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: LPub3D.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: warning: changes being made to the file will invalidate the code signature in: LPub3D.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore
- reapply the code signature....
LPub3D.app: replacing existing signature
- build checks...
...
----Build Check Completed: PASS (7)[1,2,3,4,5,6,7], FAIL (0)[], ELAPSED TIME [2mins 45sec]----

It turns out that GitHub builds are code signed if Xcode is used, which it is, so there is no need to obtain an Apple Development subscription just to sign my code.

As this is a material correction, I have opened a new ticket which also presents the workaround that can be applied to the existing distributions - see #783

You can evaluate the correction with the latest LPub3D DevOps build.

Cheers,

trevorsandy avatar Nov 09 '24 14:11 trevorsandy

In the latest release (2.4.8), I manually enforced code-signing to allow the application to run with the following command:

sudo codesign --force --deep --sign - /Applications/LPub3D.app (Note: I couldn't foresee any harm, but please proceed with caution. I'm so sorry if I violated any license issue)

I think this is similar with #783.

However, I encountered a few startup errors and odd behavior in LPub3D's native rendering:

  1. Start up errors There were errors during startup, which seemed to affect the application. Screenshot 2024-11-10 at 12 05 13

  2. Rendering settings issue The edge lines remain stuck at a thickness of 1, and they won't update even when adjusting the slider. Screenshot 2024-11-10 at 12 24 31

  3. Rendering Result Inconsistency There is a discrepancy between the page display and visual editor in the rendering results. Screenshot 2024-11-10 at 12 09 06

citrasusanto avatar Nov 10 '24 05:11 citrasusanto

In the latest release (2.4.8), I manually enforced code-signing to allow the application to run with the following command... I think this is similar with https://github.com/trevorsandy/lpub3d/issues/783.

Excellent. No issue at all. This is why I posted the workaround.

However, I encountered a few startup errors and odd behavior in LPub3D's native rendering.

For item 1. The ARM64 X11 OSMesa build may have a different version value that the x86_64 build. I imagine this message is a false positive. Run this command to capture the OSMesa version and please post it.

echo $(xdpyinfo | grep 'version number') | sed 's/[[:alpha:]|(|:|[:space:]]//g' && osascript -e 'quit app "XQuartz"'

For items 2 and 3, evaluate the latest LPub3D DevOps build which is over 100 revisions ahead of v2.8.0. If the new behaviour you are experiencing is present in the latest DevOps build, open a respective ticket for each item and I'll be happy to take a look.

Cheers,

trevorsandy avatar Nov 10 '24 10:11 trevorsandy

Here it is. I removed the backslash due to the strange quotation marks in the last part.

Screenshot 2024-11-10 at 17 11 33

Quick heads-up: I downloaded the DevOps version and tried #783. Replacing the existing code signature did not allow the app to run. In the end, I had to manually enforce code-signing again. If you'd like to see the report, I’ve kept a copy in case you need it.

In DevOps, the issue (items 2 and 3) persists, just like in the release version. Here it is. Screenshot 2024-11-10 at 17 19 59

citrasusanto avatar Nov 10 '24 10:11 citrasusanto

I downloaded the DevOps version and tried https://github.com/trevorsandy/lpub3d/issues/783. Replacing the existing code signature did not allow the app to run.

Very well. Many thanks for the update. I'll change the workaround to your command then.

The color 'wash out' between the generated .png image and the viewer/editor display is concerning but I'm not experiencing this behaviour on my Linux or Windows environments and I don't have a macOS machine to test on so it'll be hit-or-miss on what the problem/solution can be.

Cheers,

trevorsandy avatar Nov 10 '24 11:11 trevorsandy

The color 'wash out' between the generated .png image and the viewer/editor display is concerning but I'm not experiencing this behaviour on my Linux or Windows environments and I don't have a macOS machine to test on so it'll be hit-or-miss on what the problem/solution can be.

Oh no, this is exactly what I was afraid of.

I’d like to confirm a few things. If I installed the Intel-based version on Arm based processor (M1-M4)—could this native rendering issue be related to that? Since the application uses OpenGL and, as far as I know, Intel still supports OpenGL while Apple is pushing their own Metal graphics, I suspect the issue might be tied to OpenGL settings. Unfortunately, I’m not sure how to adjust these settings.

citrasusanto avatar Nov 11 '24 09:11 citrasusanto