Coder Social home page Coder Social logo

Crash SIGSEGV about frostwire-jlibtorrent HOT 11 CLOSED

frostwire avatar frostwire commented on August 18, 2024
Crash SIGSEGV

from frostwire-jlibtorrent.

Comments (11)

aldenml avatar aldenml commented on August 18, 2024

Is this always happening to you? could you provide a minimal program to reproduce it?

from frostwire-jlibtorrent.

gubatron avatar gubatron commented on August 18, 2024

also, what version of libtorrent are you running?

from frostwire-jlibtorrent.

WhiteTrashLord avatar WhiteTrashLord commented on August 18, 2024

I test with jlibtorrent-linux-1.1.0.19.jar.

I saw this crash only 1 time so far.
Sorry, I don't know how to reproduce it.

Where does the problem occur? com.frostwire.jlibtorrent.swig.libtorrent_jni.torrent_handle_info_hash?

I don't know much about JNI :(

from frostwire-jlibtorrent.

aldenml avatar aldenml commented on August 18, 2024

JNI is very sensitive to memory management issues. I will keep this open in case we start to get this errors

from frostwire-jlibtorrent.

WhiteTrashLord avatar WhiteTrashLord commented on August 18, 2024

Unfortunately I see a lot of crashes. Older versions might be more stable?

In my test code I get a list of torrents with getSwig().get_torrents() and request several fields from every torrent.

I frequently get a new list of torrents and iterate through it.

from frostwire-jlibtorrent.

aldenml avatar aldenml commented on August 18, 2024

Older version if anything are more unstable and with more bugs from libtorrent itself. Can't give you an estimate, but I'm reviewing this (and the others).

from frostwire-jlibtorrent.

WhiteTrashLord avatar WhiteTrashLord commented on August 18, 2024

I think I saw many more crashes when I worked on the session concurrently with several threads. I tried to reduce the concurrency which made things better.
You tried to make anything thread-safe?

Probably the safest way is to always use only listeners, or?

from frostwire-jlibtorrent.

aldenml avatar aldenml commented on August 18, 2024

I wouldn't treat anything thread-safe unless stated otherwise, specially Session since it holds a lot of states (mutable data). Listeners and alerts are the way to interact with the session. A TorrentHandle coming from an alert is a very delicate object and should be used for the smaller amount of time and never shared to other threads.

from frostwire-jlibtorrent.

WhiteTrashLord avatar WhiteTrashLord commented on August 18, 2024

What about removing and adding a torrent? I think at least removing can cause a lot of troubles if the AlertLoop-Thread works on a handle of a torrent which was just deleted.

Is it necessary to start alertsLoop() in the session constructor? I think I would start it once the first listener was added.

Currently I am thinking about modifying the Session-alertsLoop so I can run also my own code on this thread. Do you think this is a good idea?

from frostwire-jlibtorrent.

aldenml avatar aldenml commented on August 18, 2024

I need to think a little more about concurrency issues while removing a torrent.

AlertsLoop and Session are there to provide an out-of-the-box solution. I personally don't see an advantage of no starting it in the constructor (you will need it pretty soon anyway).

Can say without knowing what's your modification. If you don't mind sharing it.

from frostwire-jlibtorrent.

aldenml avatar aldenml commented on August 18, 2024

@WhiteTrashLord reopening for more review.

from frostwire-jlibtorrent.

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.