Re: Access Violation with abolish
Daniel Diaz <[email protected]> Fri, 03 Jul 2015 18:37:09 +0200
| Newsgroups | gmane.comp.gnu.prolog.bugs |
|---|---|
| Message-ID | <[email protected]> |
--===============5595671652375770369==
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<meta content=3D"text/html; charset=3Dwindows-1252"
http-equiv=3D"Content-Type">
</head>
<body bgcolor=3D"#FFFFFF" text=3D"#000000">
<div class=3D"moz-cite-prefix">thank you for this bug report.<br>
<br>
I look at it asap.<br>
<br>
Daniel<br>
<br>
<br>
Le 01/07/2015 22:05, Gustavo Brown - INCO a =E9crit=A0:<br>
</div>
<blockquote
cite=3D"mid:4AECDEB74B144950873BBD2AA9A9B69C@VirtualXP99969"
type=3D"cite">
<meta content=3D"text/html; charset=3Dwindows-1252"
http-equiv=3D"Content-Type">
<meta name=3D"GENERATOR" content=3D"MSHTML 8.00.6001.23588">
<style></style>
<div><font face=3D"Arial" size=3D"2">I am getting an access violati=
on
when trying to abolish some facts.</font></div>
<div><font face=3D"Arial" size=3D"2">All the functions involved are
from the file dynam_supp.c file (BipsPL)</font></div>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">Inspecting the code
(dynam_supp.c) I think the problem is that there is a special
marker (ALL_MUST_BE_ERASED) with value 2 that is used in
Erase_All to mark that you want to erase all clauses(in member
first_erased_cl).</font></div>
<div><font face=3D"Arial" size=3D"2">However, when
Clean_Erased_Clauses() is called it may be the case that the
the first_erased_cl is also marked to keep (because it is
still used in the local stack) leading to keep member
first_erased_cl with ALL_MUST_BE_ERASED and not its previous
value.</font></div>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">Now, if PlDelete_Dynamic_Claus=
e
is called (e.g. due to a retract), then member next_erased_cl
might be copied with that special value ALL_MUST_BE_ERASED.</fo=
nt></div>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">Then if Clean_Erased_Clauses()=
is
called again and now this snippet fails</font></div>
<font face=3D"Arial" size=3D"2">for (clause =3D dyn->first_erase=
d_cl;
clause; clause =3D clause1)<br>
=A0{<br>
=A0=A0 clause1 =3D clause->next_erased_cl;<br>
=A0=A0 size_of_erased -=3D clause->term_size;<br>
=A0=A0 Unlink_Clause(clause);<br>
=A0=A0 Free_Clause(clause);<br>
=A0}</font>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">because clause->next_erased=
_cl
might hold ALL_MUST_BE_ERASED instead of NULL, which is the
stopping condition of that for loop.</font></div>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">Using GNU Prolog 1.4.4</font><=
/div>
<div>=A0</div>
<div><font face=3D"Arial" size=3D"2">Regards,</font></div>
<div><font face=3D"Arial" size=3D"2">=A0=A0 Gustavo</font></div>
<br>
-- <br>
Ce message a =E9t=E9 v=E9rifi=E9 par
<a moz-do-not-send=3D"true" href=3D"http://www.mailscanner.info/">M=
ailScanner</a>
pour des virus ou des polluriels et rien de
suspect n'a =E9t=E9 trouv=E9.
<br>
<fieldset class=3D"mimeAttachmentHeader"></fieldset>
<br>
<pre wrap=3D"">_______________________________________________
Bug-prolog mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:[email protected]">=
[email protected]</a>
<a class=3D"moz-txt-link-freetext" href=3D"https://lists.gnu.org/mailman/=
listinfo/bug-prolog">https://lists.gnu.org/mailman/listinfo/bug-prolog</a=
>
</pre>
</blockquote>
<br>
<br>--=20
<br>Ce message a été vérifié par
<a href=3D"http://www.mailscanner.info/">MailScanner</a>
pour des virus ou des polluriels et rien de
suspect n'a été trouvé.
</body>
</html>
--===============5595671652375770369==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
Bug-prolog mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-prolog
--===============5595671652375770369==--