Author Topic: Crashes when running scripts 4.3.5 b1716  (Read 28494 times)

Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Crashes when running scripts 4.3.5 b1716
« on: July 12, 2014, 15:07:15 »
I have seen a few crashes since upgrading to 1716.
This happens when running scripts on multiple items [hi-lited file or folder selections] where the script performs multiple functions e.g. - rename; move.
These scripts were working OK previously & I haven't tried any of the latest scripting features yet.  Maybe this is a coincidence?

Windows reports -

Code: [Select]
Problem signature:
  Problem Event Name: APPCRASH
  Application Name: MultiCommander.exe
  Application Version: 4.3.5.1716
  Application Timestamp: 53bc1e55
  Fault Module Name: MultiCommander.exe
  Fault Module Version: 4.3.5.1716
  Fault Module Timestamp: 53bc1e55
  Exception Code: c000041d
  Exception Offset: 0000000000192f1a
  OS Version: 6.1.7601.2.1.0.256.1
  Locale ID: 2057
  Additional Information 1: 7776
  Additional Information 2: 7776b171d8f6376d2a0c9e49b8ea7df5
  Additional Information 3: b1c9
  Additional Information 4: b1c947b179b29ac26d1a69ec9aa81cc4

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #1 on: July 12, 2014, 16:10:16 »
The crash numbers you pasted do not say anything.. They are useless. It does not contain any information what so ever.

Better would be a script example that do cause a crash.
Did it send a crash dump ? if so.. What was the CrashID

Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Crashes when running scripts 4.3.5 b1716
« Reply #2 on: July 13, 2014, 13:48:35 »
Unfortunately that is the only record I get - MC doesn't report anything itself.  It is just shutdown so that is the best I can provide...  :'(
This is one of the scripts that crashed MC b1716 - it has been working well for quite a while, so I suspected something other than a script syntax error.

Code: [Select]
Log( 1, 10, "Renaming files to %%parent_folder_name%%[_N].*" );

@var $src_path = GetSourcePath();
@var $arr = PathGetParts( $src_path );
@var $name = $arr[0];
@var $prefix = StrReplace( PathGetPathPart( $src_path, 1 ), $name, "" );

@var $n = StrRFind( $prefix, "\\" );

if ( $n > 0 )
{
  $prefix = StrSub( $prefix, $n + 1, StrLen( $prefix ) - $n - 1 );

  @var $i;
  @var $s;
  @var $file;
  @var $files;

  $arr = GetSourceSelectedPaths();

  for ( $i = 0; $i < arrayCount( $arr ); $i++ )
  {
    $file = $arr[$i];
    $s = PathGetFileExtPart( $file );
    $name = $prefix + "*" + $s;

    $files = FindFiles( $src_path + $name );
    $n = arrayCount( $files );

    if ( $n == 0 )
    {
      $s = "";
    }
    else
    {
      if ( $n == 1 )
      {
        $s = $files[0]; 
        RenameFile( $s, StrReplace( $name, "*", "_0" ), "RENAME_RO" );
      }

      $s = "_" + numtostr( $n );
    }           

    RenameFile( $file, StrReplace( $name, "*", $s ), "RENAME_RO" );
  }
}
else
{
  Log( 1, 10, "It seems parent folder is root. Renaming impossible." );
}

// move

@var $arr1 = GetSourceSelectedPaths();
@var $items1 = arrayCount($arr1);
@var $MoveNameFullPath;
@var $targetPath;
@var $sourceFile;
@var $n1 = 0;

for( $n1 = 0; $n1 < $items1; $n1++ )
{
  $MoveNameFullPath = $arr1[ $n1 ];
  $targetPath = GetTargetPath();
  $sourceFile = $MoveNameFullPath;
 
  MoveFile( $targetPath, $sourceFile, "NODIALOG");
 
}

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #3 on: July 13, 2014, 13:59:28 »
Very strange that no crash dump is created.

Anyway..  That is a massive script.. some setup on requirement on how files should be located and how to test it would be nice.

Also have you tried to run it in the debugger.. do it crash on a particular line ?

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #4 on: July 13, 2014, 16:41:04 »
Script works for me..  But I'm not sure Im using it in the way you meant it to work. Don't really understand what I does. But it does not crash. it renames and moves files.



Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Crashes when running scripts 4.3.5 b1716
« Reply #5 on: July 13, 2014, 19:06:53 »
Yes it normally works for me. 
I guess that the lock-up & crash occur in a way that prevents MC from starting to write any logs.
I don't think I have any background processes which could interfere with this + it only started recently.
Is there anything else that I can look for? 
HDD sleep settings when moving things between drives is the only thing that might be relevant.  I have noticed the 'egg-timer' circle come on & delay ops on occasion, I am checking to see if I can see why the sleep timers may be a bit skewed. 

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #6 on: July 13, 2014, 19:27:36 »
No it does not work like that.

So it does not crash all the time.. just sometimes?  Do you always run the script in the same location or can it be location based. maybe error in the script that makes it crash on some paths

And If I'm going to be able to test the script in a correct way I need info on how to run the script the way you do it..

Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Crashes when running scripts 4.3.5 b1716
« Reply #7 on: July 14, 2014, 12:55:34 »
No it is not a consistent crash.  Script is drive specific - moving things from one physical drive to another.  This is why I thought it might be PM related, if the target HDD had somehow decided to sleep & caused a problem.

Updated to b1720 & so far no crashes.
I will see if I can get it to fail & let you know (rather than waste your time unnecessarily).

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #8 on: July 14, 2014, 13:11:39 »
Sure, send a email instead if you want.  ( http://multicommander.com/contact , or directly if you already have email address )

No HDD Sleep can not cause an issue.. HDD sleep is handled on a Windows Kernel level. The OS does not know anything about that, The OS will block and wait until HD awakes.



Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Crashes when running scripts 4.3.5 b1716
« Reply #9 on: July 16, 2014, 11:31:51 »
No more crashes since I installed 1720.  I sorted out the HDD sleep times anyway. 

Going OT
The only thing that is now a bit odd is clicking on a folder in the folder tree now doesn't take me to the folder selected.  Normally it would hi-lite &/or move.    ???
I can still change dir via the path bar or files pane tho. 
I like the FAV path feature.

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #10 on: July 16, 2014, 12:37:13 »
Going OT
The only thing that is now a bit odd is clicking on a folder in the folder tree now doesn't take me to the folder selected.  Normally it would hi-lite &/or move.    ???
I can still change dir via the path bar or files pane tho. 
I like the FAV path feature.

Not sure why.. Something might have broken

Mathias (Author)

  • Administrator
  • VIP Member
  • *****
  • Posts: 4416
    • View Profile
    • Multi Commander
Re: Crashes when running scripts 4.3.5 b1716
« Reply #11 on: July 16, 2014, 12:43:01 »
Yes FAV path support in the FolderTree broke that. But it will work again in final version of 4.4 that are coming to night

Ulfhednar

  • Contributor
  • VIP Member
  • *****
  • Posts: 514
    • View Profile
Re: Crashes when running scripts 4.3.5 b1716
« Reply #12 on: July 16, 2014, 22:14:46 »
I wondered if there might be a connection between the FAV & the tree. 
Good to know a new build is due.  8)