vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.14k stars 136 forks source link

Crash by term_ * replace_ #152

Open tueda opened 7 years ago

tueda commented 7 years ago

Because I am a lazy person, in the context of

CF v,vv;
V p1,p2,p3;
L F = v(-p1,p2,p3,-p3,p1,-p2);
$t = term_;
$t = $t * replace_(v,vv);
.end

I wrote the following code to save typing a line

CF v,vv;
V p1,p2,p3;
L F = v(-p1,p2,p3,-p3,p1,-p2);
$t = term_ * replace_(v,vv);
.end

(though I was not sure if replace_ is applied before or after term_), which actually crashed.

FORM 4.1 (Nov 24 2016, v4.1-20131025-270-g6fe5632) 64-bits  Run: Fri Nov 25 19:39:37 2016

==32105== Invalid read of size 4
==32105==    at 0x5302D5: TestSub (proces.c:700)
==32105==    by 0x537C5D: Generator (proces.c:2979)
==32105==    by 0x44ADC5: AssignDollar (dollar.c:416)
==32105==    by 0x539261: Generator (proces.c:3442)
==32105==    by 0x53A9BC: Generator (proces.c:3837)
==32105==    by 0x52F897: Processor (proces.c:404)
==32105==    by 0x45766E: DoExecute (execute.c:812)
==32105==    by 0x47ECBA: ExecModule (module.c:274)
==32105==    by 0x51D5B1: PreProcessor (pre.c:898)
==32105==    by 0x5850A5: main (startup.c:1597)
==32105==  Address 0xffffffff468e6db0 is not stack'd, malloc'd or (recently) free'd
vermaseren commented 7 years ago

That would not work,because term_ refers now to a term inside the $ if I am right. And that is not defined properly yet.

Jos

On 25 nov. 2016, at 19:44, Takahiro Ueda notifications@github.com wrote:

Because I am a lazy person, in the context of

CF v,vv; V p1,p2,p3; L F = v(-p1,p2,p3,-p3,p1,-p2); $t = term; $t = $t * replace(v,vv); .end I wrote the following code to save typing a line

CF v,vv; V p1,p2,p3; L F = v(-p1,p2,p3,-p3,p1,-p2); $t = term * replace(v,vv); .end (though I was not sure if replace is applied before or after term), which actually crashed.

FORM 4.1 (Nov 24 2016, v4.1-20131025-270-g6fe5632) 64-bits Run: Fri Nov 25 19:39:37 2016

==32105== Invalid read of size 4 ==32105== at 0x5302D5: TestSub (proces.c:700) ==32105== by 0x537C5D: Generator (proces.c:2979) ==32105== by 0x44ADC5: AssignDollar (dollar.c:416) ==32105== by 0x539261: Generator (proces.c:3442) ==32105== by 0x53A9BC: Generator (proces.c:3837) ==32105== by 0x52F897: Processor (proces.c:404) ==32105== by 0x45766E: DoExecute (execute.c:812) ==32105== by 0x47ECBA: ExecModule (module.c:274) ==32105== by 0x51D5B1: PreProcessor (pre.c:898) ==32105== by 0x5850A5: main (startup.c:1597) ==32105== Address 0xffffffff468e6db0 is not stack'd, malloc'd or (recently) free'd — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vermaseren/form/issues/152, or mute the thread https://github.com/notifications/unsubscribe-auth/AFLxEg7A_ctsrEliAR9c8aCqJS-aV7acks5rByxzgaJpZM4K8qEl.