| Summary: | Enabling the script console crashes amarok | ||
|---|---|---|---|
| Product: | [Applications] amarok | Reporter: | Markus Wernig <public> |
| Component: | Tools/Script Manager | Assignee: | Amarok Bugs <amarok-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | darthcodus, johu |
| Priority: | NOR | ||
| Version First Reported In: | 2.8.90 (2.9 beta) | ||
| Target Milestone: | 2.9 | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| URL: | https://bugs.gentoo.org/show_bug.cgi?id=583016 | ||
| Latest Commit: | http://commits.kde.org/amarok/2900fe47adde10999a6c0f907d73b00a1c1bd5b1 | Version Fixed/Implemented In: | 2.9 |
| Sentry Crash Report: | |||
|
Description
Markus Wernig
2016-05-17 11:15:16 UTC
This was reported downstream at https://bugs.gentoo.org/show_bug.cgi?id=583016 Did you make sure the folder is writeable and tried again? Strangely the folder this tries to write to is in /usr/.. , while it should be in your home folder at ~/.kde/.. , so there is something wrong in your installation. FWIW: I can't reproduce this here with current git master, which should be very similar to 2.8.90 (In reply to Myriam Schweingruber from comment #2) > Did you make sure the folder is writeable and tried again? After chmod 777 /usr/share/apps/amarok/scriptconsole the error does not occur anymore. But obviously there is absolutely no reason why amarok should be writing something there. What are the permissions of /usr/share/apps/amarok/scriptconsole on your system? > Strangely the > folder this tries to write to is in /usr/.. , while it should be in your > home folder at ~/.kde/.. , so there is something wrong in your installation. Maybe so. Do you see any chance to find out what that is? There is no directory called "scriptconsole" in ~/.kde4/share/apps/amarok ... oh wait! After I created the directory ~/.kde4/share/apps/amarok/scriptconsole by hand, amarok does not crash anymore, but in fact the script console opens ... so it's a missing directory :-) But that would still be a bug, right? It shouldn't really crash, but just create the directory. (In reply to Markus Wernig from comment #3) > (In reply to Myriam Schweingruber from comment #2) ... > > Strangely the > > folder this tries to write to is in /usr/.. , while it should be in your > > home folder at ~/.kde/.. , so there is something wrong in your installation. > Maybe so. Do you see any chance to find out what that is? There is no > directory called "scriptconsole" in ~/.kde4/share/apps/amarok ... oh wait! > After I created the directory ~/.kde4/share/apps/amarok/scriptconsole by > hand, amarok does not crash anymore, but in fact the script console opens > ... so it's a missing directory :-) > > But that would still be a bug, right? It shouldn't really crash, but just > create the directory. Well, as I said, that directory is created correctly in ~/.kde/share/apps/amarok/.. in current git master. So either this has been fixed since 2.8.90 (which I am sure there was no commit about this), or there is something wrong in your installation, trying to install in /usr/.. instead of the home directory. Not sure there is a bug in Amarok, but I will have a look at the code ScriptConsole.cpp:
> if( m_savePath.isEmpty() )
> m_savePath = KUrl( KStandardDirs::locate( "data", "amarok/scriptconsole/" ) ).path();
According to kstandarddirs.h documentation: locateLocal should be used.
> > But that would still be a bug, right? It shouldn't really crash, but just
> > create the directory.
> Well, as I said, that directory is created correctly in
> ~/.kde/share/apps/amarok/.. in current git master. So either this has been
> fixed since 2.8.90 (which I am sure there was no commit about this), or
> there is something wrong in your installation, trying to install in /usr/..
> instead of the home directory. Not sure there is a bug in Amarok, but I will
> have a look at the code
Seems I spoke a tad fast, there is no directory created in ~/.kde/.. , but in /usr/.. in my local test installation. So apparently the dev only tested in in his local build. I will modify the bug description accordingly.
@Anmol: please check again which variable you use to create this directory (local vs. system), and please test in a system-wide installation
(In reply to Johannes Huber from comment #5) > ScriptConsole.cpp: > > if( m_savePath.isEmpty() ) > > m_savePath = KUrl( KStandardDirs::locate( "data", > "amarok/scriptconsole/" ) ).path(); > > According to kstandarddirs.h documentation: locateLocal should be used. A second option would be to extend the 'if' to check if dir is not writable: if( ( m_savePath.isEmpty() || !QDir( m_savePath ).exists() ) && ( m_savePath = QFileDialog::getExistingDirectory(this, i18n( "Choose where to save your scripts" ), "~", QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks) ).isEmpty() ) return 0; ts() ) Git commit 2900fe47adde10999a6c0f907d73b00a1c1bd5b1 by Myriam Schweingruber. Committed on 18/05/2016 at 19:59. Pushed by schweingruber into branch 'master'. Fix a crash in amarok when opening the Script Console The script console tries to write to a system folder instead of a user folder. Note to devs: always make sure to test a system installation, not just a local build. Thanks to Johannes Huber for the quick fix suggestion. FIXED-IN: 2.9 M +1 -1 src/scripting/scriptconsole/ScriptConsole.cpp http://commits.kde.org/amarok/2900fe47adde10999a6c0f907d73b00a1c1bd5b1 |