Bad filename in Player Objects causes crashes

If you find an issue in LiveCode but are having difficulty pinning down a reliable recipe or want to sanity-check your findings with others, this is the place.

Please have one thread per issue, and try to summarize the issue concisely in the thread title so others can find related issues here.

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Post Reply
Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Bad filename in Player Objects causes crashes

Post by Timothy » Wed Feb 08, 2017 1:54 am

I'm on Mac OS 10.12.3, LiveCode Community Edition 8.1.2, and had similar problems with 8.1.1

I've been building a stack intended for personal use, for "ear-training," a musical skill. It uses a number of player objects, with external references for sounds, in .wav format. I've had dozens of crashes, maybe hundreds. Sometimes LC unexpectedly quits. At other times, it freezes, becomes unresponsive, and requires a force-quit.

This happens on two different Mac OS machines, same OS, same version of LC. It's more likely to happen on one machine than the other, I have no idea why. Both machines are completely stable in every other respect. I use a variety of other LC stacks on both machines, routinely. LC is otherwise completely stable.

I've saved a few of the crash logs when LC quits spontaneously. When I have to force-quit, I don't see a crash log, IIRC. In any case, I'll make the crash logs available upon request.

I've not been able to replicate the crashes reliably. As far as I can tell, it happens when the fileName in the player is bad. Simply starting a player object with a bad fileName is sufficient to cause the crash. In some cases, I know the whole filePath was completely bad. I haven't been able to figure out whether an invalid fileName at the end of the file path is bad enough to cause the crash, or if other portions of the file path has to be bad to make it happen.

If I try to "start" a player with a bad fileName or filePath, the result is "could not create movie reference" That is as it should be. When the crash occurs, there is no error. LC either suddenly quits, or becomes unresponsive.

The crashes happen unpredictably. Sometimes it will happen two or three times in a row when I click on the "Play" button on a player object. And yet, I just wrote a script that starts player "foo" 100 times in a row. There was a bad filename in the player yet it did crash once.

Sometimes when the freeze or crash occurs, the preferences file gets corrupted. LC does not necessarily recognize the preferences file as corrupted. The main result of the corruption, as far as I can tell, is the debugger stops working. The red Breakpoint dot is dimmed out, and the Breakpoint command has no effect. Trashing the preferences file and restarting LC solves that problem.

That's all I have for now. Maybe the crash logs will help. Let me know if there is anything else I can do.
It's better to be happy and rich than poor and sad -- W. C. Fields

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5342
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Bad filename in Player Objects causes crashes

Post by FourthWorld » Wed Feb 08, 2017 3:00 am

Try this before setting the player's filename:

Code: Select all

if there is not a file tFile then
   answer "No such file: "& tFile
   exit to top
end if
If it passes that but still crashes let us know and we'll look at further diagnostic steps.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Timothy
Posts: 78
Joined: Tue Apr 11, 2006 7:38 pm

Re: Bad filename in Player Objects causes crashes

Post by Timothy » Wed Feb 08, 2017 7:39 am

That will prevent bad file paths, assuming a script sets the file path for the player. As far as I know, the crashes in question can be avoided by valid file paths.

On the other hand, a bad fileName in a player object should cause a script error, not a crash. Alternately, if this problem can't be fixed, it should be documented.

Tim
It's better to be happy and rich than poor and sad -- W. C. Fields

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5342
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Bad filename in Player Objects causes crashes

Post by FourthWorld » Wed Feb 08, 2017 7:58 am

Agreed, ideally no script should ever crash any script engine.

My priorities are to first see what can be done to move your project forward, and then secondarily to move the LiveCode project forward.

If you already have a fully working solution for yourself, and have a reproducible recipe of the bug for LiveCode, I suppose you could just file a bug report.
http://quality.livecode.com/
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Bug Triage”