Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

archi-steam-farm: Can't Handle 2FA on ARM Mac #206331

Closed
4 tasks done
ywwn opened this issue Feb 2, 2025 · 6 comments
Closed
4 tasks done

archi-steam-farm: Can't Handle 2FA on ARM Mac #206331

ywwn opened this issue Feb 2, 2025 · 6 comments
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed

Comments

@ywwn
Copy link
Contributor

ywwn commented Feb 2, 2025

brew gist-logs <formula> link OR brew config AND brew doctor output

HOMEBREW_VERSION: 4.4.19
ORIGIN: https://github.com/Homebrew/brew
HEAD: 23facb219df8615680636ef12103bb3313f44e2a
Last commit: 6 days ago
Branch: stable
Core tap JSON: 02 Feb 17:41 UTC
Core cask tap JSON: 02 Feb 17:41 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 10
Homebrew Ruby: 3.3.7 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.7/bin/ruby
CPU: deca-core 64-bit arm_donan
Clang: 16.0.0 build 1600
Git: 2.39.5 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 8.7.1 => /usr/bin/curl
macOS: 15.3-arm64
CLT: 16.2.0.0.1.1733547573
Xcode: 16.0
Rosetta 2: false

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Please refer to JustArchiNET/ArchiSteamFarm#3381

When I add a .maFile, it crashed.

I'm not sure if this is dotnet's problem.

What happened (include all command output)?

2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitCore() ArchiSteamFarm-custom V6.1.1.3 (source/d74d2608c6944eb186851194cea81286 | .NET 9.0.0; osx-arm64; Darwin 24.3.0 Darwin Kernel Version 24.3.0: Thu Jan  2 20:22:58 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8132) in [/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec]
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitCore() Copyright © 2015-2025 JustArchiNET
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitPlugins() Initializing Plugins...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitPlugins() Loading ItemsMatcherPlugin V6.1.1.3...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitPlugins() ItemsMatcherPlugin has been loaded successfully!
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitPlugins() Loading MobileAuthenticatorPlugin V6.1.1.3...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|InitPlugins() MobileAuthenticatorPlugin has been loaded successfully!
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|UpdateAndRestart() ASF will automatically check for new versions every 1 day.
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|StartInteractiveConsole() Interactive console is now active, type 'c' in order to enter command mode.
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|Start() Starting IPC server...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|Microsoft.Hosting.Lifetime|Now listening on: http://localhost:1242
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|Microsoft.Hosting.Lifetime|Application started. Press Ctrl+C to shut down.
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|Microsoft.Hosting.Lifetime|Hosting environment: Production
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|Microsoft.Hosting.Lifetime|Content root path: /opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|ASF|Start() IPC server ready!
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|*|Start() Starting...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|*|Connect() Connecting...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|*|Start() Starting...
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|*|OnConnected() Connected to Steam!
2025-02-02 00:19:30|ArchiSteamFarm-11784|INFO|*|OnConnected() Logging in...
2025-02-02 00:19:32|ArchiSteamFarm-11784|FATAL|ASF|OnUnhandledException() System.DllNotFoundException: Unable to load shared library 'IOKit.framework/IOKit' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: 
dlopen(/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file), '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file)
dlopen(/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib, 0x0001): tried: '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file), '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file)
dlopen(IOKit.framework/IOKit.dylib, 0x0001): tried: 'IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSIOKit.framework/IOKit.dylib' (no such file), '/usr/lib/IOKit.framework/IOKit.dylib' (no such file, not in dyld cache), 'IOKit.framework/IOKit.dylib' (no such file)
dlopen(/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file), '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file)
dlopen(/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit, 0x0001): tried: '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file), '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file)
dlopen(IOKit.framework/IOKit, 0x0001): tried: 'IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OSIOKit.framework/IOKit' (no such file), '/usr/lib/IOKit.framework/IOKit' (no such file, not in dyld cache), 'IOKit.framework/IOKit' (no such file)

   at SteamKit2.Util.MacHelpers.IOKit.IOServiceMatching(String name)
   at SteamKit2.MacOSMachineInfoProvider.GetMachineGuid()
   at SteamKit2.HardwareUtils.GenerateMachineID(Object state)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at SteamKit2.HardwareUtils.GetMachineID(IMachineInfoProvider machineInfoProvider)
   at SteamKit2.SteamUser.LogOn(LogOnDetails details)
   at ArchiSteamFarm.Steam.Bot.OnConnected(ConnectedCallback callback)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
