Bug report #14255

SVG preview blocks QGIS

Added by Paolo Cavallini almost 9 years ago. Updated about 8 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:Nyall Dawson
Category:Symbology
Affected QGIS version:master Regression?:No
Operating System:Debian Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:22251

Description

When changing a symbol to SVG, or in other instances where SVG preview should be created in vector properties, QGIS takes 100% of CPU, and the system lags for ages, even on a modern machine.

SVG_recursive_search_fails_with_circular_links.png - Dialog with the circular SVG path (147 KB) Jorge Rocha, 2016-07-04 01:24 AM

Associated revisions

Revision c60c4f7f
Added by Nyall Dawson about 8 years ago

Fix SVG preview blocks QGIS (fix #14255)

Now SVG preview loading occurs in a background thread so that
dialogs can open instantly

Revision 0b683637
Added by Nyall Dawson about 8 years ago

Merge pull request #3565 from nyalldawson/svg_background

Fix SVG preview blocks QGIS (fix #14255)

Revision ffafafdb
Added by Nyall Dawson about 8 years ago

Fix SVG preview blocks QGIS (fix #14255)

Now SVG preview loading occurs in a background thread so that
dialogs can open instantly

Also guard against circular symbolic links in SVG selector widget

(cherry-picked from c60c4f7f0ca09dc6bbc8e3f721339a238154ff57)

Revision bb2450ee
Added by Nyall Dawson about 8 years ago

Fix SVG preview blocks QGIS (fix #14255)

Now SVG preview loading occurs in a background thread so that
dialogs can open instantly

Also guard against circular symbolic links in SVG selector widget

(cherry-picked from c60c4f7f0ca09dc6bbc8e3f721339a238154ff57)

History

#1 Updated by Richard Duivenvoorde almost 9 years ago

Hi Paolo,

can you provide more details to reproduce?

I'm here on Debian testing, but can perfectly fine load a point layer and select one of the svg symbols for it.

#2 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Open to Feedback

No problems whatsoever on master on both Ubuntu and Windows. Please try another system and report back. Thanks.

#3 Updated by Paolo Cavallini almost 9 years ago

Thanks for the feedback. In this case a packaging/dependency problem seems likely. Anyone on sid?

#4 Updated by Giovanni Manghi almost 9 years ago

Paolo Cavallini wrote:

Thanks for the feedback. In this case a packaging/dependency problem seems likely. Anyone on sid?

If I'm not wrong Richard is on sid, and this would suggest a local issue.

#5 Updated by Paolo Cavallini almost 9 years ago

Richard is on testing

#6 Updated by Giovanni Manghi almost 9 years ago

Paolo Cavallini wrote:

Richard is on testing

have you tried other machines?

#7 Updated by Nyall Dawson over 8 years ago

Paolo- can I close this? No-one else is able to reproduce this issue.

#8 Updated by Paolo Cavallini over 8 years ago

  • Status changed from Feedback to Closed
  • Resolution set to worksforme

OK, thanks

#9 Updated by Jorge Rocha over 8 years ago

Hi,

This same behavior is happening on 2.14.3 on Ubuntu.

After waiting several minutes for the dialog with the SVG symbols, with the CPU at 100%, I found out the following:
- QGIS is following symbolic links recursively to find SVG symbols to show on the dialog.

There are 3 SVG groups on the style dialog:
- jgr (my account)
- App Symbols
- User Symbols

The problem happens with symbols found in my account.

The path of a symbol, for example, is:
/home/jgr/WebstormProjects/MyDashBoard/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/public/server/node_modules/dns/public/css/fonts/glyphicons-halflings-regular.svg

In my case, in /home/jgr/WebstormProjects/MyDashBoard/server/public I have a symbolic link 'public' pointing to '..'.

I think we need to prevent that the search algorithm does not transverses that same link again.

#10 Updated by Jorge Rocha over 8 years ago

Since the user can edit the SVG path (Settings โ†’ Options โ†’ System โ†’ SVG Path), if I remove the folder with circular links, the problem disappears.

#11 Updated by Andreas Neumann over 8 years ago

Paolo: I wonder if your issue is the same? Can you please check if there are any circular symbolic links in your SVG paths?

I cannot replicate the issue on Ubuntu 16.04 and self compiled master. But I have no symbolic links in my SVG paths ...

#12 Updated by Andreas Neumann over 8 years ago

  • Status changed from Reopened to Feedback

#13 Updated by Paolo Cavallini over 8 years ago

No circular ref here.

#14 Updated by Giovanni Manghi over 8 years ago

  • Status changed from Feedback to Open
  • Resolution deleted (worksforme)

#15 Updated by Andreas Neumann over 8 years ago

Why is this bug still open? Apparently the issue with the accidental home folder is fixed in master and 2.16 and if a user is still affected (s)he can easily remove the home folder from the settings.

Not a big issue in my opinion and we should close this bug.

#16 Updated by Nyall Dawson over 8 years ago

I still think this needs to be properly addressed, and make the svg preview run in a non blocking thread.

#17 Updated by Nyall Dawson about 8 years ago

  • Assignee set to Nyall Dawson

#18 Updated by Nyall Dawson about 8 years ago

PR at https://github.com/qgis/QGIS/pull/3565 - also fixes the circular symlink issue.

#19 Updated by Nyall Dawson about 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF