Files crashes when view changed with contents of empty folder selected

Bug #1184104 reported by Jeremy Wootten
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Files
Fix Released
High
Julián Unrrein

Bug Description

To reproduce bug:

1) Switch to list view
2) Navigate to a folder that contains an empty sub-folder
3) Select the empty folder and click the expand arrow
4) Select the blank line that appears
5) Double-click the empty folder ("This folder is empty" message displays)
6) Switch to icon view

Files crashes with a segmentation fault

Installed version is 0.1-0~r1190+pkg13~precise1

Crash does not occur if the empty folder is not expanded.

Related branches

Changed in pantheon-files:
assignee: nobody → Jeremy Wootten (jeremywootten)
Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

Fixed by:

1) fm_directory_view: directory_done_loading_callback now checks for valid view
2) fm_directory_view: directory_thumbs_loaded_callback now checks for valid view

Also fixes misdimensioned array in ViewContainer: plugin_directory_loaded.

Revision history for this message
Julián Unrrein (junrrein) wrote :

Thanks for reporting!

I have tested your patch. Unfortunately, it seems it isn't enoug to prevent the crash:

Program received signal SIGSEGV, Segmentation fault.
[Cambiando a Thread 0x7fffdd52a700 (LWP 6995)]
0x000000000043eb5b in directory_thumbs_loaded_callback (directory=<optimized out>,
    view=0x907540)
    at /home/julian/elementary-projects/pantheon-files-fix-1184104/src/fm-directory-view.c:327
327 g_return_if_fail(GTK_IS_WIDGET(view));

It crashes in one of the new checks. Sometimes in this one, some times in one of the others. It doesn't crash always.

I attached a backtrace for this crash (though it doesn't seem to give useful info).

Changed in pantheon-files:
status: New → Confirmed
Revision history for this message
Jeremy Wootten (jeremywootten) wrote : Re: [Bug 1184104] Re: Files crashes when view changed with contents of empty folder selected

Thanks Julian, I'll look into this. Can you specify a sequence of
operations that reliably causes the crash? Is it related to the original
bug? (There are lots of other bugs that cause crashes - I only fixed one!)

On 6 June 2013 21:35, Julián Unrrein <email address hidden> wrote:

> Thanks for reporting!
>
> I have tested your patch. Unfortunately, it seems it isn't enoug to
> prevent the crash:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Cambiando a Thread 0x7fffdd52a700 (LWP 6995)]
> 0x000000000043eb5b in directory_thumbs_loaded_callback
> (directory=<optimized out>,
> view=0x907540)
> at
> /home/julian/elementary-projects/pantheon-files-fix-1184104/src/fm-directory-view.c:327
> 327 g_return_if_fail(GTK_IS_WIDGET(view));
>
> It crashes in one of the new checks. Sometimes in this one, some times
> in one of the others. It doesn't crash always.
>
> I attached a backtrace for this crash (though it doesn't seem to give
> useful info).
>
>
> ** Attachment added: "Backtrace of the crash"
>
> https://bugs.launchpad.net/pantheon-files/+bug/1184104/+attachment/3696695/+files/bactrace1.txt
>
> ** Changed in: pantheon-files
> Status: New => Confirmed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1184104
>
> Title:
> Files crashes when view changed with contents of empty folder selected
>
> Status in Files:
> Confirmed
>
> Bug description:
> To reproduce bug:
>
> 1) Switch to list view
> 2) Navigate to a folder that contains an empty sub-folder
> 3) Select the empty folder and click the expand arrow
> 4) Select the blank line that appears
> 5) Double-click the empty folder ("This folder is empty" message
> displays)
> 6) Switch to icon view
>
> Files crashes with a segmentation fault
>
> Installed version is 0.1-0~r1190+pkg13~precise1
>
> Crash does not occur if the empty folder is not expanded.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pantheon-files/+bug/1184104/+subscriptions
>

--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD

Revision history for this message
Julián Unrrein (junrrein) wrote :

I followed the same sequence of operations you described, and, if it doesn't crash then, I keep changing viewmodes until it crashes.

