Giter Site home page Giter Site logo

Comments (14)

sletz avatar sletz commented on August 14, 2024

Please give a patch, or a git branch access.

Stéphane

Le 7 janv. 2015 à 14:43, AlexandruCostache [email protected] a écrit :

If the client uses up almost all of its virtual memory jack may crash it in common/JackShmMem.h:

The destructor for JackShmReadWritePtr is called although Init() failed and it will call GetShmAddress()->UnlockMemory();

The fastest sollution that solved my issue was to add another flag member, initDone and set it to TRUE in Init() right after locking memory so that GetShmAddress()->UnlockMemory() doesn't do an illegal access.

I'm not familiar with jackd so I'm asking: is this approach acceptable/safe or is there a better way to handle this mmap() failure?


Reply to this email directly or view it on GitHub.

from jack2.

acostach avatar acostach commented on August 14, 2024

Sure, here it is: https://www.dropbox.com/s/5qv5dr938c54d8q/0001-Avoid-crashing-client-when-mmap-fails.patch?dl=0

from jack2.

sletz avatar sletz commented on August 14, 2024

Le 7 janv. 2015 à 14:43, AlexandruCostache [email protected] a écrit :

If the client uses up almost all of its virtual memory jack may crash it in common/JackShmMem.h:

  1. Does "Init" really crash or does it call " throw std::bad_alloc();" ?

  2. or does it crash in GetShmAddress()->LockMemory() ?

The destructor for JackShmReadWritePtr is called although Init() failed and it will call GetShmAddress()->UnlockMemory();

The fastest sollution that solved my issue was to add another flag member, initDone and set it to TRUE in Init() right after locking memory so that GetShmAddress()->UnlockMemory() doesn't do an illegal access.

I'm not familiar with jackd so I'm asking: is this approach acceptable/safe or is there a better way to handle this mmap() failure?

Stéphane=

from jack2.

acostach avatar acostach commented on August 14, 2024

Crashes in destructor, ~JackShmReadWritePtr(), to be more specific in GetShmAddress()->UnlockMemory()

from jack2.

acostach avatar acostach commented on August 14, 2024

GetShmAddress() does not yeld a valid address because Init() failed previously. If JackShmReadWritePtr in not used for iterators then that patch should do just fine.

from jack2.

sletz avatar sletz commented on August 14, 2024

No the question is : how the call to Init fails in the first place? where in the code of Init does it fails ? (calling throw std::bad_alloc(), or chasing in GetShmAddress()->LockMemory();)

Thanks

Stéphane

Le 7 janv. 2015 à 15:24, AlexandruCostache [email protected] a écrit :

Crashes in destructor, ~JackShmReadWritePtr(), to be more specific in GetShmAddress()->UnlockMemory()


Reply to this email directly or view it on GitHub.

from jack2.

acostach avatar acostach commented on August 14, 2024

It failed trough bad_alloc

from jack2.

sletz avatar sletz commented on August 14, 2024

Could you possibly try the bit more general patch here :

Stéphane

Le 7 janv. 2015 à 15:34, AlexandruCostache [email protected] a écrit :

It failed trough bad_alloc


Reply to this email directly or view it on GitHub.

from jack2.

acostach avatar acostach commented on August 14, 2024

I'm not seeing the patch, looks like the link doesn't appear. Can you please post it again?

from jack2.

sletz avatar sletz commented on August 14, 2024

Give me your direct mail address.

Stéphane

Le 7 janv. 2015 à 15:54, AlexandruCostache [email protected] a écrit :

I'm not seeing the patch, looks like the link doesn't appear


Reply to this email directly or view it on GitHub.

from jack2.

acostach avatar acostach commented on August 14, 2024

It's the one in the patch I've provided. Not posting it here due to spamming considerations. Thanks

from jack2.

acostach avatar acostach commented on August 14, 2024

Took it for a spin and it behaves ok - the same.

from jack2.

sletz avatar sletz commented on August 14, 2024

Thanks commited and pushed on go.

Stéphane

Le 7 janv. 2015 à 16:51, AlexandruCostache [email protected] a écrit :

Took it for a spin and it behaves ok


Reply to this email directly or view it on GitHub.

from jack2.

acostach avatar acostach commented on August 14, 2024

Thank you!

from jack2.

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.