Summary: | Crash on adding new folder | ||
---|---|---|---|
Product: | [Applications] juk | Reporter: | Michael Schuerig <michael> |
Component: | general | Assignee: | Scott Wheeler <wheeler> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 2.1 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | C Program to try calling opendir(), and report the success/failure. |
Description
Michael Schuerig
2004-08-19 11:10:26 UTC
Hmm, it seems that opendir() can fail for some reason, and then readdir() crashes on the null pointer. I'm investigating how Qt could betray us so. ;-) CVS commit by mpyne: Commit bugfix for crash bug #87491. Reporter: please test if this fixes your problem. You may also want to check your directory permissions, the only way I could reproduce this was to remove access permissions for my test directory. CCMAIL:87491@bugs.kde.org M +15 -6 playlist.cpp 1.243.2.1 --- kdemultimedia/juk/playlist.cpp #1.243:1.243.2.1 @@ -1441,4 +1441,6 @@ PlaylistItem *Playlist::addFile(const QS DIR *dir = ::opendir(QFile::encodeName(fileInfo.filePath())); + + if(dir) { struct dirent *dirEntry; @@ -1450,4 +1452,11 @@ PlaylistItem *Playlist::addFile(const QS ::closedir(dir); } + else + { + kdWarning(65432) << "Unable to open directory " + << fileInfo.filePath() + << ", make sure it is readable.\n"; + } + } return after; CVS commit by mpyne: Forward porting bugfix for crash bug #87491. CCMAIL:87491-done@bugs.kde.org M +15 -6 playlist.cpp 1.246 --- kdemultimedia/juk/playlist.cpp #1.245:1.246 @@ -1352,4 +1352,6 @@ PlaylistItem *Playlist::addFile(const QS DIR *dir = ::opendir(QFile::encodeName(fileInfo.filePath())); + + if(dir) { struct dirent *dirEntry; @@ -1361,4 +1363,11 @@ PlaylistItem *Playlist::addFile(const QS ::closedir(dir); } + else + { + kdWarning(65432) << "Unable to open directory " + << fileInfo.filePath() + << ", make sure it is readable.\n"; + } + } return after; Hm, that's not a fix, it only circumvents the crash, but doesn't solve the problem. I don't quite understand what and why is happening, but what seems to be causing the problem is that I'm trying to add a folder where a partition is mounted. When I add a folder below that topmost folder, it works. Presumably your /tmp is on its own partition. As a test try to add it as a folder to JuK. When I do this on my system, JuK crashes immediately. Yes, /tmp is readable... Michael Well I've tried opening up my partition mount point with JuK with no problems. So, there's other things we can try I guess. 1) Does running JuK from the Konsole result in any error output after trying to open the folder? 2) Are any other programs able to open the folder? Konqueror would be the easiest example. 3) Are any other multimedia programs able to open it, especially ones that also scan folders recursively? Amarok is the best-known example, but I think there is a playlist plugin for Noatun that could work for testing as well. I'll be attaching a short C snippet that will try calling readdir() and report the output, I'd appreciate it if you could compile it and try running it on the folder that crashes JuK. Created attachment 7225 [details]
C Program to try calling opendir(), and report the success/failure.
The test program works just fine. I've rebuild the JuK Debian package with debug info and it still crashes at the same point. In a chrooted environment I have an up to date CVS version of KDE. I simply copied JuK from over there to my normal environment -- and it works. No crash, it reads my music folder just fine. But there's a hitch: It does not import playlists. Michael Well that's very odd. Perhaps the Debian package for JuK contains a patch which is causing the problem? I assume when you mention that importing playlists doesn't work that the Import Playlist checkbox in File -> Add Folder is actually checked? I've looked at the sources for the debian package and there is not specific patch for JuK. I'll ask on the debian-kde ML, if anyone beside me is experiencing this problem. Yes, Import Playlists is checked and it is set in jukrc: ImportPlaylists=true To rule out any lingering inconsistencies, I've force-fsck'ed my music partition (ext3). Michael Hello, I just had this problem after reinstalling and keeping my music partition. One thing to check is that the permissions and ownership of the directories are correct. If you have forinstance a "files" group be sure it exists and that you are in it. perhaps other permissions things were your problem. I still think this is a bug since you should get an error message when there is any problem opening the directory. Hmm, doing a little cleaning at the moment. It seems that this one morphed from being a crash for one thing into JuK not being able to read playlists. If you still are having problems with the playlists in CVS please open a new bug report related to that. |