Unfortunately, I cannot make it crash reliably (sometimes it doesn't crash at all!), but I'm confident that what I see is related to the original bug.

Maybe we need someone else to test this too.

Revision history for this message
Julián Unrrein (junrrein) wrote :

I take back what I said - your patch fixes the exact problem you describe.

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

That's OK.

It is difficult to fix bugs that rely on subtle differences in the order
and timing of operations. I'm not experienced enough to diagnose bugs only
from backtraces.

On 7 June 2013 16:23, Julián Unrrein <email address hidden> wrote:

> I take back what I said - your patch fixes the exact problem you
> describe.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1184104
>
> Title:
> Files crashes when view changed with contents of empty folder selected
>
> Status in Files:
> Confirmed
>
> Bug description:
> To reproduce bug:
>
> 1) Switch to list view
> 2) Navigate to a folder that contains an empty sub-folder
> 3) Select the empty folder and click the expand arrow
> 4) Select the blank line that appears
> 5) Double-click the empty folder ("This folder is empty" message
> displays)
> 6) Switch to icon view
>
> Files crashes with a segmentation fault
>
> Installed version is 0.1-0~r1190+pkg13~precise1
>
> Crash does not occur if the empty folder is not expanded.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pantheon-files/+bug/1184104/+subscriptions
>

--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

I have now found a way of reproducing a crash in my branch - but its not
the same as the one you describe because it doesn't happen when changing
view. It also does not happen in trunk so it appears to be a side-effect of
fixing the original bug.

Anyway I've added some more checks that prevent the crash I found to
lp:~jeremywootten/pantheon-files/fix-1084104 (rev 1211)

On 7 June 2013 15:19, Julián Unrrein <email address hidden> wrote:

> I followed the same sequence of operations you described, and, if it
> doesn't crash then, I keep changing viewmodes until it crashes.
>
> Unfortunately, I cannot make it crash reliably (sometimes it doesn't
> crash at all!), but I'm confident that what I see is related to the
> original bug.
>
> Maybe we need someone else to test this too.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1184104
>
> Title:
> Files crashes when view changed with contents of empty folder selected
>
> Status in Files:
> Confirmed
>
> Bug description:
> To reproduce bug:
>
> 1) Switch to list view
> 2) Navigate to a folder that contains an empty sub-folder
> 3) Select the empty folder and click the expand arrow
> 4) Select the blank line that appears
> 5) Double-click the empty folder ("This folder is empty" message
> displays)
> 6) Switch to icon view
>
> Files crashes with a segmentation fault
>
> Installed version is 0.1-0~r1190+pkg13~precise1
>
> Crash does not occur if the empty folder is not expanded.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/pantheon-files/+bug/1184104/+subscriptions
>

--
Jeremy Wootten
GPG Key ID CB585BCD
Key Fingerprint 37C0 3C2A A6D4 E45B BA7C 4328 2DF2 1882 CB58 5BCD

Revision history for this message
Julián Unrrein (junrrein) wrote :

If you think your branch is ready for being incorporated into trunk, make a merge proposal.
If you aren't sure, propose it anyway, stating your concerns, and the app team will tell you if it's cool or not.

Also, it'd be nice if you link the branch to this bug report, so it gets more visibility.

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :

I have now linked my branch. I'll test a little longer before proposing a merge. It would be better to get to the root cause of why functions are being called with invalid parameters rather than just adding extra checks. But I do not know my way around the code well enough yet.

Revision history for this message
Jeremy Wootten (jeremywootten) wrote :
Revision history for this message
Julián Unrrein (junrrein) wrote :

This bug could be related to bug #1160363, since the branch linked here seems to prevent that crash too.

Revision history for this message
Julián Unrrein (junrrein) wrote :

I am currently investigating this bug.

It seems that expanded directories aren't unloaded when the list view is destroyed. If we happen to also enter one of those directories at the same time, things get messed up.

Or so I think. I will look at this more in depth later.

Changed in pantheon-files:
assignee: Jeremy Wootten (jeremywootten) → Julián Unrrein (junrrein)
status: Confirmed → In Progress
Cody Garver (codygarver)
Changed in pantheon-files:
milestone: none → luna-rc1
Cody Garver (codygarver)
Changed in pantheon-files:
status: In Progress → Fix Released
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.