Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZiayL-00018H-2S for pgadmin-hackers@arkaria.postgresql.org; Sun, 04 Oct 2015 04:32:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZiayJ-0003Pa-UP for pgadmin-hackers@arkaria.postgresql.org; Sun, 04 Oct 2015 04:32:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZiayI-0003PR-DE for pgadmin-hackers@postgresql.org; Sun, 04 Oct 2015 04:32:26 +0000 Received: from smtp46.i.mail.ru ([94.100.177.106]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1Ziay7-0003XC-Bl for pgadmin-hackers@postgresql.org; Sun, 04 Oct 2015 04:32:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Subject:CC:To:Message-ID:Reply-To:From:Date; bh=JsSxw/kUbmca/roiyWNg0F1PUxMpsPFSuoFRxmSIbmI=; b=tALqnqbryMbns3SYQNpSYXCoq+7fwsDoHmcfQw+Hom1BcbmakMTGy15Qn+0n7MtI8EDJNj1j/Swpn43LmDpmD1dEHWtIZy63po6cFNPfg7E7KCpbpvhM5X+sx0aiEORicF7L4+g8B9gI6+WbcCScHMSbH5JouTud8hWGKdk12uY=; Received: from [5.165.249.156] (port=49271 helo=HomePC) by smtp46.i.mail.ru with esmtpa (envelope-from ) id 1Ziay4-0004yT-Vb; Sun, 04 Oct 2015 07:32:13 +0300 Date: Sun, 4 Oct 2015 07:32:10 +0300 From: "J.F. Oster" Reply-To: "J.F. Oster" X-Priority: 3 (Normal) Message-ID: <1435296136.20151004073210@mail.ru> To: Nikolai Zhubr CC: pgadmin-hackers Subject: Re: Repaint lockup in ctlSQLBox::OnPositionStc on windows (Was: SQL-panel causes 100% CPU and lockup on windows) In-Reply-To: <5610587D.5020605@yandex.ru> 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> <5610587D.5020605@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mras: Ok X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org Hello Nikolai, Appreciate your research! I suggest you to send a *.patch (git diff) attachmeht to the list for the team members and others interested to test it in their environments. Sunday, October 4, 2015, 1:36:45 AM, you wrote: NZ> Hi all, NZ> ok, it is broken since this commit: NZ> http://git.postgresql.org/gitweb/?p=pgadmin3.git;a=patch;h=b0ecbbca7f77c0f07cff67bba3d2bca28954a1e2 NZ> - EVT_STC_UPDATEUI(-1, ctlSQLBox::OnPositionStc) NZ> + EVT_STC_PAINTED(-1, ctlSQLBox::OnPositionStc) NZ> It appears that in previous version of scintilla, there existed a NZ> SCN_POSCHANGED event, which then got obsolete and replaced by NZ> SCN_UPDATEUI, and probably that is why the name 'OnPositionStc' was NZ> chosen for the handler. So linking OnPositionStc() to STC_UPDATEUI was NZ> correct and in accordance with scintilla's manual. NZ> However the change from EVT_STC_UPDATEUI to EVT_STC_PAINTED was NZ> incorrect. These events are not quite equivalent. EVT_STC_PAINTED has a NZ> somewhat different purpose. NZ> I've checked, reverting back to EVT_STC_UPDATEUI indeed fixed CPU load NZ> and lockup issues on windows. See also NZ> http://www.scintilla.org/ScintillaDoc.html#SCN_PAINTED NZ> http://www.scintilla.org/ScintillaDoc.html#SCN_UPDATEUI NZ> http://www.scintilla.org/ScintillaHistory.html NZ> http://web.mit.edu/jhawk/mnt/spo/sandbox/punya/anjuta-1.2.3/doc/ScintillaDoc.html NZ> (-- this is some older document with a more detailed explanation of NZ> SCN_UPDATEUI) NZ> Some relevant excerptions: NZ> "SCN_PAINTED: is to update some _other_ widgets based on a change." NZ> "SCN_POSCHANGED: notification is deprecated as it was causing confusion. NZ> Use SCN_UPDATEUI instead." NZ> "SCN_UPDATEUI, SCN_CHECKBRACE: NZ> Either the text or styling [...] common use is to check whether the NZ> caret is next to a brace and set highlights on this brace and its NZ> corresponding matching brace." NZ> So for me this all sounds clear sufficiently. I'll stick with NZ> EVT_STC_UPDATEUI and I can rebuild it myself if I have to. Whether fix NZ> git respectively or not is up to maintainers now. NZ> Thank you, NZ> Nikolai NZ> 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 >> >> .... -- Best regards, J.F. -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers