issue-#202 drag & pick across BlackBox instances traps

issue-#202 drag & pick across BlackBox instances traps

Postby Josef Templ » Tue Sep 03, 2019 8:19 pm

A rather serious bug was reported to me. It causes a trap that sometimes crashes BlackBox. Seems to destroy the memory integrity of the system.

For the issue see https://redmine.blackboxframework.org/issues/202.

- Josef
User avatar
Josef Templ
 
Posts: 2001
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#202 drag & pick across BlackBox instances traps

Postby luowy » Wed Sep 04, 2019 12:40 am

this issue caused by illeagal memeory access, track to HostWindows.Directory.GetThisWindow,
the patch is simple(on windows):
Code: Select all
VAR mpid:INTEGER;
...
PROCEDURE (dir: Directory) GetThisWindow* (
   ..VAR wpid:INTEGER;
BEGIN
   ...
   wnd := WinApi.WindowFromPoint(pt); res:=WinApi.GetWindowThreadProcessId(wnd,wpid);
   IF (wnd # 0)&(wpid = mpid) THEN
   ...
END GetThisWindow;
...
PROCEDURE Init;
....
res:=WinApi.GetWindowThreadProcessId(main,mpid);
END;


luowy
luowy
 
Posts: 201
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#202 drag & pick across BlackBox instances traps

Postby Josef Templ » Thu Sep 05, 2019 7:33 pm

This does not work for me.

drag & pick is now disabled at all.

- Josef

P.S. I will be on vacation the next 2 weeks and only occasionally on the internet.
User avatar
Josef Templ
 
Posts: 2001
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#202 drag & pick across BlackBox instances traps

Postby luowy » Fri Sep 06, 2019 11:07 am

i test it ok:
1, drag&drop selected text to another bb instance window worked as before;
2,holding the alt key and drap the selected text on another instance bb window is forbidden, no trap window anymore
luowy
 
Posts: 201
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#202 drag & pick across BlackBox instances traps

Postby Robert » Fri Sep 06, 2019 11:15 am

Drag & pick (between instances) being not allowed seems better than having it crash.

I don't think that not being able to drag & pick between instances is a serious limitation.
User avatar
Robert
 
Posts: 987
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#202 drag & pick across BlackBox instances traps

Postby Josef Templ » Wed Sep 18, 2019 5:14 am

It has been reported to me that if the line in Init is appended to CreateMainWindows then it works.

- Josef
User avatar
Josef Templ
 
Posts: 2001
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#202 drag & pick across BlackBox instances traps

Postby Josef Templ » Sun Sep 22, 2019 6:54 pm

I have committed the fix to the issue branch.

For the changes see https://redmine.blackboxframework.org/projects/blackbox/repository/diff?utf8=%E2%9C%93&rev=e14d28a44018f9501d46bb35ec41120893bbd779&rev_to=9246b01682cfcf6521ffd655643cbd44565bf663.

The fix is as proposed by luowy except that mpid initialization is done in CreateMainWindows, not in Init.
@luowy: please check.

- Josef
User avatar
Josef Templ
 
Posts: 2001
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#202 drag & pick across BlackBox instances traps

Postby luowy » Mon Sep 23, 2019 4:44 am

ok! The change is more reasonable.
luowy
 
Posts: 201
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#202 drag & pick across BlackBox instances traps

Postby Josef Templ » Wed Sep 25, 2019 4:43 pm

There seems to be no problem with the fix.
So I would like to propose to continue with the voting.

- Josef
User avatar
Josef Templ
 
Posts: 2001
Joined: Tue Sep 17, 2013 6:50 am


Return to Resolved (Bugs)

Who is online

Users browsing this forum: No registered users and 0 guests

cron