Новая версия платформы MetaTrader 5 build 2650: Фоновая загрузка графиков и улучшения в профилировщике MQL5-кода - страница 17

 

Пожалуйста, вы можете проверить эту ошибку? https://www.mql5.com/ru/forum/352980/page14#comment_18786590

Мы не можем использовать ChartIndicatorAdd() для мини-диаграмм из-за этой ошибки.

-------

Please, can you check this bug? https://www.mql5.com/ru/forum/352980/page14#comment_18786590

We cannot use ChartIndicatorAdd() to minicharts due to this bug.

Новая версия платформы MetaTrader 5 build 2650: Фоновая загрузка графиков и улучшения в профилировщике MQL5-кода
Новая версия платформы MetaTrader 5 build 2650: Фоновая загрузка графиков и улучшения в профилировщике MQL5-кода
  • 2020.10.15
  • www.mql5.com
В пятницу 9 октября 2020 года будет выпущена обновленная версия платформы MetaTrader 5...
 
fxsaber:

Крайне не рекомендую компилировать важные коды под b2656. Там серьезные баги в Release-варианте. Пока без воспроизведения.

Что-то со строками. StringReplace и т.д. Вплоть до краша.


В string образуются нулевые символы.

Да, у меня тоже краши в тестере и неадекватное поведение.

 
fxsaber:

Крайне не рекомендую компилировать важные коды под b2656. Там серьезные баги в Release-варианте. Пока без воспроизведения.

Что-то со строками. StringReplace и т.д. Вплоть до краша.


В string образуются нулевые символы.

Да, по ходу сейчас в посудную лавку запустили какого-то слона. 
Я нарвался на моргание всего терминала с частотой где-то 10 Гц. Словно терминал перегружался десять раз в секунду. Сначала подумал, что видюха накрылась. Но эта ситуация стабильно возникала при unlimited барах в крайнем левом положении чарта при отладке.
Никогда такого не видел с Windows приложениями.
 
fxsaber:

Что-то со строками. StringReplace и т.д. Вплоть до краша.

В string образуются нулевые символы.

Убил несколько часов на локализацию и воспроизведение.

// Воспроизведение бага с появлением нулевых символов в строке. MT5 b2656-b2657.

// Если в строке есть нулевой символ - true.
bool IsBugString( const string &Str )
{
  bool Res = false;
  
  for (int i = StringLen(Str) - 1; (i >= 0) && !Res; i--)
    Res = !Str[i];
    
  return(Res);
}

void OnStart()
{
  string Str = "d>d>d>d>d>Ta<td>cket</td><td></td><td></td><td>6.52 (1 437 572.68)" +
               "</td><td></td><td>OpenPrice</td><td>StopLoss</td><td>TakeProfit</t" +
               "d><td>CloseTime</td><td>ClosePrice</td><td>Commission</td><td>Swap" +
               "</td><td>Profit</td><td>Comment</td><td>Pips</td><td>SlipPage</td>" +
               "<td></td><td>LengthT>+1, 0</td><td><LT>>nTd>";
  
  Print((string)__LINE__ + " - " + (string)IsBugString(Str)); // false
  
  ::StringReplace(Str, "SlipPage", " "); // Здесь баг!
  
  Print((string)__LINE__ + " - " + (string)IsBugString(Str)); // true
}


Результат.

        22 - false
        26 - true


Этот баг приводит к таким последствиям.

        Access violation at 0x0000029891B11976 write to 0x000002989201C73A in 'C:\Program Files\MetaTrader 5\MQL5\Scripts\CustomReport.ex5'
           crash -->  0000029891B11976 0F110451          movups     [rcx+rdx*2], xmm0
                      0000029891B1197A 0F114C5110        movups     [rcx+rdx*2+0x10], xmm1
                      0000029891B1197F 488B7C2478        mov        rdi, [rsp+0x78]
                      0000029891B11984 4C8B5C2440        mov        r11, [rsp+0x40]
                      0000029891B11989 488B742428        mov        rsi, [rsp+0x28]
                      0000029891B1198E 4D39C8            cmp        r8, r9
                      0000029891B11991 0F8498000000      jz         dword 0x29891b11a2f
        
        
        00: 0x0000029891B11976