2025-02-02 00:19:32|ArchiSteamFarm-11784|ERROR|ASF|Exit() Exiting with 1 error code!
2025-02-02 00:19:32|ArchiSteamFarm-11784|INFO|Microsoft.Hosting.Lifetime|Application is shutting down...
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'IOKit.framework/IOKit' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: 
dlopen(/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file), '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit.dylib' (no such file)
dlopen(/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib, 0x0001): tried: '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file), '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit.dylib' (no such file)
dlopen(IOKit.framework/IOKit.dylib, 0x0001): tried: 'IOKit.framework/IOKit.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSIOKit.framework/IOKit.dylib' (no such file), '/usr/lib/IOKit.framework/IOKit.dylib' (no such file, not in dyld cache), 'IOKit.framework/IOKit.dylib' (no such file)
dlopen(/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit, 0x0001): tried: '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file), '/opt/homebrew/Cellar/dotnet/9.0.101/libexec/shared/Microsoft.NETCore.App/9.0.0/IOKit.framework/IOKit' (no such file)
dlopen(/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit, 0x0001): tried: '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file), '/opt/homebrew/Cellar/archi-steam-farm/6.1.1.3/libexec/IOKit.framework/IOKit' (no such file)
dlopen(IOKit.framework/IOKit, 0x0001): tried: 'IOKit.framework/IOKit' (no such file), '/System/Volumes/Preboot/Cryptexes/OSIOKit.framework/IOKit' (no such file), '/usr/lib/IOKit.framework/IOKit' (no such file, not in dyld cache), 'IOKit.framework/IOKit' (no such file)

   at SteamKit2.Util.MacHelpers.IOKit.IOServiceMatching(String name)
   at SteamKit2.MacOSMachineInfoProvider.GetMachineGuid()
   at SteamKit2.HardwareUtils.GenerateMachineID(Object state)
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
   at SteamKit2.HardwareUtils.GetMachineID(IMachineInfoProvider machineInfoProvider)
   at SteamKit2.SteamUser.LogOn(LogOnDetails details)
   at ArchiSteamFarm.Steam.Bot.OnConnected(ConnectedCallback callback)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()
   at System.Threading.Thread.StartCallback()
zsh: abort      asf

What did you expect to happen?

works as expected

Step-by-step reproduction instructions (by running brew commands)

$ brew install archi-steam-farm
$ asf
@ywwn ywwn added the bug Reproducible Homebrew/homebrew-core bug label Feb 2, 2025
@cho-m
Copy link
Member

cho-m commented Feb 2, 2025

From glance, seems like an upstream issue in SteamKit2 when building with Xcode/CLT 15.3+ and should be reported to SteamKit2 (https://github.com/SteamRE/SteamKit).

Main issue being they try to load system libraries via relative paths which Apple has removed support for in recent dyld versions.

A possible workaround (untested) may be injecting path DYLD_FRAMEWORK_PATH=/System/Library/Frameworks asf.


Longer analysis:

IOKit is a system library: /System/Library/Frameworks/IOKit.framework/IOKit

SteamKit2 tries to load it via relative path at https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Util/MacHelpers.cs#L135-L148:

        const string LibraryName = "IOKit.framework/IOKit";
...
        [DllImport(LibraryName, CallingConvention = CallingConvention.Cdecl, BestFitMapping = false, ThrowOnUnmappableChar = true)]

Using .NET DllImport probably follows same rules as dlopen, e.g. man dlopen on Sequoia says:

When path looks like a framework path (e.g. /stuff/foo.framework/foo), if $DYLD_FRAMEWORK_PATH was set at launch,
dyld will first look in that directory for the framework partial path (e.g. foo.framework/foo). Next, dyld will
try the supplied path as-is (using current working directory for relative paths). Lastly, for old binaries, dyld
will try some fallbacks.
If $DYLD_FALLBACK_FRAMEWORK_PATH was set at launch, dyld will search those directories.
Otherwise, it will search /Library/Frameworks (on macOS if process is unrestricted), then
/System/Library/Frameworks.

SteamKit2 may be relying on old behavior that is not available in binaries built for recent macOS (see above bold and last sentence).

Apple changed implementation in dyld-1042.1 (apple-oss-distributions/dyld@c8a445f), which will be used on Xcode 15.3+ (https://en.wikipedia.org/wiki/Xcode#Xcode_15.0_-_(since_visionOS_support)_2)

As an example, see .NET MAUI - https://github.com/dotnet/maui/blob/main/src/Essentials/src/Platform/PlatformUtils.macos.cs#L77-L98

		const string IOKitLibrary = "/System/Library/Frameworks/IOKit.framework/IOKit";
...
		[DllImport(IOKitLibrary)]

@JustArchi
Copy link

Thanks a lot for deep analysis @cho-m - I've opened PR upstream - SteamRE/SteamKit#1501

I believe this issue can be closed in favour of the above.

@yaakov-h
Copy link

yaakov-h commented Feb 3, 2025

Thanks for the detailed breakdown @cho-m!

@JustArchi
Copy link

FYI I've just released and marked as stable ASF V6.1.2.3, which should hopefully fix the macOS crash mentioned in this issue.

@cho-m
Copy link
Member

cho-m commented Feb 3, 2025

Autobump has picked up new release:

@ywwn can you test if it works?

@ywwn
Copy link
Contributor Author

ywwn commented Feb 3, 2025

Autobump has picked up new release:

@ywwn can you test if it works?

Yes, it just works!

Thank you so much!

@ywwn ywwn closed this as completed Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug upstream issue An upstream issue report is needed
Projects
None yet
Development

No branches or pull requests

4 participants