Крайне не рекомендую компилировать важные коды под b2656. Там серьезные баги в Release-варианте. Пока без воспроизведения.
Что-то со строками. StringReplace и т.д. Вплоть до краша.
В string образуются нулевые символы.
Да, по ходу сейчас в посудную лавку запустили какого-то слона.
Я нарвался на моргание всего терминала с частотой где-то 10 Гц. Словно терминал перегружался десять раз в секунду. Сначала подумал, что видюха накрылась. Но эта ситуация стабильно возникала при unlimited барах в крайнем левом положении чарта при отладке.
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);
}
voidOnStart() {
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);
}
voidOnStart() {
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:
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.
Уважаемая служба поддержки, Я использую сборку 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);
}
voidOnStart() {
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);
}
voidOnStart() {
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 я получаю такой результат:
Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.
Уважаемая служба поддержки, Я использую сборку 2650 на Windows10, установленном на 64-битной (x64) Intel. Это странная вещь, которую я заметил. Создаю скрипт для записи файлов через Win32 API:
Скрипт работает отлично, и в указанном каталоге я нахожу файл «TestWinFiles.txt», который содержит контент «Hallo world!». Сейчас делаю НЕМНОГО МОДИФИКАЦИЮ:
Я просто вставляю инструкцию printf. Прикрепив этот скрипт к графику, во вкладке Terminal Expert я получаю такой результат:
Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.
Этот странный краш воспроизводится на b2560. Интересно, что после краша созданный файл не удалить - используется другим процессом. Хорошо бы и это поправить.
Пожалуйста, вы можете проверить эту ошибку? 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.
Крайне не рекомендую компилировать важные коды под b2656. Там серьезные баги в Release-варианте. Пока без воспроизведения.
Что-то со строками. StringReplace и т.д. Вплоть до краша.
В string образуются нулевые символы.
Да, у меня тоже краши в тестере и неадекватное поведение.
Крайне не рекомендую компилировать важные коды под b2656. Там серьезные баги в Release-варианте. Пока без воспроизведения.
Что-то со строками. StringReplace и т.д. Вплоть до краша.
В string образуются нулевые символы.
Что-то со строками. StringReplace и т.д. Вплоть до краша.
В string образуются нулевые символы.
Убил несколько часов на локализацию и воспроизведение.
Результат.
Этот баг приводит к таким последствиям.
Большая просьба исправить в ближайшем билде. Пока приходится пользоваться Debug-вариантом. Там баг не проявляется.
Ошибка в StringReplace исправлена в бете 2660.
Обновитесь, пожалуйста.
Ошибка в 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:
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:
I just insert a printf statement.
Attaching this script to the Chart, in the Terminal Expert tab I obtain this result:
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:
Скрипт работает отлично, и в указанном каталоге я нахожу файл «TestWinFiles.txt», который содержит контент «Hallo world!». Сейчас делаю НЕМНОГО МОДИФИКАЦИЮ:
Я просто вставляю инструкцию printf. Прикрепив этот скрипт к графику, во вкладке Terminal Expert я получаю такой результат:
Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.
Уважаемая служба поддержки, Я использую сборку 2650 на Windows10, установленном на 64-битной (x64) Intel. Это странная вещь, которую я заметил. Создаю скрипт для записи файлов через Win32 API:
Скрипт работает отлично, и в указанном каталоге я нахожу файл «TestWinFiles.txt», который содержит контент «Hallo world!». Сейчас делаю НЕМНОГО МОДИФИКАЦИЮ:
Я просто вставляю инструкцию printf. Прикрепив этот скрипт к графику, во вкладке Terminal Expert я получаю такой результат:
Что не так с моим кодом? Почему printf так кардинально меняет поведение скрипта? Почему у меня вылетает память? Что-то не так с командами printf и WIN32 API? это, возможно, небольшая ошибка? Я был бы признателен за возможность использовать printf в библиотеках, содержащих импорт Win32 API. Огромное спасибо заранее.
Этот странный краш воспроизводится на b2560. Интересно, что после краша созданный файл не удалить - используется другим процессом. Хорошо бы и это поправить.