Большая просьба исправить в ближайшем билде. Пока приходится пользоваться Debug-вариантом. Там баг не проявляется.

 
2656 билд, после профилированя на реальных данных при скролинге отработавших функций Метаедитор зависает наглухо...
 

Ошибка в StringReplace исправлена в бете 2660.

Обновитесь, пожалуйста.

 
Renat Fatkhullin:

Ошибка в StringReplace исправлена в бете 2660.

Обновитесь, пожалуйста.

Вроде, пашет, как надо. Спасибо.

 

Dear Support Team,


I am using Build 2650 on a Windows10 mounted on 64-bit (x64) Intel. This is the strange thing that I noted. I build up a script for writing files through the Win32 API:

#define GENERIC_READ            0x80000000
#define GENERIC_WRITE           0x40000000

#define WIN32_FILE_SHARE_READ   1
#define WIN32_FILE_SHARE_WRITE  2

#define CREATE_NEW              1
#define CREATE_ALWAYS           2
#define OPEN_ALWAYS             4
#define OPEN_EXISTING           3
#define TRUNCATE_EXISTING       5

#define INVALID_HANDLE_VALUE    -1

#import "kernel32.dll"
   int CreateFileW(string Filename, uint AccessMode, int ShareMode, int PassAsZero, int CreationMode, int FlagsAndAttributes, int AlsoPassAsZero);
   int WriteFile(int FileHandle, uchar & Buffer[], int BufferLength, int & BytesWritten[], int PassAsZero);
   int CloseHandle(int FileHandle);
#import

bool WriteToFile(int handle, string data) {
   int bytes[1]  = {0};
   int sz               = StringLen(data);
   uchar write_bf[];
   StringToCharArray(data, write_bf);
   WriteFile(handle, write_bf, sz, bytes, 0);
      // Return true if the number of bytes written matches the expected number 
   return (bytes[0] == sz);   
}

