Recent

Author Topic: search and replace all fails after "no"  (Read 1287 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: search and replace all fails after "no"
« Reply #15 on: October 24, 2022, 06:27:13 pm »
"--sync" goes to the gtk/gdk toolkit (the libraries that come with the OS). It switches them to run synchronous instead of asynchronous.
(see the issue report I linked earlier => the OS dumped a message in which it points out the "--sync")

"significantly reduce"
Actually, my current guess is, that it is a race condition (gtk/gdk has several threads).
E.g. when I run lazarus normally (without --sync) it does not always happen. Sometimes it only happens on the 2nd or 3rd "no". So it happens with a certain likelihood. (as race conditions do)
Running synchronously may fix the race entirely, but it could also just reduce its likelihood of going wrong.

Mind, that is "my guess" only. I don't have enough background on gtk/gdk.

Well, then of course, each Linux distro, and each version thereof (or rather each version(s) of gtk/gdk) may react different.
On some it may always work flawlessly. On others it may break, but with different likelihood....

lazer

  • Full Member
  • ***
  • Posts: 211
Re: search and replace all fails after "no"
« Reply #16 on: October 24, 2022, 09:13:07 pm »
Thanks for the explanation, that does seem to make it work ! 

Good catch. That makes life a bit easier, at least.

lazer

  • Full Member
  • ***
  • Posts: 211
Re: search and replace all fails after "no"
« Reply #17 on: October 27, 2022, 03:53:45 pm »
More anomalies , now running with --sync

cntl-F3 to set up S/R , click YesToAll .

Does a single replace.

Subsequent F3 shows a reduced dlg with just the buttons, this time YesToAll does the job.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: search and replace all fails after "no"
« Reply #18 on: October 27, 2022, 04:57:45 pm »
I can not reproduce this.

In fact, I checked a bit more on the "no" issue. Testing without "--sync"

I could only reproduce it on:  Fedora 33  (64 bit) 

But it did not happen for me on any of (yes they are older)
Debian 11  (32 bit)
Mate 20.1    (64 bit)
Fedora 28  (64 bit)
Ubuntu 20  (64 bit)

So maybe (maybe not) there as a bad gtk version on my Fedora 33.

In any case that needs to be looked at by someone with more gtk background than I have.




I run those tests, because I had started to wonder how such an issue could go by and no one (before you) would notice.

I can't tell what the likelihood is for it being a Lazarus issue, or a broken gtk library (from a Linux distro)... That someone else will have to establish.
« Last Edit: October 27, 2022, 05:01:52 pm by Martin_fr »

lazer

  • Full Member
  • ***
  • Posts: 211
Re: search and replace all fails after "no"
« Reply #19 on: October 27, 2022, 06:10:49 pm »
Cool,

just for the record I'm running Fed35, which is still supported but there is a new stable F36.
Code: Pascal  [Select][+][-]
  1. Installed Packages
  2. Name         : gtk2
  3. Version      : 2.24.33
  4. Release      : 7.fc35
  5. Architecture : x86_64
  6.  

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: search and replace all fails after "no"
« Reply #20 on: October 27, 2022, 06:32:03 pm »
Oh, one think I forgot. The failing system is also the only system on which I use AnchorDocking.

Do you use AnchorDocking?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: search and replace all fails after "no"
« Reply #21 on: October 27, 2022, 06:52:21 pm »
Yea, just build without AnchorDocking, and it works.  (Or at least it did not crash for a dozen "no")

lazer

  • Full Member
  • ***
  • Posts: 211
Re: search and replace all fails after "no"
« Reply #22 on: October 27, 2022, 07:04:48 pm »
I've no idea what that is , how do I build without it ?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 8619
  • Debugger - SynEdit - and more
    • wiki
Re: search and replace all fails after "no"
« Reply #23 on: October 27, 2022, 07:35:13 pm »
I've no idea what that is , how do I build without it ?
AnchorDocking allows you to have a "one windows Lazarus". You can "attach" (dock) all the floating windows.
https://wiki.lazarus.freepascal.org/Anchor_Docking#Installation

It is not installed by default.


But my tests may be flawed, for if it is a race condition (or dangling ptr / or both), any change (even entirely unrelated) can affect the outcome.

E.g. with Anchordocking I have for less Windows on the screen (in my case just 2, instead of half a dozen or more).

 

TinyPortal © 2005-2018