After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697198 - searching with criteria consumes 100% CPU
searching with criteria consumes 100% CPU
Status: RESOLVED OBSOLETE
Product: nautilus
Classification: Core
Component: File Search Interface
3.12.x
Other Linux
: Normal critical
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 702797 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-03 16:56 UTC by Adam Dingle
Modified: 2017-08-15 22:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do not modify ellipsize property, just to confirm the issue (552 bytes, patch)
2014-01-27 16:54 UTC, Daniel Wyatt
none Details | Review
Rather than modifying the ellipsize property, we can use the natural size of the label (1.10 KB, patch)
2014-02-13 15:32 UTC, Daniel Wyatt
committed Details | Review

Description Adam Dingle 2013-04-03 16:56:55 UTC
I'm running Nautilus 3.8.0 on Ubuntu 13.04.

To see the problem:
1. Configure Nautilus with --disable-tracker, build and install.
2. In Nautilus, navigate to a folder that has just a few files and no subfolders.
3. Press the magnifying glass icon to initiate a search.
4. Press the + button to show search criteria.  You'll see "File Type - Any".

Now all files will disappear from the view.  Nautilus will display "Searching..." in the lower right corner and will peg the CPU at 100% indefinitely.  If you modify the search criteria, the situation remains the same and Nautilus still shows no results.
Comment 1 António Fernandes 2013-04-04 15:03:28 UTC
I see this when built with tracker support enabled as well, with exactly the same steps and symptoms.
Comment 2 António Fernandes 2013-04-04 15:15:35 UTC
I found that "a folder that has just a few files and no
subfolders" is not a requirement. I get the same result with whatever directory.

I get this in the terminal after clicking the + button:

** (nautilus:8028): WARNING **: Provider NautilusSearchEngineTracker failed with error no such module: trackerfts
Comment 3 Cosimo Cecchi 2013-04-04 20:18:39 UTC
I can't reproduce this bug in my environment unfortunately, but the symptoms sound a lot like https://bugzilla.gnome.org/show_bug.cgi?id=692035.
Which version of GTK are you guys testing this on?

