gprolog segmentation violation due to infinite recursion in unification

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

gprolog segmentation violation due to infinite recursion in unification

Paul Eggert
This problem was found by my student Trevor Hackett. To reproduce the problem,
build and run gprolog for x86-64 on Fedora 27, or use the gprolog bundled with
Fedora 27 x86-64:

$ gprolog
GNU Prolog 1.4.4 (64 bits)
Compiled Aug  3 2017, 08:15:35 with gcc
By Daniel Diaz
Copyright (C) 1999-2013 Daniel Diaz
| ?- X = [A,B,C,Y], Y = [A,B,C,X], X = Y.
Segmentation fault (core dumped)

It looks like Pl_Unify recurses forever at unify.c:117.

_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: gprolog segmentation violation due to infinite recursion in unification

Daniel Diaz-3
Hi Paul,

indeed, gprolog does not handle rational terms (and the unification is not aware about cyclic terms).

Daniel

> Le 14 déc. 2017 à 07:45, Paul Eggert <[hidden email]> a écrit :
>
> This problem was found by my student Trevor Hackett. To reproduce the problem, build and run gprolog for x86-64 on Fedora 27, or use the gprolog bundled with Fedora 27 x86-64:
>
> $ gprolog
> GNU Prolog 1.4.4 (64 bits)
> Compiled Aug  3 2017, 08:15:35 with gcc
> By Daniel Diaz
> Copyright (C) 1999-2013 Daniel Diaz
> | ?- X = [A,B,C,Y], Y = [A,B,C,X], X = Y.
> Segmentation fault (core dumped)
>
> It looks like Pl_Unify recurses forever at unify.c:117.
>
> _______________________________________________
> Bug-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/bug-prolog


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: gprolog segmentation violation due to infinite recursion in unification

Paul Eggert
On 12/18/2017 11:26 AM, Daniel Diaz wrote:
> indeed, gprolog does not handle rational terms (and the unification is not aware about cyclic terms).

Thanks, is the limitation documented? It'd be nice to have something I
can point students to.

Or is it a bug that you'd rather see fixed, presumably with some
performance penalty?


_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog
Reply | Threaded
Open this post in threaded view
|

Re: gprolog segmentation violation due to infinite recursion in unification

Daniel Diaz-3
Hi Paul,

it is a limitation, documented here (see acyclic_term/1).
http://www.gprolog.org/manual/html_node/gprolog028.html#sec88

Daniel

Le 18/12/2017 à 21:30, Paul Eggert a écrit :

> On 12/18/2017 11:26 AM, Daniel Diaz wrote:
>> indeed, gprolog does not handle rational terms (and the unification
>> is not aware about cyclic terms).
>
> Thanks, is the limitation documented? It'd be nice to have something I
> can point students to.
>
> Or is it a bug that you'd rather see fixed, presumably with some
> performance penalty?
>
>
> _______________________________________________
> Bug-prolog mailing list
> [hidden email]
> https://lists.gnu.org/mailman/listinfo/bug-prolog



_______________________________________________
Bug-prolog mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/bug-prolog