gprolog icon indicating copy to clipboard operation
gprolog copied to clipboard

Problem processing repeated calls

Open jal-frezie opened this issue 1 year ago • 3 comments

I noticed a bug in Simile when the application's Prolog executable is built with the current gprolog. When dragging a link onscreen to reroute it, the movement stops before the end of the drag. During the drag, each mouse event generates a call to a Prolog predicate to update the link route, and after a few thousand in succession they start failing when they should succeed.

Due to the nature of the problem it's almost impossible to debug it analytically, but I have done a git bisect to find the point at which the bug appeared. Here's the result:

35eb271af7413a920bcf185cf4b78f0a6a481309 is the first bad commit commit 35eb271af7413a920bcf185cf4b78f0a6a481309 Author: Daniel Diaz [email protected] Date: Tue May 23 16:42:00 2023 +0200

More improvement on dynamic predicate support. Add option OPTIM_FIRST_FOR_SCAN and
improve pl2wam compiler accordingly (read_file.pl).

src/BipsPl/dynam_supp.c | 564 ++++++++++++++++++++++++++--------------------- src/BipsPl/dynam_supp.h | 21 +- src/BipsPl/t.pl | 90 ++++++-- src/Linedit/terminal.c | 3 +- src/Pl2Wam/read_file.pl | 19 +- src/Pl2Wam/read_file.wam | 300 +++++++++++++------------ 6 files changed, 569 insertions(+), 428 deletions(-)

Not sure where to go from here, any suggestions? Meanwhile I will be building Simile for Linux with the last commit before this one (test done on x86_64, Ubuntu Lunar)

jal-frezie avatar Aug 07 '23 10:08 jal-frezie

(I'm currently on holidays so I answer quickly) Try to change in BipsPl/dynam_supp.h:40 the #if 1 by #if 0 then (in src/):

make clean
make

If the bug persists, modify BipsPl/dynam_supp.c:72 to increase MAX_SKIP_BEFORE_CLEAN, for instance 10000. Again

make clean
make

didoudiaz avatar Aug 07 '23 10:08 didoudiaz

Thanks very much, the first change you suggested worked!

Just as well because I don't see any reference to MAX_SKIP_BEFORE_CLEAN in BipsPl/dynam_supp.h

jal-frezie avatar Aug 07 '23 11:08 jal-frezie

It is in dynam_supp.c (updated)

didoudiaz avatar Aug 07 '23 12:08 didoudiaz