Crash during verification

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
eldonmcguinness
Posts: 9
Joined: Mon Sep 23, 2013 9:41 pm

Crash during verification

Post by eldonmcguinness »

I am experiencing an odd issue when trying to verify torrents after they download with the 2.82 (14160) build. I have a script set to run when a torrent completes, and part of that script is to tell the daemon to verify said torrent when it completes. I have implemented this via the script-torrent-done-filename option.

The pertinent part of the script is as follows:

Code: Select all

function getTorrentStatus {
    status=$( transmission-remote ${TC_ADDR}:${TC_PORT} -n ${TC_USER}:${TC_PASS} -t ${TR_TORRENT_HASH} -i | grep State | sed 's/Stat$
    echo "${TR_TORRENT_NAME} $status" >> ~/verify.log
    echo "$status"
}

function verifyTorrent {
        # Sleep to give the torrent a moment to cool down
        #sleep 30

        #transmission-remote  ${TC_ADDR}:${TC_PORT} -n ${TC_USER}:${TC_PASS} -t ${TR_TORRENT_HASH} -S

        # Sleep to give the torrent a moment to cool down
        sleep 60

        transmission-remote  ${TC_ADDR}:${TC_PORT} -n ${TC_USER}:${TC_PASS} -t ${TR_TORRENT_HASH} -v
}

function startTorrent {
        transmission-remote  ${TC_ADDR}:${TC_PORT} -n ${TC_USER}:${TC_PASS} -t ${TR_TORRENT_HASH} -s
}

function getTorrentPercentage {
  percentage=$( transmission-remote ${TC_ADDR}:${TC_PORT} -n ${TC_USER}:${TC_PASS} -t ${TR_TORRENT_HASH} -i | grep 'Percent Done' | $
  echo "${TR_TORRENT_NAME} PERC: $percentage" >> ~/verify.log
  echo "$percentage"
}

echo "${TR_TORRENT_NAME} Processing" >> ~/verify.log


# Initiate the torrent validation
echo "${TR_TORRENT_NAME} Verification Started" >> ~/verify.log
verifyTorrent

# Get the current torrent status
verificationStatus=$( getTorrentStatus )

# Keep checking the torrent status every 10 seconds
while [ "$verificationStatus" == "Verifying" ] || [ "$verificationStatus" == "Will Verify" ]; do
  sleep 60
  verificationStatus=$( getTorrentStatus )
done

# Ensure the torrent is started
echo "${TR_TORRENT_NAME} Re-Starting" >> ~/verify.log
startTorrent

# Check to see if we have 100% of the torrent still
# if not then we need to exit the app
if [ "$( getTorrentPercentage )" != "100" ]; then
  echo "${TR_TORRENT_NAME} Verification Failed" >> ~/verify.log
  exit
fi

echo "${TR_TORRENT_NAME} Verification Passed" >> ~/verify.log
This is a bash script and works fine except for the odd occasion when during the verification the RPC part of the daemon crashes. I say only the RPC part, as other torrents do seem to still complete and fire the script after the server is no longer giving back valid responses.

Once the event happens, the only reply I get from the server, via transmission-remote, is as follows:

Code: Select all

[17:38:50.667] JSON parse failed at pos 196834: STRAY_TOKEN -- remaining text ""result""success"
[17:38:50.668] transmission-remote: Unable to parse response "{"arguments":{"torrents":[{"error":0,"errorString":"","eta":-1,"id":1,"isFinished":false,"leftUntilDone":0,"name":"ISO cd0","peersGettingFromUs":0,"peersSendingToUs":0,"rateDownload":0,"rateUpload":0,"sizeWhenDone":1063616,"status":6,"uploadRatio":1.1255},{"error":0,"errorString":"","eta":-1,"id":2,"isFinished":false,"leftUntilDone":0,"name":"ISO cd1","peersGettingFromUs":0,"peersSendingToUs":0,"rateDownload":0,"rateUpload":0,"sizeWhenDone":553740407,"status":6,"uploadRatio":1.0300},{"error":0,"errorString":"","eta":-1,"id":3,"isFinished":false,"leftUntilDone":0,"name":"ISO cd2","peersGettingFromUs":0,"peersSendingToUs":0,"rateDownload":0,"rateUpload":0,"sizeWhenDone":544672945,"status":6,"uploadRatio":1.0783},{"error":0,"errorString":"","eta":-1,"id":4,"isFinished":false,"leftUntilDone":0,"name":"ISO cd3","peersGettingFromUs":0,"peersSendingToUs":0,"rateDownload":0,"rateU
The response seems to prematurely end. Here is the output of the verification loop in the script above, as you can see it works and then stops giving back a valid response once FILESET5 and FILESET4 came into play.

Code: Select all

FILESET1 Will Verify
FILESET2 Verifying
FILESET3 Will Verify
FILESET1 Will Verify
FILESET2 Verifying
FILESET3 Will Verify
FILESET1 Will Verify
FILESET2   Idle
FILESET2 Re-Starting
FILESET2 PERC: 100
FILESET2 Verification Passed
FILESET2 Extraction Started
FILESET3 Verifying
FILESET1 Will Verify
FILESET3 Verifying
FILESET1 Will Verify
FILESET3 Verifying
FILESET1 Will Verify
FILESET3 Verifying
FILESET1 Will Verify
FILESET3   Idle
FILESET3 Re-Starting
FILESET3 PERC: 100
FILESET3 Verification Passed
FILESET3 Extraction Started
FILESET1 Verifying
FILESET1 Verifying
FILESET1 Verifying
FILESET1 Verifying
FILESET1 Verifying
FILESET1   Idle
FILESET1 Re-Starting
FILESET1 PERC: 100
FILESET1 Verification Passed
FILESET1 Extraction Started
FILESET5 Processing
FILESET5 Verification Started
FILESET5
FILESET5 Re-Starting
FILESET5 PERC:
FILESET5 Verification Failed
FILESET4 Processing
FILESET4 Verification Started
FILESET4
FILESET4 Re-Starting
FILESET4 PERC:
FILESET4 Verification Failed
After restarting the daemon, since the transmission-daemon is still running even after the RPC starts sending back jibberish, I am able to try the verification again of those files and then it will run as it should. Any ideas?
rb07
Posts: 1400
Joined: Sun Aug 24, 2008 3:14 am

Re: Crash during verification

Post by rb07 »

Its a very different problem from what you think, see Ticket #5352, the fix is already in the code repository, and it will be released on the next version.
bask
Posts: 1
Joined: Sun Oct 27, 2013 6:02 pm

Re: Crash during verification

Post by bask »

which will this fix be released then. This is quite an annoying and serious bug as it looks to me? (OSX Maverick did not fix this for me b.t.w.).

If the release is still a long way out, can I revert to an older version?

thx!


Process: Transmission [2799]
Path: /Applications/Transmission.app/Contents/MacOS/Transmission
Identifier: org.m0k.transmission
Version: 2.82 (14160)
Code Type: X86-64 (Native)
Parent Process: launchd [255]
Responsible: Transmission [2799]
User ID: 501

Date/Time: 2013-10-27 19:03:46.906 +0100
OS Version: Mac OS X 10.9 (13A603)
Report Version: 11
Anonymous UUID: BC7644CA-6DE5-4F53-45D7-FAF882289A4E

Sleep/Wake UUID: 3D70289B-67EB-4FB0-851A-2E52AD2F4B47

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000060

VM Regions Near 0x60:
eldonmcguinness
Posts: 9
Joined: Mon Sep 23, 2013 9:41 pm

Re: Crash during verification

Post by eldonmcguinness »

I can not wait for 2.83 so I can implement this verification post download. I find Transmission to be a great client, but get burned from time to time by corrupted downloads.

Cheers guys!
Post Reply