johnno1962 / InjectionIII

Re-write of Injection for Xcode in (mostly) Swift
MIT License
4.08k stars 319 forks source link

Is support arm mac??? #504

Closed jb522185660 closed 6 months ago

jb522185660 commented 6 months ago

MacBook Air 13 inch 2024 M3

when I save the code, show this error

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -o /tmp/injection.o

  1. Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4) Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var LLVM_SYMBOLIZER_PATH to point to it): 0 swift-frontend 0x000000010665d108 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 40 1 swift-frontend 0x000000010665c058 llvm::sys::RunSignalHandlers() + 248 2 swift-frontend 0x000000010665d6c7 SignalHandler(int) + 311 3 libsystem_platform.dylib 0x00007ff817b26fdd _sigtramp + 29 4 libsystem_platform.dylib 000000000000000000 _sigtramp + 18446603370183364672 5 libsystem_c.dylib 0x00007ff817a1da39 abort + 126 6 swift-frontend 0x00000001003404a9 swift::performFrontend(llvm::ArrayRef<char const>, char const, void, swift::FrontendObserver)::$_3::invoke(void, char const, bool) + 761 7 swift-frontend 0x000000010658c402 llvm::report_fatal_error(llvm::Twine const&, bool) + 402 8 swift-frontend 0x000000010658c269 llvm::report_fatal_error(char const*, bool) + 41 9 swift-frontend 0x00000001044459a2 llvm::cas::getDefaultOnDiskCASPath() + 386 10 swift-frontend 0x0000000100511542 swift::ArgsToFrontendOptionsConverter::convert(llvm::SmallVectorImpl<std::1::unique_ptr<llvm::MemoryBuffer, std::1::default_delete>>) + 15954 11 swift-frontend 0x000000010052e071 swift::CompilerInvocation::parseArgs(llvm::ArrayRef<char const>, swift::DiagnosticEngine&, llvm::SmallVectorImpl<std::__1::unique_ptr<llvm::MemoryBuffer, std::1::default_delete>>, llvm::StringRef, llvm::StringRef) + 1345 12 swift-frontend 0x0000000100332aa0 swift::performFrontend(llvm::ArrayRef<char const>, char const, void, swift::FrontendObserver*) + 1440 13 swift-frontend 0x00000001002afa0e swift::mainEntry(int, char const**) + 5278 14 dyld 0x0000000209c44366 start + 1942
johnno1962 commented 6 months ago

Hi, yes it does normally. What version of Xcode is this? What is the deployment target? Are you using macros?

jb522185660 commented 6 months ago

The same code in normally on intel mac, the Xcode version is 15.3, deployment target iOS 12, the simulator is iPhone 15 pro iOS 17.4, not using marcos

johnno1962 commented 6 months ago

Could it be something to do with the path to the project? Avoid using ~/Downloads, ~/Documents etc. Also, you're missing the actual error message. It will be further up.

jb522185660 commented 6 months ago

hello, I have try to udpate the injectioniii on the latest version to 5.0.0 in github. It seem normal, but when I command + s to save(I have not modify the code),I crash by like that "Thread 1: EXC_BAD_ACCESS (code=1, address=0x7f868f376b00)"

johnno1962 commented 6 months ago

What crashes? Your app or injection or the Swift compiler? I'm getting confused. And this crash is specific to the new version? Can you show the full trace?

jb522185660 commented 6 months ago

Can I send you the email for the crash info?

johnno1962 commented 6 months ago

Sure that would help a lot, github at johnholdsworth.com.

jb522185660 commented 6 months ago

I have send you the email on github at johnholdsworth.com

johnno1962 commented 6 months ago

Thanks for sending that through. I would have had no idea otherwise. Are you using Objective-C associated objects? I can't guarantee that would work over injection as the "key" would likely get injected.

novolgit commented 6 months ago

@jb522185660 have you implemented this https://github.com/johnno1962/InjectionIII?tab=readme-ov-file#how-to-use-it:~:text=%23if%20DEBUG%0ABundle,)%0A%23endif properly?

jb522185660 commented 6 months ago

Hello , I downgrade to 4.6.5, It'w work normal.Thanks. 截屏2024-05-13 21 35 38

jb522185660 commented 6 months ago

InjectionIII_4.6.5.zip Any one have the same error, try this version.

johnno1962 commented 6 months ago

Did you try any other versions? It would be very helpful to try to bisect down to where the regression was introduced.

jb522185660 commented 6 months ago

My anther intel mac still using 4.6.5, so I copy the InjectionIII from intel mac to MacBook Air 13 inch 2024 M3.I have not try any other version.

johnno1962 commented 6 months ago

Very strange, not that much has changed, if you get a chance to test a more recent version let me know.

jb522185660 commented 6 months ago

I have try 4.8.4 yesterday, the issue "Thread 1: EXC_BAD_ACCESS (code=1, address=0x7f868f376b00)" still exist

johnno1962 commented 6 months ago

There are a lot of versions between 4.6.5 and 4.8.4. If you could find the time to try them quickly, I'd really appreciate it. Otherwise it's very difficult without TeamViewing to try essentially the same thing to have much chance of finding the problem. All of the changes in the last year a minor but you never know what will trip you up.

jb522185660 commented 6 months ago

How can I help identify the issue? Please provide suggestions at any time. I hope for improvements in future versions

johnno1962 commented 6 months ago

As far as I understand you have a problem "Thread 1: EXC_BAD_ACCESS (code=1, address=0x7f868f376b00)" that exhibits with 5.0.0 but not 4.6.5. Could you try 4.7.0 or 4.8.0? https://github.com/johnno1962/InjectionIII/releases. I make a point of dropping frequent versions to be able to bracket when regressions crept in. Bisecting is where you try versions in the middle and if it still fails you try a version before that or if it works OK you try a version after that like a binary search. If you find two adjacent versions, one which works and the next that doesn't I can look at the changes and work out what the problem is.