Multi Commander > Beta Releases

Crashes when running scripts 4.3.5 b1716

(1/3) > >>

Ulfhednar:
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: ---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
--- End code ---

Mathias (Author):
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:
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: ---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");
 
}
--- End code ---

Mathias (Author):
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):
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.


Navigation

[0] Message Index

[#] Next page

Go to full version