<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: DelAllLabels приводит к &quot;General Protection Fault&quot;]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме DelAllLabels приводит к &quot;General Protection Fault&quot; форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sat, 25 Apr 2026 21:18:59 +0300</pubDate>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message71175/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_JaAEKgK4" href="/user/15985/" bx-tooltip-user-id="15985">Ziveleos</a>, добрый день!<br /><br />Описанная в данном инциденте проблема носит синхронизационный характер и может проявляться когда Lua-скрипт очищает метки с графика а терминал в этот момент пытается их отрисовать, например, после смены инструмента на графике. Данная проблема будет устранена в одной из очередных версий программы.<br />Приносим извинения за причиненные неудобства. <br />
			<i>03.08.2023 07:28:34, Andrey Golik.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message71175/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message71175/topic8159/</guid>
			<pubDate>Thu, 03 Aug 2023 07:28:34 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message70635/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_jkBSrIXf" href="/user/15985/" bx-tooltip-user-id="15985">Ziveleos</a>, здравствуйте.<br /><br />Ваше обращение получено, проблема изучается. Постараемся в ближайшее время дать ответ. <br />
			<i>19.07.2023 06:02:56, Anzhelika Belokur.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message70635/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message70635/topic8159/</guid>
			<pubDate>Wed, 19 Jul 2023 06:02:56 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message70633/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Придумал!<br />Вот что ноосфера животворящая делает!<br /><br />
====code====
<pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if lastLbl then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;repeat
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(10)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_Lbl = GetLabelParams(iStr, lastLbl) -- Костыль. Ждем пока появится последняя метка.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;until t_Lbl
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastLbl = 0

&#60;...&#62;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lbl_ID = AddLabel(iStr, arr)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastLbl = lastLbl + 1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end


</pre>
=============
Но лучше, если бы не приходилось изобретать &quot;костыли&quot;.<br />Разработчики! Поправьте на досуге. <br />
			<i>18.07.2023 22:15:18, Ziveleos.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message70633/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message70633/topic8159/</guid>
			<pubDate>Tue, 18 Jul 2023 22:15:18 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message70632/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Стрелки: <noindex><a href="https://disk.yandex.ru/d/0U5Huz5aDoM6Fw" target="_blank" rel="nofollow">Arrows.zip</a></noindex> <br />
			<i>18.07.2023 20:46:36, Ziveleos.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message70632/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message70632/topic8159/</guid>
			<pubDate>Tue, 18 Jul 2023 20:46:36 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message70629/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Значки почему-то не выкладываются. <br />
			<i>18.07.2023 19:25:13, Ziveleos.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message70629/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message70629/topic8159/</guid>
			<pubDate>Tue, 18 Jul 2023 19:25:13 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>DelAllLabels приводит к &quot;General Protection Fault&quot;</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message70628/topic8159/">DelAllLabels приводит к &quot;General Protection Fault&quot;</a></b> <i>Вызов DelAllLabels при смене тикера приводит к падению QUIK с ошибкой &quot;General Protection Fault&quot;</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			&nbsp; &nbsp;Тестовый скрипт:<br /><table class="forum-spoiler"><thead onclick="if (this.nextSibling.style.display=='none') { this.nextSibling.style.display=''; BX.addClass(this, 'forum-spoiler-head-open'); } else { this.nextSibling.style.display='none'; BX.removeClass(this, 'forum-spoiler-head-open'); } BX.onCustomEvent('BX.Forum.Spoiler:toggle', [{node: this}]); event.stopPropagation();"><tr><th><div>Скрытый текст</div></th></tr></thead><tbody class="forum-spoiler" style="display:none;"><tr><td>
====code====
<pre>function OnInit() 
&nbsp;&nbsp;is_run = true
&nbsp;&nbsp;path = (getScriptPath() .. "&#92;&#92;")
&nbsp;&nbsp;Arrow_B = (path .. "Arrow_B.bmp") -- Стрелки
&nbsp;&nbsp;Arrow_S = (path .. "Arrow_S.bmp")
&nbsp;&nbsp;iStr = "Rv-1" -- Идентификатор графика.
end

function OnStop()
&nbsp;&nbsp;DelAllLabels(iStr)
&nbsp;&nbsp;is_run =&nbsp;&nbsp;false
&nbsp;&nbsp;return 3000
end 

