4 Replies Latest reply on Jan 16, 2011 8:41 AM by Blik Revil

    Photoshop CS5 crashes instantly when opening .CSV-Files

    Blik Revil Level 1

      Hi there,

       

      I have this really strange problem that CS5 (Win) crashes instantly when performing a script. This particular script works perfectly fine on CS3 since a few years.

       

      I located the point of crashing here:

       

      var read_data = new File(pdata);
      var isopen = read_data.open("r");
      if (isopen) {
        var contents = read_data.read();
        read_data.close();

      ...

       

      And now for the really strange part: The script only crashes every 2nd time!!! It seems as if there is still some garbage in the memory.

       

      So, does anybody know how to correctly handle opening, reading and closing Textfiles?

       

      Best regards

      Blik

        • 1. Re: Photoshop CS5 crashes instantly when opening .CSV-Files
          Level 7

          Have you installed the latest version of Photoshop CS5?

           

          Can we get a copy of the script and files that cause the crash?

          • 2. Re: Photoshop CS5 crashes instantly when opening .CSV-Files
            Blik Revil Level 1

            Hi Chris,

             

            sorry for getting back so late, I was quite busy over christmas

             

            I made some more tests myself and a few days ago I got my new 64-Bit Win 7, so here's my results:

             

            - PS only crashes in its 32 Bit version, the 64 Bit version works fine without crashing (Both versions are fully updated).

            - The script only crashes when accessing/opening .csv-Files that are stored on an external USB-HDD, internal HDDs are not affected

             

            Thank you for answering so soon, from my side this issue is solved by using the 64 Bit version from now on.

             

            Cheers

            Blik

            • 3. Re: Photoshop CS5 crashes instantly when opening .CSV-Files
              Blik Revil Level 1

              Workaround: Use the 64 Bit version or work locally instead of using external HDDs

              • 4. Correction: It's opening a new Window() that causes the crash
                Blik Revil Level 1

                Hey there,

                 

                my apologies - it seems I got it completely wrong.

                 

                Due to other circumstances I just thought the problem was solved, but the other day the crashes returned... Further investigations made it clear, that the source of the problems was not the opening of a CSV-file, but rather the creation of a new window resource:

                 

                var win = new Window('dialog', 'AnyName');

                 

                in the last weeks I did some in-depth checking and cursing about this problem, and I now found its source, and it's ... weird!

                 

                Now, what causes the crashes?

                If you would like to try it for youselves, use this testscript:


                winCrash();

                function winCrash() {
                var win = new Window('dialog', 'AnyName');
                win.pnl = win.add("panel", [5,5,225,120], 'A Panel');
                win.pnl.titel = win.pnl.add('edittext', [15,15,200,35], 'Test Entry');
                win.pnl.bluete = win.pnl.add('edittext', [15,45,200,65], 'Test Entry');
                win.pnl.okBtn = win.pnl.add("button", [25,75,105,95], 'OK');
                win.pnl.cnlBtn = win.pnl.add("button", [120, 75, 190, 95], 'Cancel');

                win.pnl.okBtn.onClick = function() {
                  win.close();
                  return 1;
                }

                win.pnl.cnlBtn.onClick = function() {
                  win.close();
                  return -1;
                }
                return win.show();
                }

                I'm using CS5 64 Bit on a 64 Bit Win 7, so I cannot say how this will (not) work on other environments.

                 

                Steps to reproduce the crash:

                1. Open Bridge CS5 (DO NOT open PS, make sure it's not open at this point!!!)
                2. Let Bridge open PS by double-clicking a file
                3. Run the script
                4. Close the picture, but don't close PS
                5. Return to Bridge and repeat this process (from point 2.) on) by opening another image from Bridge and run the script again - voila, PS crashes every 2nd time you run the script..

                 

                The crash will not occur, if you open PS before Bridge opens it! It seems that somehow it's the Bridge that does something "evil".

                 

                On the bright side of it, by re-writing my script I gained some more knowledge and the new script has 100 lines less

                 

                Cheers Blik