SWI-Prolog / issues

Dummy repository for issue tracking
7 stars 3 forks source link

Possible bug in swipl last version #101

Closed lcoheur closed 3 years ago

lcoheur commented 3 years ago

The problem has the following pattern:

consult file run test => ok consult file run test => ERROR consult file run test => ok again ...

here goes an example:

==== Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details.

For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word).

?- ['projLu.pl']. true.

?- numeros_comuns([[7,1,5,3],[7,5,1,3],[7,4,2,3]], L). L = [(1,7),(4,3)].

?- ['projLu.pl']. true.

?- numeros_comuns([[7,1,5,3],[7,5,1,3],[7,4,2,3]], L). ERROR: Unknown procedure: 'aux_maplist/2_checkLista+1'/2 ERROR: In: ERROR: [17] 'aux_maplist/2_checkLista+1'([[7|...],...],(1,7)) ERROR: [16] ''(user:(...,...)) ERROR: [15] '$bags':findall_loop((1,7),user:(...,...),_25012,[]) at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/bags.pl:99 ERROR: [14] setup_call_catcher_cleanup('$bags':'$new_findall_bag','$bags':findall_loop(...,...,_25082,[]),_25060,'$bags':'$destroy_findall_bag') at /usr/local/Cellar/swi-prolog/8.2.4/libexec/lib/swipl/boot/init.pl:614 ERROR: [9] ERROR: ERROR: Note: some frames are missing due to last-call optimization. ERROR: Re-run your program in debug mode (:- debug.) to get more detail. Exception: (17) 'aux_maplist/2_checkLista+1'([[7, 5, 1, 3], [7, 4, 2, 3]], (1, 7)) ? creep ^ Exception: (14) setup_call_catcher_cleanup('$bags':'$new_findall_bag', '$bags':findall_loop((_16350, _16352), user:(member((_16350, _16352), [(1, 7), (2, 1), (..., ...)|...]), 'aux_maplist/2_checkLista+1'([[7, 5|...], [7|...]], (_16350, _16352))), _15894, []), _25352, '$bags':'$destroy_findall_bag') ? creep ?- ['projLu.pl']. true.

?- numeros_comuns([[7,1,5,3],[7,5,1,3],[7,4,2,3]], L). L = [(1,7),(4,3)].

lcoheur commented 3 years ago

In the implementation of all the predicates that trigger this problem a maplist is used.

JanWielemaker commented 3 years ago

There has been a similar complaint some time ago that had an easy fix. Can't find the issue anymore. Trying the obvious things to reproduce didn't work. Please include a complete example.

applish commented 3 years ago

Might be https://swi-prolog.discourse.group/t/unknown-procedure-after-reloading-with-make/3573

lcoheur commented 3 years ago

Thanks!

applish @.***> escreveu no dia quinta, 6/05/2021 à(s) 22:55:

Might be https://swi-prolog.discourse.group/t/unknown-procedure-after-reloading-with-make/3573

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/SWI-Prolog/issues/issues/101#issuecomment-833895206, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWXDXECOABM7LVRG7FR6JLTMMF3ZANCNFSM434HJFCA .

JanWielemaker commented 3 years ago

@applish Thanks. Pushed a fix. (SWI-Prolog/swipl-devel@8b599bd0cb690cbbe5a283d8be8c403c7a859d09). Won't be fixed in stable as the next stable is going to be 8.4.0.

Typically, the problem occurs when using consult/1 (or :- [file].) to load one file from another. Use use_module/1,2 or, if the target is not a module file, ensure_loaded/1.