(In reply to comment #2)
> I get this in the terminal after clicking the + button:
> 
> ** (nautilus:8028): WARNING **: Provider NautilusSearchEngineTracker failed
> with error no such module: trackerfts

This seems an unrelated error with your tracker configuration.
Comment 4 Adam Dingle 2013-04-04 20:49:51 UTC
I have libgtk 3.8.0.
Comment 5 António Fernandes 2013-04-04 22:27:55 UTC
I am testing from jhbuild on Fedora 18, tracking 3.8 moduleset, glib, gtk+ and nautilus cleanly rebuilt minutes ago. Still reproducible.
Comment 6 Garrett Regier 2013-06-29 20:52:40 UTC
*** Bug 702797 has been marked as a duplicate of this bug. ***
Comment 7 Garrett Regier 2013-06-29 20:53:18 UTC
Now it prints a warning:

Gdk-WARNING **: gdk-frame-clock: layout continuously requested, giving up after
4 tries


The relevant GTK+ commit:
https://git.gnome.org/browse/gtk+/commit/?id=c3bff30b504f80f9c8bc451bb5a73d1b0047b89f
Comment 8 Adam Dingle 2013-12-07 15:19:28 UTC
I'm still seeing this with Nautilus from git master and GTK 3.10.6 on Ubuntu 14.04.  One slight change: in my original description above I said that all files disappeared from the view.  Now they are still visible when this occurs, and in fact searching works: I can type a search term to filter the files I see below.  The CPU, however, is still churning away.
Comment 9 Daniel Wyatt 2014-01-27 16:52:11 UTC
I think Cosimo hit the nail on the head here.
This seems to be https://bugzilla.gnome.org/show_bug.cgi?id=692035 returning to haunt us.

(https://bugzilla.gnome.org/show_bug.cgi?id=692035#c3)
> The set_label_size_request() function at
> http://git.gnome.org/browse/nautilus/tree/src/nautilus-pathbar.c?id=id=9a122cb3aa4f85548ff036ea3e6509e0e60387f8#n304
> is completely broken. Size requests must not modify widgets.
> 
> So what happens is that unsetting ellipsisze will of course queue a resize on
> the label which in turn will queue a resize on the pathbar. And when you do
> that during size computation, size computation will cause a resize which will
> cause a size computation.
> 
> I have no idea why it used to work, but I'm convinced that was a lucky
> accident.

(https://bugzilla.gnome.org/show_bug.cgi?id=692035#c4)
> This seems to have been fixed in GTK in the meantime.
> That code has quite a long history in the pathbar; it's trying to make the
> label request size as if it was bold, so that the button doesn't change size
> when you click it...
> 
> Anyway, not a problem anymore. I hope this won't be back at some point :)

It's baaack. When is the label supposed to be bold anyways? I have never seen it bold.
And is it really necessary to mess with the ellipsize property?
Comment 10 Daniel Wyatt 2014-01-27 16:54:00 UTC
Created attachment 267326 [details] [review]
Do not modify ellipsize property, just to confirm the issue
Comment 11 Daniel Wyatt 2014-02-13 15:26:04 UTC
> It's baaack. When is the label supposed to be bold anyways? I have never seen it bold.
I must have been half asleep here, I meant to say I haven't seen the pathbar labels ellipsize.
I have seen it now though.

Anyways, I'll post a patch in a minute.
Comment 12 Daniel Wyatt 2014-02-13 15:32:14 UTC
Created attachment 269032 [details] [review]
Rather than modifying the ellipsize property, we can use the natural size of the label
Comment 13 Daniel Wyatt 2014-02-13 15:44:59 UTC
So the new patch ought to fix this.

Basically instead of this:
gtk_label_set_ellipsize (GTK_LABEL (button_data->label), PANGO_ELLIPSIZE_NONE);
gtk_widget_get_preferred_size (button_data->label, &min_req, NULL);
gtk_label_set_ellipsize (GTK_LABEL (button_data->label), PANGO_ELLIPSIZE_MIDDLE);

We can do this:
gtk_widget_get_preferred_size (button_data->label, NULL, &min_req);

(Note the position of the min_req argument)
Because the natural size of a label is already the non-ellipsized size.
Comment 14 Daniel Wyatt 2014-02-14 23:30:51 UTC
Any chance this could be closed soon? (Hoping to pay bills this month)

I think the patch works perfectly, it resulted in the same exact min_req as the old code when I tested it, but without the continuous layout CPU usage issue.
Comment 15 Cosimo Cecchi 2014-02-17 20:57:18 UTC
Thanks, I pushed this to git master.
Comment 16 António Fernandes 2014-03-01 22:38:18 UTC
I can still reproduce this bug.

Steps to reproduce are:

1) click on magnifying glass icon
2) click on [+] button at the end of the search bar.

Stack trace:

Thread 1 (Thread 0x7ffff3f6ba40 (LWP 2915))

  • #0 vfprintf
    from /lib64/libc.so.6
  • #1 vasprintf
    from /lib64/libc.so.6
  • #2 g_vasprintf
    at gprintf.c line 316
  • #3 g_strdup_vprintf
    at gstrfuncs.c line 507
  • #4 g_strdup_printf
    at gstrfuncs.c line 533
  • #5 _nautilus_profile_log
    at nautilus-profile.c line 55
  • #6 nautilus_directory_emit_files_changed
    at nautilus-directory.c line 798
  • #7 file_changed
    at nautilus-search-directory.c line 200
  • #8 g_cclosure_marshal_VOID__VOIDv
    at gmarshal.c line 115
  • #9 _g_closure_invoke_va
    at gclosure.c line 831
  • #10 g_signal_emit_valist
    at gsignal.c line 3215
  • #11 g_signal_emit
    at gsignal.c line 3363
  • #12 nautilus_file_emit_changed
    at nautilus-file.c line 7189
  • #13 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #14 nautilus_file_changed
    at nautilus-file.c line 7144
  • #15 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #16 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #17 nautilus_file_changed
    at nautilus-file.c line 7144
  • #18 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #19 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #20 nautilus_file_changed
    at nautilus-file.c line 7144
  • #21 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #22 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #23 nautilus_file_changed
    at nautilus-file.c line 7144
  • #24 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #25 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #26 nautilus_file_changed
    at nautilus-file.c line 7144
  • #27 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #28 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #29 nautilus_file_changed
    at nautilus-file.c line 7144
  • #30 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #31 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #32 nautilus_file_changed
    at nautilus-file.c line 7144
  • #33 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #34 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #35 nautilus_file_changed
    at nautilus-file.c line 7144
  • #36 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #37 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #38 nautilus_file_changed
    at nautilus-file.c line 7144
  • #39 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #40 nautilus_directory_emit_change_signals
  • #41 nautilus_file_changed
    at nautilus-file.c line 7144
  • #42 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #43 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #44 nautilus_file_changed
    at nautilus-file.c line 7144
  • #45 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #46 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #47 nautilus_file_changed
    at nautilus-file.c line 7144
  • #48 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #49 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #50 nautilus_file_changed
I cut the rest of the stack trace, with continues endlessly repeating the same pattern.
Comment 17 António Fernandes 2014-03-02 15:11:44 UTC
With some more time and patience, I reached the end of the stacktrace:

  • #120839 nautilus_file_changed
    at nautilus-file.c line 7144
  • #120840 nautilus_file_emit_changed
    at nautilus-file.c line 7195
  • #120841 nautilus_directory_emit_change_signals
    at nautilus-directory.c line 815
  • #120842 nautilus_file_changed
    at nautilus-file.c line 7144
  • #120843 query_info_callback
    at nautilus-directory-async.c line 3382
  • #120844 g_task_return_now
    at gtask.c line 1078
  • #120845 complete_in_idle_cb
    at gtask.c line 1087
  • #120846 g_idle_dispatch
    at gmain.c line 5297
  • #120847 g_main_dispatch
    at gmain.c line 3066
  • #120848 g_main_context_dispatch
    at gmain.c line 3641
  • #120849 g_main_context_iterate
    at gmain.c line 3712
  • #120850 g_main_context_iteration
    at gmain.c line 3773
  • #120851 g_application_run
    at gapplication.c line 2112
  • #120852 main
    at nautilus-main.c line 103

Comment 18 Daniel Wyatt 2014-03-02 15:32:23 UTC
@António: I can not reproduce this. I did the following:

1) git clone git://git.gnome.org/nautilus
2) cd nautilus
3) ./autogen.sh --prefix=/usr --sysconfdir=/etc \
     --localstatedir=/var --disable-static \
     --libexecdir=/usr/lib/nautilus \
     --disable-nst-extension \
     --disable-update-mimedb \
     --disable-packagekit \
     --disable-schemas-compile \
     --disable-tracker (works either way...)
4) make
5) sudo make install
6) nautilus
7) Click the magnifying glass icon
8) Click the [+] button at the end of the search bar
9) (CPU usage is normal)

Are you sure you're on the newest master?
Running 'git log | grep fae9dde' should show the commit that fixed this.
Comment 19 António Fernandes 2014-03-02 15:56:58 UTC
(In reply to comment #18)
> Are you sure you're on the newest master?

That's correct.

1) nautilus -q
2) jhbuild buildone -fac nautilus
3) jhbuild run nautilus
4) Click the magnifying glass icon
5) Click the [+] button at the end of the search bar.

I reopened this report because I can still reproduce it after the commit.
Comment 20 António Fernandes 2014-03-29 15:44:45 UTC
This crash is also reproducible by setting the scope to "All Files", without inserting a query beforehand:

1) $ nautilus -q
2) $ nautilus
4) Click the magnifying glass icon
5) Click the [ All Files ] button near end of the search bar.

Tested on nautilus 3.12.0
Comment 21 António Fernandes 2017-08-15 22:20:14 UTC
The search interface completely redesigned was redesigned. This crash is no longer reproducible.

The new search interface is already available in recent nautilus stable versions.