Code Monkey home page Code Monkey logo

Comments (6)

johnno1962 avatar johnno1962 commented on June 11, 2024

Hi, I'm wondering if this is a problem where a static singleton var is getting uninitialised. Without seeing your code I can't say much more. Let me know if you would like to TeamView.

from injectioniii.

everlof avatar everlof commented on June 11, 2024

from injectioniii.

everlof avatar everlof commented on June 11, 2024

Maybe some additional info when running with some diagnostics:

💉 ⚠️ Loading .dylib has failed, This is likely because Swift code being injected references a function using a default argument or a member with access control that is too restrictive or perhaps an XCTest that depends on code not normally linked into your application. Rebuilding and re-running your project (without a build clean) can resolve this.
💉 Loading .dylib ...
💉 ⚠️ dlopen() error: dlopen(/Users/d/Library/Developer/CoreSimulator/Devices/EDFBEFFC-81AE-4D67-BF2A-1BD9B6719A1C/data/Containers/Data/Application/53ACE3EE-77EE-4F35-AAB0-43178F1D101C/tmp/eval104.dylib, 0x0002): symbol not found in flat namespace '___asan_option_detect_stack_use_after_return'
💉 ⚠️ Loading .dylib has failed, This is likely because Swift code being injected references a function using a default argument or a member with access control that is too restrictive or perhaps an XCTest that depends on code not normally linked into your application. Rebuilding and re-running your project (without a build clean) can resolve this.

from injectioniii.

johnno1962 avatar johnno1962 commented on June 11, 2024

You can email your details to github at johnholdsworth.com.

from injectioniii.

everlof avatar everlof commented on June 11, 2024

Hm, thanks, but maybe solved it myself. Your comment static singleton var is getting uninitialised. got me thinking.

Could this be caused by Calendar.autoupdatingCurrent perhaps?

Changing this:

calendarLogic = CalendarLogic(calendar: .autoupdatingCurrent, currentDate: date, period: period)

to

calendarLogic = CalendarLogic(calendar: .init(identifier: .gregorian), currentDate: date, period: period)

doesn't crash in the same location it seems.

from injectioniii.

johnno1962 avatar johnno1962 commented on June 11, 2024

Yes, when you inject, your static/top level vars get reinitialised as they live in the memory of the object file that has been injected. You can change this behaviour if you prefer by setting environment variable INJECTION_PRESERVE_STATICS then references to top level variables will always refer to their first definition. i.e. they won't get set to zero/nil. Happy you've sorted this out!

from injectioniii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.