Skip to content
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

Crash from multiply replace_ in large expression #169

Closed
jodavies opened this issue Feb 22, 2017 · 7 comments
Closed

Crash from multiply replace_ in large expression #169

jodavies opened this issue Feb 22, 2017 · 7 comments
Labels
bug Something isn't working

Comments

@jodavies
Copy link
Collaborator

Hello,

The following script crashes on my machines

#-

Symbol d,s,t;
CFunction den;
AutoDeclare CFunction G;

#include- expr.h
.sort

Multiply replace_(s,1);

*Identify s = 1;
*Argument;
*	Identify s = 1;
*EndArgument;

.end

with

Program terminating in thread 8 at test.frm Line 11 -->

expr.h: https://anomalousdimension.dedyn.io/expr.h

The commented lines have the same effect, and run with no problems.

Thanks,
Josh.

@tueda tueda added the bug Something isn't working label Feb 22, 2017
@tueda
Copy link
Collaborator

tueda commented Feb 22, 2017

A hint would be the following valgrind output:

==5873== Memcheck, a memory error detector
==5873== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==5873== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==5873== Command: vorm test
==5873==
FORM 4.1 (Feb  1 2017, v4.1-20131025-295-g313a3f5) 64-bits  Run: Wed Feb 22 14:17:10 2017

...

Time =     680.34 sec    Generated terms =     103392
1,1,1,1,1,-4,0)]         Terms in output =      99850
                   input Bytes used      =    3498340
==5873== Invalid read of size 4
==5873==    at 0x4B94E8: TestSub (proces.c:1427)
==5873==    by 0x4B4E66: Generator (proces.c:2984)
==5873==    by 0x4B65AD: Generator (proces.c:3842)
==5873==    by 0x4B7AF8: Processor (proces.c:404)
==5873==    by 0x436F42: DoExecute (execute.c:812)
==5873==    by 0x44D3C4: ExecModule (module.c:274)
==5873==    by 0x4AE00A: PreProcessor (pre.c:898)
==5873==    by 0x4E4988: main (startup.c:1601)
==5873==  Address 0xb45678 is not stack'd, malloc'd or (recently) free'd
==5873== 
Program terminating at test.frm Line 10 --> 

@vermaseren
Copy link
Owner

vermaseren commented Feb 22, 2017 via email

@jodavies
Copy link
Collaborator Author

For me, (g104d5d8), this example does not crash.

@tueda
Copy link
Collaborator

tueda commented Feb 22, 2017

Jos's example gave me

  • v4.1-20131025-295-g313a3f5
    • vorm -> crash
    • valgrind vorm -> no crash, no warnings
  • v4.1-20131025-245-g104d5d8
    • vorm -> crash
    • valgrind vorm -> no crash, no warnings

May be a bit subtle depending on environment...

@vermaseren
Copy link
Owner

vermaseren commented Feb 22, 2017 via email

vermaseren added a commit that referenced this issue Feb 22, 2017
@vermaseren
Copy link
Owner

vermaseren commented Feb 22, 2017 via email

tueda added a commit that referenced this issue Feb 22, 2017
@jodavies
Copy link
Collaborator Author

Works for me. Thanks!

@tueda tueda closed this as completed Feb 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants