Picotorrent: Crash After add new torrent from open .torrent

Created on 17 Feb 2020  路  3Comments  路  Source: picotorrent/picotorrent

Windows 10,
0.18 win64

  1. Exit or minimise PicoTorrent
  2. Open .torrent file
  3. Click "Ok"
  4. Go to tray, but PicoTorrent crash (

Repeatable on two PCs

bug

Most helpful comment

I did some digging to the not appearing 'add new torrent' dialog and crash while trying to add a torrent. The following steps should produce the issues.

  1. Delete Picotorrent.sqlite

No 'Add new torrent' dialog:

  1. Open PicoTorrent
  2. Go to 'View' -> 'Preferences'
  3. Enable 'Close to notification area'
  4. Click 'OK'
  5. Close PicoTorrent by clicking the X at the top right
  6. Open a magnet link
  7. Nothing happens

The message at mainwindow.ccp:600 is not WM_COPYDATA, but WM_ACTIVATEAPP.

Make it crash (continue from the above steps):

  1. Close PicoTorrent by right clicking it in the notification area and select 'Exit'
  2. Open PicoTorrent
  3. Close PicoTorrent by clicking the X at the top right
  4. Open a magnet link
  5. Click on 'Cancel' in the appeared 'Add new torrent' dialog
  6. PicoTorrent crashes

It looks likes a crash, but the CloseHandle(...) in application.ccp:25 is called. Torrent is somehow added to the list and starts downloading the next time you start the application. The file is saved to: .../AppData/Local/Temp.

I did at some breakpoint logging:

  • application.ccp:25: action - show message: Close handle called!
  • mainwindow.ccp:600: action - show message: Event: {msg}

No dialog.txt
Crash.txt

I hope it helps.

All 3 comments

I did some digging to the not appearing 'add new torrent' dialog and crash while trying to add a torrent. The following steps should produce the issues.

  1. Delete Picotorrent.sqlite

No 'Add new torrent' dialog:

  1. Open PicoTorrent
  2. Go to 'View' -> 'Preferences'
  3. Enable 'Close to notification area'
  4. Click 'OK'
  5. Close PicoTorrent by clicking the X at the top right
  6. Open a magnet link
  7. Nothing happens

The message at mainwindow.ccp:600 is not WM_COPYDATA, but WM_ACTIVATEAPP.

Make it crash (continue from the above steps):

  1. Close PicoTorrent by right clicking it in the notification area and select 'Exit'
  2. Open PicoTorrent
  3. Close PicoTorrent by clicking the X at the top right
  4. Open a magnet link
  5. Click on 'Cancel' in the appeared 'Add new torrent' dialog
  6. PicoTorrent crashes

It looks likes a crash, but the CloseHandle(...) in application.ccp:25 is called. Torrent is somehow added to the list and starts downloading the next time you start the application. The file is saved to: .../AppData/Local/Temp.

I did at some breakpoint logging:

  • application.ccp:25: action - show message: Close handle called!
  • mainwindow.ccp:600: action - show message: Event: {msg}

No dialog.txt
Crash.txt

I hope it helps.

@thec0mpler this is awesome - appreciate it! I'll see if I can reproduce the issue using your steps tomorrow. There are a few issues related issues I think so solving this would be big. Thanks again!

I can reproduce the issue. There's something wrong when sending WM_COPYDATA and the window is minimized to tray... I haven't found a solution yet, but I can provoke the error anytime at least. We might have to rewrite the single instance checking logic a bit.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ltGuillaume picture ltGuillaume  路  7Comments

annomatik picture annomatik  路  3Comments

detrophy picture detrophy  路  5Comments

szmarczak picture szmarczak  路  6Comments

Gladorme picture Gladorme  路  5Comments