Bug 361622 - Tellico ("Video Collection") crashes if there is a blank line in "Cast"
Summary: Tellico ("Video Collection") crashes if there is a blank line in "Cast"
Status: RESOLVED FIXED
Alias: None
Product: tellico
Classification: Applications
Component: general (show other bugs)
Version: 2.3.9
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Robby Stephenson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-11 09:35 UTC by ejr67
Modified: 2016-04-26 01:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.12
Sentry Crash Report:


Attachments
Example database used, 3 screen-shots and crash report (100.16 KB, application/gzip)
2016-04-11 09:35 UTC, ejr67
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ejr67 2016-04-11 09:35:35 UTC
Created attachment 98335 [details]
Example database used, 3 screen-shots and crash report

Version: 2.3.9 4.14.15, Kubuntu packages
OS: Linux (x86_64) release 4.2.0-35-generic
Compiler: x86_64-linux-gnu-gcc

Hi,

As this is the first bug I am reporting for Tellico, please let me first say it's a great program - I use it to manage my video collection and I really like it. I find it really fast and really flexible (I've added more fields and developed, based on the example provided, my own IMDb interface plugin in Python to retrieve data from IMDb and populate those extra fields). Thank you for developing Tellico and making it available!

I am using Tellico as retrieved from the Kubuntu packages (as per above), I haven't compiled my own version.

The following bug should be easily reproducible. It happens to me me every single time.

Whenever there is a blank line in the list of "Cast" (in the middle of the list, not at the end) for a Video Collection, the programme crashes upon saving the entry.

Step 1 - Create an entry, create a list of "Cast" (see example attached)
Step 2 - Delete the data for a line in the middle (not at the end) of the list of "Cast", to create a blank line; that's deleting the data without using Right Click > Remove Row (see screen-shot attached)
Step 3 - Click on "Save Entry" - the programme crashes! (see screen-shot and "Developer information" attached)

This happens to me when I want to re-order the rows on the "Cast" list - I would "Insert Row", then cut-and-paste data from a row into the new one, and sometimes I forget to "Remove Row" for the old (now empty) row. It is an issue as it may mean losing all the modifications made since the last "Save".

I don't believe the program should crash, ever, even if the user does something wrong. Suggested fixes:
1 - Find a way to save the data as-is, so that when the user saves and re-opens the video entry, the data is as I saved it, i.e. with an empty row on the "Cast" list
2 - Ignore the empty row, so that when the user saves and re-opens the video entry, if there was, say, 1 row + 1 empty row + 1 row, there are only two rows left, with the empty row having disappeared altogether
3 - Don't save the entry, and display an error message, e.g. "Can't save at this time as there is an empty row on 'Cast' list"
Personally, I would be very happy with solution 1 or 2 (indifferently) and would find solution 3 acceptable.
Comment 1 Robby Stephenson 2016-04-11 10:51:21 UTC
I can't immediately reproduce the crash. Can you be more explicit about your steps, especially #2? I opened your test file, double-clicked the Bambi entry, double-clicked the first cell in row 2 of the Cast, clicked backspace, then double-clicked cell 2 in the row, clicked backspace, then clicked "Save Entry", and everything worked.

Thanks.
Comment 2 ejr67 2016-04-11 15:43:16 UTC
Hi Robby,

Thanks for investigating.

I don't know what to say. The steps you are describing are exactly what I do (except that I use "Delete" instead of Backspace! :-)
The main thing is to get to an empty row, as per that attached Bug_Crash-Step_2.png
I have tried it again in version 2.3.11 just in case, and it still crashes, as soon as I click on "Save Entry".
Every single time on my machine - it's not random at all.
I have actually been using Tellico for a while, and it used to crash also on a previous Kubuntu installation on a different laptop - so it does not seem to be hardware dependent.

Maybe the trace in the file "tellico-20160411-100326.kcrash.txt" might provide some clue as to what is happening, if you get a chance to look at it?
If there is anything I can do to help investigate on my machine, please let me know.
Otherwise, it's not a major inconvenience, I know what to do to avoid it crashing - maybe, some day, something will happen that will trigger a "haha!" moment, and you will find what may go wrong.
Comment 3 Robby Stephenson 2016-04-26 01:46:39 UTC
Git commit 73d78959641a3ae1641d6cc10975d241bed9f026 by Robby Stephenson.
Committed on 26/04/2016 at 01:45.
Pushed by rstephenson into branch '2.3'.

Fix crashing bug with empty rows in table values

When formatting the field value, the number of columns was not being
checked before the first value was accessed, causing a crash when there
were no column values

Add a unit test, as well
FIXED-IN: 2.3.12

M  +4    -0    ChangeLog
M  +3    -3    src/derivedvalue.cpp
M  +4    -4    src/entry.cpp
M  +12   -0    src/tests/collectiontest.cpp

http://commits.kde.org/tellico/73d78959641a3ae1641d6cc10975d241bed9f026
Comment 4 Robby Stephenson 2016-04-26 01:50:15 UTC
Git commit 9a5f05b0af4d4e8aa308061f565e4f165d33db81 by Robby Stephenson.
Committed on 26/04/2016 at 01:46.
Pushed by rstephenson into branch 'master'.

Fix crashing bug with empty rows in table values

When formatting the field value, the number of columns was not being
checked before the first value was accessed, causing a crash when there
were no column values

Add a unit test, as well
FIXED-IN: 2.3.12

M  +4    -0    ChangeLog
M  +3    -3    src/derivedvalue.cpp
M  +4    -4    src/entry.cpp
M  +12   -0    src/tests/collectiontest.cpp

http://commits.kde.org/tellico/9a5f05b0af4d4e8aa308061f565e4f165d33db81