void OnStart() {
  string filename = "C:/Users/sprea/Test/TestWinFiles.txt";
  int hdl = CreateFileW(filename, GENERIC_WRITE, WIN32_FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
  if (hdl == INVALID_HANDLE_VALUE) {
    Print("Cannot create a valid handle");
    return;
  }
  WriteToFile(hdl, "Hallo World!");
  CloseHandle(hdl);
}

The script works perfectly, and in the indicated directory I find the "TestWinFiles.txt" file which contains the content "Hallo world!".

Now I make just a SMALL modification:

#define GENERIC_READ            0x80000000
#define GENERIC_WRITE           0x40000000

#define WIN32_FILE_SHARE_READ   1
#define WIN32_FILE_SHARE_WRITE  2

#define CREATE_NEW              1
#define CREATE_ALWAYS           2
#define OPEN_ALWAYS             4
#define OPEN_EXISTING           3
#define TRUNCATE_EXISTING       5

#define INVALID_HANDLE_VALUE    -1

#import "kernel32.dll"
   int CreateFileW(string Filename, uint AccessMode, int ShareMode, int PassAsZero, int CreationMode, int FlagsAndAttributes, int AlsoPassAsZero);
   int WriteFile(int FileHandle, uchar & Buffer[], int BufferLength, int & BytesWritten[], int PassAsZero);
   int CloseHandle(int FileHandle);
#import

bool WriteToFile(int handle, string data) {
   int bytes[1]  = {0};
   int sz               = StringLen(data);
   uchar write_bf[];
   StringToCharArray(data, write_bf);
   WriteFile(handle, write_bf, sz, bytes, 0);
      // Return true if the number of bytes written matches the expected number 
   return (bytes[0] == sz);   
}

void OnStart() {
  string filename = "C:/Users/sprea/Test/TestWinFiles.txt";
  int hdl = CreateFileW(filename, GENERIC_WRITE, WIN32_FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
  if (hdl == INVALID_HANDLE_VALUE) {
    Print("Cannot create a valid handle");
    return;
  }
  
  int test_number = 57;                         //MODIFICATION: THESE TWO LINES!
  printf("My test number is %i", test_number);
  
  WriteToFile(hdl, "Hallo World!");
  CloseHandle(hdl);
}

I just insert a printf statement.

Attaching this script to the Chart, in the Terminal Expert tab I obtain this result:

JS      0       07:10:01.654    PrintFormatAndWinfile (EURUSD,H1)       My test number is 57
IJ      2       07:10:02.029    PrintFormatAndWinfile (EURUSD,H1)       Access violation at 0x00007FFA37ECE3D7 write to 0x000002B600000000
JE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE320 48895C2410        mov        [rsp+0x10], rbx
LJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE325 4889742418        mov        [rsp+0x18], rsi
FG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE32A 4C894C2420        mov        [rsp+0x20], r9
JI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE32F 57                push       rdi
PP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE330 4883EC60          sub        rsp, 0x60
IQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE334 498BD9            mov        rbx, r9
QQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE337 4C8BDA            mov        r11, rdx
RN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33A 488BF9            mov        rdi, rcx
FP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33D 33C0              xor        eax, eax
NN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33F 4889442450        mov        [rsp+0x50], rax
OQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE344 4889442458        mov        [rsp+0x58], rax
HP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE349 4533D2            xor        r10d, r10d
GM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE34C 4D85C9            test       r9, r9
JP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE34F 7403              jz         0x7ffa37ece354
OR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
OI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE351 458911            mov        [r9], r10d
FK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE354 83F9F4            cmp        ecx, 0xf4
CN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE357 0F831F010000      jae        dword 0x7ffa37ece47c
FE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE35D 488BB42490000000  mov        rsi, [rsp+0x90]
ND      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE365 4C89542440        mov        [rsp+0x40], r10
QD      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE36A 488BCF            mov        rcx, rdi
DI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE36D 4885F6            test       rsi, rsi
PS      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE370 7565              jnz        0x7ffa37ece3d7
QO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
FJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE372 4C89542438        mov        [rsp+0x38], r10
NH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE377 4489442430        mov        [rsp+0x30], r8d
CJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE37C 4C895C2428        mov        [rsp+0x28], r11
IJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE381 488D442450        lea        rax, [rsp+0x50]
ED      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE386 4889442420        mov        [rsp+0x20], rax
QJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE38B 4533C9            xor        r9d, r9d
OJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE38E 4533C0            xor        r8d, r8d
LF      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE391 33D2              xor        edx, edx
JE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE393 48FF15AEA31700    call       qword near [rip+0x17a3ae]  ; UnhandledExceptionFilter (kernelbase.dll)
GN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE39A 0F1F440000        nop        [rax+rax+0x0]
KQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE39F 8BC8              mov        ecx, eax
DO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3A1 3D03010000        cmp        eax, 0x103
MQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3A6 0F846E080700      jz         dword 0x7ffa37f3ec1a
IR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
RG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3AC 85C9              test       ecx, ecx
CI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3AE 0F88B5000000      js         dword 0x7ffa37ece469
NG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B4 4885DB            test       rbx, rbx
MJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B7 7406              jz         0x7ffa37ece3bf
IH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
JD      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B9 8B442458          mov        eax, [rsp+0x58]
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3BD 8903              mov        [rbx], eax
OE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3BF B801000000        mov        eax, 0x1
JK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3C4 488B5C2478        mov        rbx, [rsp+0x78]
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3C9 488BB42480000000  mov        rsi, [rsp+0x80]
JI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D1 4883C460          add        rsp, 0x60
ME      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D5 5F                pop        rdi
JH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D6 C3                ret        
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
RM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)          crash -->  00007FFA37ECE3D7 48C70603010000    mov        qword [rsi], 0x103
QO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3DE 8B4610            mov        eax, [rsi+0x10]
RN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E1 89442470          mov        [rsp+0x70], eax
FP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E5 8B4614            mov        eax, [rsi+0x14]
MN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E8 89442474          mov        [rsp+0x74], eax
QN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3EC 488B5618          mov        rdx, [rsi+0x18]
LS      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3F0 F6C201            test       dl, 0x1
KR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
JJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       00: 0x00007FFA37ECE3D7
IO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       01: 0x000002B62A490010
IF      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       02: 0x00007FFA0000000D
OM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       

What is it wrong with my code? Why printf is changing the behavior of the script in such a dramatic way? Why do I get memory crash? Is it something wrong with printf and WIN32 API commands? is it perhaps a small bug?

I would appreciate to be able to use printf in libraries containing Win32 API imports.

Thank you so much in advance.

 

Уважаемая служба поддержки, Я использую сборку 2650 на Windows10, установленном на 64-битной (x64) Intel. Это странная вещь, которую я заметил. Создаю скрипт для записи файлов через Win32 API:

#define GENERIC_READ            0x80000000
#define GENERIC_WRITE           0x40000000

#define WIN32_FILE_SHARE_READ   1
#define WIN32_FILE_SHARE_WRITE  2

#define CREATE_NEW              1
#define CREATE_ALWAYS           2
#define OPEN_ALWAYS             4
#define OPEN_EXISTING           3
#define TRUNCATE_EXISTING       5

#define INVALID_HANDLE_VALUE    -1

#import "kernel32.dll"
   int CreateFileW(string Filename, uint AccessMode, int ShareMode, int PassAsZero, int CreationMode, int FlagsAndAttributes, int AlsoPassAsZero);
   int WriteFile(int FileHandle, uchar & Buffer[], int BufferLength, int & BytesWritten[], int PassAsZero);
   int CloseHandle(int FileHandle);
#import

bool WriteToFile(int handle, string data) {
   int bytes[1]  = {0};
   int sz               = StringLen(data);
   uchar write_bf[];
   StringToCharArray(data, write_bf);
   WriteFile(handle, write_bf, sz, bytes, 0);
      // Return true if the number of bytes written matches the expected number 
   return (bytes[0] == sz);   
}

void OnStart() {
  string filename = "C:/Users/sprea/Test/TestWinFiles.txt";
  int hdl = CreateFileW(filename, GENERIC_WRITE, WIN32_FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
  if (hdl == INVALID_HANDLE_VALUE) {
    Print("Cannot create a valid handle");
    return;
  }
  
  WriteToFile(hdl, "Hallo World!");
  CloseHandle(hdl);
}

Скрипт работает отлично, и в указанном каталоге я нахожу файл «TestWinFiles.txt», который содержит контент «Hallo world!». Сейчас делаю НЕМНОГО МОДИФИКАЦИЮ:

#define GENERIC_READ            0x80000000
#define GENERIC_WRITE           0x40000000

#define WIN32_FILE_SHARE_READ   1
#define WIN32_FILE_SHARE_WRITE  2

#define CREATE_NEW              1
#define CREATE_ALWAYS           2
#define OPEN_ALWAYS             4
#define OPEN_EXISTING           3
#define TRUNCATE_EXISTING       5

#define INVALID_HANDLE_VALUE    -1

#import "kernel32.dll"
   int CreateFileW(string Filename, uint AccessMode, int ShareMode, int PassAsZero, int CreationMode, int FlagsAndAttributes, int AlsoPassAsZero);
   int WriteFile(int FileHandle, uchar & Buffer[], int BufferLength, int & BytesWritten[], int PassAsZero);
   int CloseHandle(int FileHandle);
#import

bool WriteToFile(int handle, string data) {
   int bytes[1]  = {0};
   int sz               = StringLen(data);
   uchar write_bf[];
   StringToCharArray(data, write_bf);
   WriteFile(handle, write_bf, sz, bytes, 0);
      // Return true if the number of bytes written matches the expected number 
   return (bytes[0] == sz);   
}

void OnStart() {
  string filename = "C:/Users/sprea/Test/TestWinFiles.txt";
  int hdl = CreateFileW(filename, GENERIC_WRITE, WIN32_FILE_SHARE_READ, 0, CREATE_ALWAYS, 0, 0);
  if (hdl == INVALID_HANDLE_VALUE) {
    Print("Cannot create a valid handle");
    return;
  }
  
  int test_number = 57;
  printf("My test number is %i", test_number);
  
  WriteToFile(hdl, "Hallo World!");
  CloseHandle(hdl);
}

Я просто вставляю инструкцию printf. Прикрепив этот скрипт к графику, во вкладке Terminal Expert я получаю такой результат:

JS      0       07:10:01.654    PrintFormatAndWinfile (EURUSD,H1)       My test number is 57
IJ      2       07:10:02.029    PrintFormatAndWinfile (EURUSD,H1)       Access violation at 0x00007FFA37ECE3D7 write to 0x000002B600000000
JE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE320 48895C2410        mov        [rsp+0x10], rbx
LJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE325 4889742418        mov        [rsp+0x18], rsi
FG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE32A 4C894C2420        mov        [rsp+0x20], r9
JI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE32F 57                push       rdi
PP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE330 4883EC60          sub        rsp, 0x60
IQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE334 498BD9            mov        rbx, r9
QQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE337 4C8BDA            mov        r11, rdx
RN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33A 488BF9            mov        rdi, rcx
FP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33D 33C0              xor        eax, eax
NN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE33F 4889442450        mov        [rsp+0x50], rax
OQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE344 4889442458        mov        [rsp+0x58], rax
HP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE349 4533D2            xor        r10d, r10d
GM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE34C 4D85C9            test       r9, r9
JP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE34F 7403              jz         0x7ffa37ece354
OR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
OI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE351 458911            mov        [r9], r10d
FK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE354 83F9F4            cmp        ecx, 0xf4
CN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE357 0F831F010000      jae        dword 0x7ffa37ece47c
FE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE35D 488BB42490000000  mov        rsi, [rsp+0x90]
ND      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE365 4C89542440        mov        [rsp+0x40], r10
QD      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE36A 488BCF            mov        rcx, rdi
DI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE36D 4885F6            test       rsi, rsi
PS      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE370 7565              jnz        0x7ffa37ece3d7
QO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
FJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE372 4C89542438        mov        [rsp+0x38], r10
NH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE377 4489442430        mov        [rsp+0x30], r8d
CJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE37C 4C895C2428        mov        [rsp+0x28], r11
IJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE381 488D442450        lea        rax, [rsp+0x50]
ED      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE386 4889442420        mov        [rsp+0x20], rax
QJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE38B 4533C9            xor        r9d, r9d
OJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE38E 4533C0            xor        r8d, r8d
LF      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE391 33D2              xor        edx, edx
JE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE393 48FF15AEA31700    call       qword near [rip+0x17a3ae]  ; UnhandledExceptionFilter (kernelbase.dll)
GN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE39A 0F1F440000        nop        [rax+rax+0x0]
KQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE39F 8BC8              mov        ecx, eax
DO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3A1 3D03010000        cmp        eax, 0x103
MQ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3A6 0F846E080700      jz         dword 0x7ffa37f3ec1a
IR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
RG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3AC 85C9              test       ecx, ecx
CI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3AE 0F88B5000000      js         dword 0x7ffa37ece469
NG      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B4 4885DB            test       rbx, rbx
MJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B7 7406              jz         0x7ffa37ece3bf
IH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
JD      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3B9 8B442458          mov        eax, [rsp+0x58]
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3BD 8903              mov        [rbx], eax
OE      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3BF B801000000        mov        eax, 0x1
JK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3C4 488B5C2478        mov        rbx, [rsp+0x78]
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3C9 488BB42480000000  mov        rsi, [rsp+0x80]
JI      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D1 4883C460          add        rsp, 0x60
ME      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D5 5F                pop        rdi
JH      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3D6 C3                ret        
KK      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
RM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)          crash -->  00007FFA37ECE3D7 48C70603010000    mov        qword [rsi], 0x103
QO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3DE 8B4610            mov        eax, [rsi+0x10]
RN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E1 89442470          mov        [rsp+0x70], eax
FP      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E5 8B4614            mov        eax, [rsi+0x14]
MN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3E8 89442474          mov        [rsp+0x74], eax
QN      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3EC 488B5618          mov        rdx, [rsi+0x18]
LS      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)                     00007FFA37ECE3F0 F6C201            test       dl, 0x1
KR      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       
JJ      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       00: 0x00007FFA37ECE3D7
IO      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       01: 0x000002B62A490010
IF      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       02: 0x00007FFA0000000D
OM      2       07:10:02.031    PrintFormatAndWinfile (EURUSD,H1)       

Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.

 
Fab:

Уважаемая служба поддержки, Я использую сборку 2650 на Windows10, установленном на 64-битной (x64) Intel. Это странная вещь, которую я заметил. Создаю скрипт для записи файлов через Win32 API:

Скрипт работает отлично, и в указанном каталоге я нахожу файл «TestWinFiles.txt», который содержит контент «Hallo world!». Сейчас делаю НЕМНОГО МОДИФИКАЦИЮ:

Я просто вставляю инструкцию printf. Прикрепив этот скрипт к графику, во вкладке Terminal Expert я получаю такой результат:

Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.

Этот странный краш воспроизводится на b2560. Интересно, что после краша созданный файл не удалить - используется другим процессом. Хорошо бы и это поправить.

Причина обращения: