Giter Site home page Giter Site logo

Comments (7)

1313 avatar 1313 commented on June 3, 2024

Oh I will look into it.

If you set the rust flags like this:

$ export RUSTFLAGS=-Zsanitizer=address RUSTDOCFLAGS=-Zsanitizer=address

And run your code with the nightly version, what does the dump say?

from screencapturekit-rs.

Pranav2612000 avatar Pranav2612000 commented on June 3, 2024

Tried doing this. But was unable to get the Sanitizer to work. I see the following issue
image

Specifically the Please launch the executable with: .... .
Tried a couple of things but was not able to get rid of it. Do you know how I can get the Address Sanitizer working?

I was able to get the AddressSanitizer to work by explicitly passing in the --target option. Here's the output -
image

from screencapturekit-rs.

Pranav2612000 avatar Pranav2612000 commented on June 3, 2024

I also forked the repo and tried running the tests in screencapturekit/src/sc_stream.rs. Those tests look almost the same as the above code, but those tests pass and work as expected.

from screencapturekit-rs.

1313 avatar 1313 commented on June 3, 2024

Cool that helps!

It's an issue with how something being dropped with the wrong refcount. This will be fixed with my core-foundation pr. but I can fix it here too.

Thanks

from screencapturekit-rs.

Pranav2612000 avatar Pranav2612000 commented on June 3, 2024

Great! Do you have an estimate on by when this'll be available?
Is there some workaround I can try in the meantime?

Also, out of curiosity, how did you figure It's an issue with how something being dropped with the wrong refcount.?

from screencapturekit-rs.

1313 avatar 1313 commented on June 3, 2024

Fixed and pushed a new version v0.2.2

from screencapturekit-rs.

1313 avatar 1313 commented on June 3, 2024

It was the call to CFRelease at the top which is called via the Id/ShareId traits which calls the CFRelease via its drop trait.

Objective C uses refcounting a similar model as RC and ARC.

The segfault happened in the CMSampleBuffer as it hold references to underlying image/pixelbuffers which was created in a bad way messing up the ref count.

from screencapturekit-rs.

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.