Skip to content

Crash in transform mulargs #230

@jodavies

Description

@jodavies

Hello,

I am trying to use Transform f mulargs(1,last) to efficiently invert a FactArg statement. I find either a crash or segfault, depending on some buffer sizes. The issue is triggered by

#: MaxTermSize 1M
#: WorkSpace 400M

AutoDeclare Symbol x;
CFunction f;

Local test = f(x1*...*x3502);
.sort

FactArg f;
Transform f mulargs(1,last);
Print +s;
.end

To see the crash in vorm (all tests with 4.2.0) the number of arguments must be increased to 3504.

Under valgrind, for me vorm does NOT crash, but yields f(0) and gives

==30276== Warning: set address range perms: large range [0x1077a040, 0x2f2065c8) (undefined)
==30276== Conditional jump or move depends on uninitialised value(s)
==30276==    at 0x4B7B2F: Generator (proces.c:3072)
==30276==    by 0x4B9473: Generator (proces.c:3931)
==30276==    by 0x4BD86F: InFunction (proces.c:2046)
==30276==    by 0x4B8DED: Generator (proces.c:3759)
==30276==    by 0x4B9473: Generator (proces.c:3931)
==30276==    by 0x4BA9F3: Processor (proces.c:404)
==30276==    by 0x438717: DoExecute (execute.c:838)
==30276==    by 0x44EF96: ExecModule (module.c:274)
==30276==    by 0x4B0A12: PreProcessor (pre.c:962)
==30276==    by 0x4EA969: main (startup.c:1605)

Curiously, if I modify the definition of the test expression to, say,

CFunction g;
Local test = f(<g(x1)>*...*<g(x8750)>);

The code runs in form, but not in vorm...

Thanks,
Josh.

EDIT: The SplitArgs/Transform f addargs(1,last) equivalent of this script appears to work without issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions