bug-prolog
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access Violation with abolish


From: Daniel Diaz
Subject: Re: Access Violation with abolish
Date: Fri, 03 Jul 2015 18:37:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

thank you for this bug report.

I look at it asap.

Daniel


Le 01/07/2015 22:05, Gustavo Brown - INCO a écrit :
I am getting an access violation when trying to abolish some facts.
All the functions involved are from the file dynam_supp.c file (BipsPL)
 
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).
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.
 
Now, if PlDelete_Dynamic_Clause is called (e.g. due to a retract), then member next_erased_cl might be copied with that special value ALL_MUST_BE_ERASED.
 
Then if Clean_Erased_Clauses() is called again and now this snippet fails
for (clause = dyn->first_erased_cl; clause; clause = clause1)
 {
   clause1 = clause->next_erased_cl;
   size_of_erased -= clause->term_size;
   Unlink_Clause(clause);
   Free_Clause(clause);
 }
 
because clause->next_erased_cl might hold ALL_MUST_BE_ERASED instead of NULL, which is the stopping condition of that for loop.
 
Using GNU Prolog 1.4.4
 
Regards,
   Gustavo

--
Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé.

_______________________________________________
Bug-prolog mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-prolog


--
Ce message a été vérifié par MailScanner pour des virus ou des polluriels et rien de suspect n'a été trouvé.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]