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

Calling "argtoextrasymbol" of a function containing "g5_" crashes #340

Closed
mgerlach-phys opened this issue Dec 9, 2019 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@mgerlach-phys
Copy link

The following code crashes on execution without further error message.

cf f, g;

l A = f( g(g5_(1)) );
l B = f( g5(1) );
l C = f( gi_(1) );

argtoextrasymbol f;

print +s; 
.end

In this example code only the case B crashes. i.e. no error occurs in A and C.

I already found a walkaround, though. Just replace g5_ by an other generic tensor.

ntensor g5;
index rho;

[...]

argument f;
    id g_(rho?,5_) = g5(rho);
endargument;

[...]
@tueda
Copy link
Collaborator

tueda commented Dec 9, 2019

I confirmed that f(g5_(1)) leads to crashes. Here is a Valgrind dump:

Valgrind dump

==119862== Memcheck, a memory error detector
==119862== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==119862== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==119862== Command: ./vorm test.frm
==119862==
==119862== Warning: set address range perms: large range [0xfc45040, 0x2d91b540) (undefined)
==119862== Warning: set address range perms: large range [0x2d91c040, 0x4b5f2540) (undefined)
==119862== Warning: set address range perms: large range [0x59eac040, 0x9e675bc0) (undefined)
FORM 4.2.1 (Aug 28 2019, v4.2.1-5-g4057c65) 64-bits  Run: Mon Dec  9 18:10:29 2019
    CF f;
    L F = f(g5_(1));
    argtoextrasymbol f;
    .end
==119862== Invalid read of size 4
==119862==    at 0x4DB990: DimensionSubterm (reshuf.c:942)
==119862==    by 0x4DBA2E: DimensionTerm (reshuf.c:975)
==119862==    by 0x4DBA85: DimensionExpression (reshuf.c:1006)
==119862==    by 0x46764B: FindSubexpression (notation.c:1129)
==119862==    by 0x409265: execarg (argument.c:612)
==119862==    by 0x4C12FB: Generator (proces.c:3439)
==119862==    by 0x4C1FFA: Generator (proces.c:3824)
==119862==    by 0x4C2440: Generator (proces.c:3992)
==119862==    by 0x4C39BF: Processor (proces.c:405)
==119862==    by 0x43ACD9: DoExecute (execute.c:843)
==119862==    by 0x4540B2: ExecModule (module.c:274)
==119862==    by 0x4B9627: PreProcessor (pre.c:967)
==119862==  Address 0x779570b64 is not stack'd, malloc'd or (recently) free'd
==119862==
Program terminating at test.frm Line 3 -->
==119862== Invalid read of size 4
==119862==    at 0x50E22F: Crash (tools.c:3771)
==119862==    by 0x4F3C3D: Terminate (startup.c:1721)
==119862==    by 0x4F425F: onErrSig (startup.c:1489)
==119862==    by 0x5C4230F: ??? (in /home/linuxbrew/.linuxbrew/Cellar/glibc/2.23/lib/libc-2.23.so)
==119862==    by 0x4DB98F: DimensionSubterm (reshuf.c:942)
==119862==    by 0x4DBA2E: DimensionTerm (reshuf.c:975)
==119862==    by 0x4DBA85: DimensionExpression (reshuf.c:1006)
==119862==    by 0x46764B: FindSubexpression (notation.c:1129)
==119862==    by 0x409265: execarg (argument.c:612)
==119862==    by 0x4C12FB: Generator (proces.c:3439)
==119862==    by 0x4C1FFA: Generator (proces.c:3824)
==119862==    by 0x4C2440: Generator (proces.c:3992)
==119862==  Address 0x0 is not stack'd, malloc'd or (recently) free'd

@tueda tueda added the bug Something isn't working label Dec 9, 2019
vermaseren added a commit that referenced this issue Jul 15, 2020
tueda added a commit that referenced this issue Jul 17, 2020
@tueda tueda closed this as completed Jul 17, 2020
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

2 participants