<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>87491</bug_id>
          
          <creation_ts>2004-08-19 11:10:26 +0000</creation_ts>
          <short_desc>Crash on adding new folder</short_desc>
          <delta_ts>2005-02-19 16:41:07 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>juk</product>
          <component>general</component>
          <version>2.1</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Michael Schuerig">michael</reporter>
          <assigned_to name="Scott Wheeler">wheeler</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>260027</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Schuerig">michael</who>
    <bug_when>2004-08-19 11:10:26 +0000</bug_when>
    <thetext>Version:           2.1 (using KDE 3.3.0,  (3.1))
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-7)
OS:                Linux (i686) release 2.6.7

After installing the Debian/unstable packages for KDE pre-3.3.0, I noticed, that JuK no longer recognized it when new files were added to my music folder. In order to rebuild its cache, I removed ~/.kde/share/apps/juk and after launching JuK added my music folder. After clicking OK in the folder list this immediately crashes JuK.

Using host libthread_db library &quot;/lib/tls/i686/cmov/libthread_db.so.1&quot;.
[Thread debugging using libthread_db enabled]
[New Thread 1073893376 (LWP 4108)]
[KCrash handler]
#4  0x47aa037b in readdir () from /lib/tls/i686/cmov/libc.so.6
#5  0xbfffe590 in ?? ()
#6  0xbfffe570 in ?? ()
#7  0x080d62e9 in typeinfo name for Qt ()
#8  0xbfffe538 in ?? ()
#9  0x08092dde in QValueListPrivate&lt;KURL&gt;::QValueListPrivate ()

The crash is in playlist.cpp line 1445.

Michael</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260880</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-22 01:35:15 +0000</bug_when>
    <thetext>Hmm, it seems that opendir() can fail for some reason, and then readdir() crashes on the null pointer.  I&apos;m investigating how Qt could betray us so. ;-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260895</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-22 02:26:25 +0000</bug_when>
    <thetext>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) &lt;&lt; &quot;Unable to open directory &quot;
+                             &lt;&lt; fileInfo.filePath()
+                             &lt;&lt; &quot;, make sure it is readable.\n&quot;;
+        }
+    }
 
     return after;


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260896</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-22 02:28:10 +0000</bug_when>
    <thetext>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) &lt;&lt; &quot;Unable to open directory &quot;
+                             &lt;&lt; fileInfo.filePath()
+                             &lt;&lt; &quot;, make sure it is readable.\n&quot;;
+        }
+    }
 
     return after;


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>260898</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Schuerig">michael</who>
    <bug_when>2004-08-22 02:57:54 +0000</bug_when>
    <thetext>Hm, that&apos;s not a fix, it only circumvents the crash, but doesn&apos;t solve the problem.

I don&apos;t quite understand what and why is happening, but what seems to be causing the problem is that I&apos;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
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261214</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-23 00:37:33 +0000</bug_when>
    <thetext>Well I&apos;ve tried opening up my partition mount point with JuK with no problems.

So, there&apos;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&apos;ll be attaching a short C snippet that will try calling readdir() and report the output, I&apos;d appreciate it if you could compile it and try running it on the folder that crashes JuK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261217</commentid>
    <comment_count>6</comment_count>
      <attachid>7225</attachid>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-23 00:40:00 +0000</bug_when>
    <thetext>Created attachment 7225
C Program to try calling opendir(), and report the success/failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261249</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Schuerig">michael</who>
    <bug_when>2004-08-23 03:10:00 +0000</bug_when>
    <thetext>The test program works just fine. I&apos;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&apos;s a hitch: It does not import playlists.

Michael</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261665</commentid>
    <comment_count>8</comment_count>
    <who name="Michael Pyne">mpyne</who>
    <bug_when>2004-08-24 01:29:55 +0000</bug_when>
    <thetext>Well that&apos;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&apos;t work that the Import Playlist checkbox in File -&gt; Add Folder is actually checked?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>261668</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Schuerig">michael</who>
    <bug_when>2004-08-24 01:50:51 +0000</bug_when>
    <thetext>I&apos;ve looked at the sources for the debian package and there is not specific patch for JuK. I&apos;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&apos;ve force-fsck&apos;ed my music partition (ext3).

Michael</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>264369</commentid>
    <comment_count>10</comment_count>
    <who name="Jacob Hinkle">hinklejd</who>
    <bug_when>2004-08-31 02:13:50 +0000</bug_when>
    <thetext>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 &quot;files&quot; 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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>315900</commentid>
    <comment_count>11</comment_count>
    <who name="Scott Wheeler">wheeler</who>
    <bug_when>2005-02-19 16:41:07 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>7225</attachid>
            <date>2004-08-23 00:40:00 +0000</date>
            <delta_ts>2004-08-23 00:40:00 +0000</delta_ts>
            <desc>C Program to try calling opendir(), and report the success/failure.</desc>
            <filename>opendir-test.c</filename>
            <type>text/plain</type>
            <size>732</size>
            <attacher name="Michael Pyne">mpyne</attacher>
            
              <data encoding="base64">LyoKICogb3BlbmRpci10ZXN0LmMgLS0gUmVwb3J0IGVycm9yIGNvZGUgZnJvbSB1c2luZyBvcGVu
ZGlyKDMpIG9uIGEgZGlyZWN0b3J5LAogKiBwYXNzZWQgYXMgdGhlIGZpcnN0IGFuZCBvbmx5IGNv
bW1hbmQgbGluZSBwYXJhbWV0ZXIuCiAqCiAqIENvbXBpbGUgdXNpbmc6IGdjYyAtbyBvcGVuZGly
LXRlc3Qgb3BlbmRpci10ZXN0LmMKICovCiNpbmNsdWRlIDxzdGRpby5oPgojaW5jbHVkZSA8ZGly
ZW50Lmg+CiNpbmNsdWRlIDxzeXMvdHlwZXMuaD4KI2luY2x1ZGUgPGVycm5vLmg+CiNpbmNsdWRl
IDxzdHJpbmcuaD4KCiNkZWZpbmUgU1RSRVEoYSxiKSAoc3RyY21wKGEsYikgPT0gMCkKCmludCBt
YWluKGludCBhcmdjLCBjaGFyICoqYXJndikKewogICAgRElSICpkaXIgPSAwOwoKICAgIGlmKGFy
Z2MgPCAyIHx8IFNUUkVRKGFyZ3ZbMV0sICItLWhlbHAiKSkgewoJZnByaW50ZihzdGRlcnIsICJV
c2FnZTogJXMgPGRpcmVjdG9yeS1uYW1lPlxuIiwgYXJndlswXSk7CglyZXR1cm4gMTsKICAgIH0K
CiAgICBkaXIgPSBvcGVuZGlyKGFyZ3ZbMV0pOwoKICAgIGlmKCFkaXIpIHsKCWZwcmludGYoc3Rk
ZXJyLCAiRmFpbHVyZSBvcGVuaW5nICVzOiAlc1xuIiwgYXJndlsxXSwgc3RyZXJyb3IoZXJybm8p
KTsKCXJldHVybiAyOwogICAgfQoKICAgIGNsb3NlZGlyKGRpcik7CiAgICBwcmludGYoIm9wZW5k
aXIoKSBjYWxsZWQgc3VjY2Vzc2Z1bGx5LlxuIik7CgogICAgcmV0dXJuIDA7Cn0K
</data>

          </attachment>
      

    </bug>

</bugzilla>