function main()
&nbsp;&nbsp;while is_run do
&nbsp;&nbsp;&nbsp;&nbsp;local cdls = -1
&nbsp;&nbsp;&nbsp;&nbsp;repeat
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local cdls0 = cdls
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sleep(10)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cdls = getNumCandles(iStr)
&nbsp;&nbsp;&nbsp;&nbsp;until cdls &#62; 0 and cdls == cdls0&nbsp;&nbsp;-- Ждем, пока загрузятся все свечи.
&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;local tc, nc, leg = getCandlesByIndex (iStr, 0, math.floor(cdls/2), 3)
&nbsp;&nbsp;&nbsp;&nbsp;if leg ~= old_leg and leg ~= "GZU3 &#91;Price&#93;" and leg ~= "" then -- Если на графике сменился инструмент. Один оставляем пустым.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;old_leg = leg
LinePrnt("&#92;n &#92;n", leg)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--sleep(500) -- Костыль. Чем больше меток, которые нужно убить, тем больше должна быть задержка.
---&#91;&#91;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if lbl_ID then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for i=1, 700 do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t_Lbl = GetLabelParams(iStr, i) -- После смены инструмента идентификаторы меток тоже изменяются.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if t_Lbl then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last = i
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
--&#93;&#93;
LinePrnt(cdls, lbl_ID, last)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local image;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local aligt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DelAllLabels(iStr) -- Если отключить, то quik просто зависает, без "General Protection Fault".
local start = os.clock()
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for i=1, 100 do -- Кол-во меток.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local date = string.format("2023%02d%02d", math.random(3, 6), math.random(1, 30)) -- Диапазон месяцев и дней. 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local time = string.format("%02d%02d00", math.random(10, 22), math.random(1, 59)) -- Диапазон часов и минут.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local price = tc&#91;1&#93;.close + math.random(-100, 100)*tc&#91;1&#93;.close/1000 -- Диапазон цен.
--LinePrnt(date, time, price)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local hint = tostring(date.."&#92;n"..time.."&#92;n"..price)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local txt = tostring("Lbl "..i)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if math.floor(i/2) == i/2 then 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;image = Arrow_B 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;aligt = "BOTTOM"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;image = Arrow_S 
&nbsp;&nbsp;&nbsp;&nb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nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DATE = tonumber(date), --&nbsp;&nbsp;&nbsp;&nbsp;Работает даже если STRING, зачем DOUBLE - не понятно...
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TIME = tonumber(time),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;YVALUE&nbsp;&nbsp;= price,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HINT = hint
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lbl_ID = AddLabel(iStr, arr)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end
LinePrnt(os.clock() - start, lbl_ID)
&nbsp;&nbsp;&nbsp;&nbsp;end
&nbsp;&nbsp;sleep(30)
&nbsp;&nbsp;end
end

-------------------------------------------------------

function LinePrnt(...)
&nbsp;&nbsp;local lin = ""
&nbsp;&nbsp;for i, v in ipairs {...} do
&nbsp;&nbsp;&nbsp;&nbsp;lin = (lin ..(tostring(v)).." ")
&nbsp;&nbsp;end
&nbsp;&nbsp;PrintDbgStr(lin)
end


</pre>
=============
</td></tr></tbody></table><br />По-видимому, если во время восстановления меток после смены инструмента (график подключен к каналу), вызвать DelAllLabels, QUIK не выдерживает такой &quot;шизофрении&quot;, и падает с криком &quot;Internal exception happened&quot;.<br /><br />Помогает только задержка, позволяющая QUIK восстановить все метки.<br />Как поймать момент окончания прорисовки, мне придумать так и не удалось, может быть разработчики что-нибудь подскажут?<br />Версия терминала - 10, но и на 7-ой всё то же самое. <br />
			<img src="https://forum.quik.ru/bitrix/components/bitrix/forum.interface/show_file.php?fid=10932&" width="15" height="9" /><br /><img src="https://forum.quik.ru/bitrix/components/bitrix/forum.interface/show_file.php?fid=10933&" width="15" height="9" /><br /><i>18.07.2023 19:18:44, Ziveleos.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message70628/topic8159/</link>
			<guid>http://forum.quik.ru/messages/forum10/message70628/topic8159/</guid>
			<pubDate>Tue, 18 Jul 2023 19:18:44 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
