-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace_ with nested CFunctions crashes #307
Comments
Clearly, something seems to be still completely broken in
|
@vermaseren Is the following result of
What is the data format of |
In commit 29e608e, the modifications in proces.c caused this issue. The t1[2] = 1;
if ( *t1 == AR.PolyFun && AR.PolyFunType == 2 )
t1[2] |= CLEANPRF;
AT.NestPoin--;
AN.TeInFun++;
AR.TePos = 0;
AN.ncmod = oldncmod;
return(retvalue); If I simply add I think this bug has high priority to be solved. Sadly the control flow is rather non-trivial and I don't have all the informed yet about what this code does and what the fix should be. @vermaseren can you have a look at this too? It may be related to #316. |
Unfortunately that is not a correct fix and breaks a fix of issue 97.
It is indeed not easy there, because the code is making length adjustments of terms inside function arguments
which in turn needs then length adjustments in the parent term (and possibly etc).
To be continued……
Jos
… On 27 Jul 2020, at 15:37, Ben Ruijl ***@***.***> wrote:
In commit 29e608e <29e608e>, the modifications in proces.c caused this issue. The goto redosize; is replaced by some of the code that the goto refers to. However the following lines are not part of the new code:
t1[2] = 1;
if ( *t1 == AR.PolyFun && AR.PolyFunType == 2 )
t1[2] |= CLEANPRF;
AT.NestPoin--;
AN.TeInFun++;
AR.TePos = 0;
AN.ncmod = oldncmod;
return(retvalue);
If I simply add return(retvalue); to the end of the new code, I get the correct result. Is it indeed correct that we should return in this branch?
I think this bug has high priority to be solved. Sadly the control flow is rather non-trivial and I don't have all the informed yet about what this code does and what the fix should be. @vermaseren <https://github.com/vermaseren> can you have a look at this too?
It may be related to #316 <#316>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#307 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCETX3YOWHP4YFCADE2TR5V7KHANCNFSM4GWOXBPA>.
|
Should work properly now. This fix interfered with a couple of other fixes that were more or less incomplete/‘phenomenological’.
… On 27 Jul 2020, at 16:28, Jos Vermaseren ***@***.***> wrote:
Unfortunately that is not a correct fix and breaks a fix of issue 97.
It is indeed not easy there, because the code is making length adjustments of terms inside function arguments
which in turn needs then length adjustments in the parent term (and possibly etc).
To be continued……
Jos
> On 27 Jul 2020, at 15:37, Ben Ruijl ***@***.*** ***@***.***>> wrote:
>
>
> In commit 29e608e <29e608e>, the modifications in proces.c caused this issue. The goto redosize; is replaced by some of the code that the goto refers to. However the following lines are not part of the new code:
>
> t1[2] = 1;
> if ( *t1 == AR.PolyFun && AR.PolyFunType == 2 )
> t1[2] |= CLEANPRF;
> AT.NestPoin--;
> AN.TeInFun++;
> AR.TePos = 0;
> AN.ncmod = oldncmod;
> return(retvalue);
> If I simply add return(retvalue); to the end of the new code, I get the correct result. Is it indeed correct that we should return in this branch?
>
> I think this bug has high priority to be solved. Sadly the control flow is rather non-trivial and I don't have all the informed yet about what this code does and what the fix should be. @vermaseren <https://github.com/vermaseren> can you have a look at this too?
>
> It may be related to #316 <#316>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub <#307 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCETX3YOWHP4YFCADE2TR5V7KHANCNFSM4GWOXBPA>.
>
|
A test for this issue would be something like this (not merged yet). [Travis log]. Then, 2 questions: |
On that last ‘fix’ I did not construct a failing example. It was just that the code was missing out one step
which might occur if you really work at it. I figured that we could wait for someone to come up with
an example with sufficiently deep nested functions, but then I would have to start all over again locating
what was wrong etc.
I had not anticipated the example that needed the first fix, and it took years for someone to make it
mess up. Hence, I decided not to wait.
… On 11 Aug 2020, at 11:29, Takahiro Ueda ***@***.***> wrote:
A test for this issue would be something like this <tueda@68c69db> (not merged yet). [Travis log <https://travis-ci.org/github/tueda/form/builds/716839998>].
Then, 2 questions:
Do you still see some problems? Or can we close it?
What was done in b2def9d <b2def9d>? I mean, I can see the comment, but do you have any example that didn't work and fixed by it? It would be nice if I could put also such an example to the test. (But, it is somehow already covered <https://coveralls.io/builds/32648389/source?filename=sources/proces.c#L1553>.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#307 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCEUW2ZH5LQ7JALBMR2DSAEFQ5ANCNFSM4GWOXBPA>.
|
It is interesting that coveralls shows that new code is used... perhaps one can intentionally cause a crash there and see which example fails? |
It is not quite that simple.
The new code pops the nesting stack nd what it ‘repairs’ is what would happen
if the nesting stack would be popped again at a later stage in the same call.
If on the other hand the popping would take place in the originating call it is
a different story. The original crash was because there was the need for two
pops in the same call and the second did not do the first at the same time.
By doing them now separately the problem has been solved. There are cases
in which the original code caused no problem (apparently most cases) and
the crashing case was not quite forseen. But if you can construct an example in
which the second fix really is needed, it would be quite good.
… On 11 Aug 2020, at 13:23, jodavies ***@***.***> wrote:
It is interesting that coveralls shows that new code is used... perhaps one can intentionally cause a crash there and see which example fails?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#307 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCERGV7WPMRPGZGCBI5LSAES35ANCNFSM4GWOXBPA>.
|
The new code was covered by #105. Well, maybe reasonable... it contains log
OK, it seems difficult to construct a failing example. So, anyway I can just commit the test case and then I would close this issue for now. |
I've encountered a problem with some code that has been working for over 10 years when I tried upgrading to a newer version of FORM. I've boiled down the issue to the following minimal example:
Running with the latest version from github (087a772) compiled with gcc 7.3.0-27ubuntu1~18.04 on amd64 yields
I've used git bisect to find the first commit where this program fails and I found that something happens at commit 29e608e. Beginning with it I simply get the message
Program terminating at rep3.frm Line 9 -->
but no further messages.The exact message ("This $ variation ...") first appears with commit 2e409bc.
Interestingly, a small modification of the above program, i.e., replacing the expression by
Yields the result (note the non-sensical rational prefactor):
Other modifications lead to programs that seem to run forever (longer than I cared to wait).
Valgrind's memcheck outputs several messages along the lines of
Conditional jump or move depends on uninitialised value(s)
, but I haven't compiled form with debug symbols yet so I cannot give exact line numbers.The text was updated successfully, but these errors were encountered: