Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiUnf-0004D0-Db for pgadmin-support@arkaria.postgresql.org; Sat, 03 Oct 2015 21:57:03 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZiUne-00063J-D4 for pgadmin-support@arkaria.postgresql.org; Sat, 03 Oct 2015 21:57:02 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZiUnG-0005b0-23 for pgadmin-support@postgresql.org; Sat, 03 Oct 2015 21:56:38 +0000 Received: from forward16j.cmail.yandex.net ([2a02:6b8:0:1630::f3]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZiUn7-0002q2-CZ for pgadmin-support@postgresql.org; Sat, 03 Oct 2015 21:56:36 +0000 Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward16j.cmail.yandex.net (Yandex) with ESMTP id F16162100A for ; Sun, 4 Oct 2015 00:56:24 +0300 (MSK) Received: from smtp13.mail.yandex.net (localhost [127.0.0.1]) by smtp13.mail.yandex.net (Yandex) with ESMTP id C359CE4011E for ; Sun, 4 Oct 2015 00:56:24 +0300 (MSK) Received: by smtp13.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id OLcIpl83tX-uOb4RiZc; Sun, 4 Oct 2015 00:56:24 +0300 (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1443909384; bh=ki0JZa5rJk9G9LngdYbEN+bRz+87MohIDVhRBE8239E=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=MLBtsbMprnqXUAB4o6tDyc2nn+HB7ScsDhLl1or/PTGRrB8RXdkIYfeupAHEl6OWZ yNxeeHwohzryDb2JGgTurq1mmqn8U78hqFY1KtB6oWqHWfyhmQBkFRoZpAo2hL1vlp Br8KGTdXY0eVL9VEo0gnplEaI9oPUbhxf4jcJdUk= Authentication-Results: smtp13.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: US Message-ID: <561052DA.304@yandex.ru> Date: Sun, 04 Oct 2015 01:12:42 +0300 From: Nikolai Zhubr User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 MIME-Version: 1.0 To: pgadmin-support@postgresql.org Subject: Re: Repaint lockup in ctlSQLBox::OnPositionStc on windows (Was: SQL-panel causes 100% CPU and lockup on windows) References: <5606F2C8.9010001@yandex.ru> <56070F5A.3070102@yandex.ru> <1674144739.20150927082019@mail.ru> <5607CF32.7030707@yandex.ru> <5609BC61.8030503@yandex.ru> <560ADB34.6050700@yandex.ru> <561024FB.9000805@yandex.ru> In-Reply-To: <561024FB.9000805@yandex.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-support Precedence: bulk Sender: pgadmin-support-owner@postgresql.org Hi all, ok, it is broken since this commit: http://git.postgresql.org/gitweb/?p=pgadmin3.git;a=patch;h=b0ecbbca7f77c0f07cff67bba3d2bca28954a1e2 - EVT_STC_UPDATEUI(-1, ctlSQLBox::OnPositionStc) + EVT_STC_PAINTED(-1, ctlSQLBox::OnPositionStc) It appears that in previous version of scintilla, there existed a SCN_POSCHANGED event, which then got obsolete and replaced by SCN_UPDATEUI, and probably that is why the name 'OnPositionStc' was chosen for the handler. So linking OnPositionStc() to STC_UPDATEUI was correct and in accordance with scintilla's manual. However the change from EVT_STC_UPDATEUI to EVT_STC_PAINTED was incorrect. These events are not quite equivalent. EVT_STC_PAINTED has a somewhat different purpose. I've checked, reverting back to EVT_STC_UPDATEUI indeed fixed CPU load and lockup issues on windows. See also http://www.scintilla.org/ScintillaDoc.html#SCN_PAINTED http://www.scintilla.org/ScintillaDoc.html#SCN_UPDATEUI http://www.scintilla.org/ScintillaHistory.html http://web.mit.edu/jhawk/mnt/spo/sandbox/punya/anjuta-1.2.3/doc/ScintillaDoc.html (-- this is some older document with a more detailed explanation of SCN_UPDATEUI) Some relevant excerptions: "SCN_PAINTED: is to update some _other_ widgets based on a change." "SCN_POSCHANGED: notification is deprecated as it was causing confusion. Use SCN_UPDATEUI instead." "SCN_UPDATEUI, SCN_CHECKBRACE: Either the text or styling [...] common use is to check whether the caret is next to a brace and set highlights on this brace and its corresponding matching brace." So for me this all sounds clear sufficiently. I'll stick with EVT_STC_UPDATEUI and I can rebuild it myself if I have to. Whether fix git respectively or not is up to maintainers now. Thank you, Nikolai 03.10.2015 21:56, I wrote: > Hi all, > > Ok, I've verified that ctlSQLBox::OnPositionStc() is broken. > > If I comment the code for highlighting in it (that is, almost all of its > body), the problem goes away. > > I've found quite some problems observed with it and attempted to fix > previously, like e.g. the one from 2011: > --------------- > + // Ensure we don't recurse through any paint handlers > + Freeze(); > UpdateLineNumber(); > + Thaw(); > > // Clear all highlighting > --------------- > That was most probably only a partial fix, and it was subsequently > reverted. > > I'd like to also note that 'OnPositionStc' name is pretty much > misleading. If it was named 'OnPaintedStc' it would be more consistent > and more hinting where the problem is. I'm aware that renaming alone > don't usually fix bugs, but it might help humans better catch ones. > > Ok, anyway, I've got no real fix for now, but I'm going on. > > > Thank you, > Nikolai > > -- Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-support