FS#12679 - Data-abort upon USB connection while playing a track and current view is in the WPS

Attached to Project: Rockbox
Opened by Andrew Freedgood (kaiscene) - Saturday, 19 May 2012, 13:40 GMT
Last edited by MichaelGiacomelli (saratoga) - Thursday, 08 September 2016, 19:28 GMT
Task Type Bugs
Category Operating System/Drivers
Status Closed
Assigned To No-one
Operating System Sansa AMSv2
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


On my Sansa Clip+:

(1) play a track
(2) be in the WPS
(3) connect USB to a computer
(4) data abort occurs. Sometimes it displays a "divide by zero" error.

I have tried connecting the USB while the track was *paused* and two other errors showed up a some point: "SWI" and "Prefetch" errors.

Connecting USB *while in the menu/home screen* does not cause these errors.
But, in this case, I do get a popup that says "Error accessing Playlist Control File" after the USB connection is removed. I don't know if this case is related.

The most recent build at time of this posting, bc4631055fec68bb842057dd5dade9f7e05d9266, does this, but it's been happening for a while.
This task depends upon

Closed by  MichaelGiacomelli (saratoga)
Thursday, 08 September 2016, 19:28 GMT
Reason for closing:  Out of Date
Comment by Bertrik Sikken (bertrik) - Sunday, 10 June 2012, 22:57 GMT
I don't know yet what would cause the SWI/Prefetch errors, but I can confirm the "Error accessing Playlist Control File" problem.

I think this is caused by a shutdown of the playlist system (function playlist_shutdown in playlist.c) on USB connect (called through system_flush in apps/misc.c) when a SYS_USB_CONNECTED event occurs.
Function playlist_shutdown closes a bunch of file descriptors, leaving the playlist system in a half de-initialised state. When USB is disconnected, someone peeks into the playlist with playlist_peek and runs into the closed controle file descriptor. This causes the "Error accessing Playlist Control File" message to splash up.
Comment by MichaelGiacomelli (saratoga) - Sunday, 04 November 2012, 20:21 GMT
Is this now fixed as of b985d5c?