Closed flyree closed 10 years ago
I am able to reproduce this bug. Source code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int i;
int N = atoi(argv[1]);
for(i= 0; i< N; i++){
i = i +1;
}
printf("i is %d\n",i);
return 0;
}
With a small input:
> $LLFI/bin/profile out_crash/crash-profiling.exe 5
<>/out_crash/crash-profiling.exe 5
program finish 0
time taken 1
With a large input:
> $LLFI/bin/profile out_crash/crash-profiling.exe 100000
<>/out_crash/crash-profiling.exe 100000
program finish -11
time taken 1
This is using the current LLFI 3.3 build (commit 644c7d38c78ea1b8565eccdc4dbc436c0c9e7d9e).
I already fixed this. Will upload it once somebody review my code. Thanks!
Bo
On Tue, Jan 14, 2014 at 11:10 AM, Shaden Smith notifications@github.comwrote:
I am able to reproduce this bug. Source code:
include
#include int main(int argc, char **argv) { int i; int N = atoi(argv[1]); for(i= 0; i< N; i++){
i = i +1;
} printf("i is %d\n",i); return 0;}
With a small input:
$LLFI/bin/profile out_crash/crash-profiling.exe 5 <>/out_crash/crash-profiling.exe 5 program finish 0 time taken 1
With a large input:
$LLFI/bin/profile out_crash/crash-profiling.exe 100000 <>/out_crash/crash-profiling.exe 100000 program finish -11 time taken 1
— Reply to this email directly or view it on GitHubhttps://github.com/DependableSystemsLab/LLFI/issues/2#issuecomment-32296415 .
Great, thanks! I am encountering this issue, so a fix is appreciated.
@flyree I am working on a project that requires results within the next two weeks, and I would like to use the trace functionality. Is there anyway you could send me the bug fix for the trace crash?
Even better, create a new branch for this bugfix and then merge with master once it has passed review. That way nothing on master breaks and those needing the fix can get it quickly.
@flyree Is there any news on this fix? Thanks,
My work is actually an extension to the current LLFI, so it won't be easy to merge my fix. I can send you the files that are affected individually. Is this OK?
P.S. the reason that it crashes is that the program runs out of memory because the trace is stored in stack. To get rid of that, we cannot store the name of each opcode (which was a string),but just storing the ID of that opcode.
Sure, that's fine. If you send me the affected files I can look into merging them with the current codebase.
Could you also send me a copy of the affected files?
From: flyree notifications@github.com<mailto:notifications@github.com> Reply-To: DependableSystemsLab/LLFI reply@reply.github.com<mailto:reply@reply.github.com> Date: Wednesday, February 19, 2014 at 1:30 AM To: DependableSystemsLab/LLFI LLFI@noreply.github.com<mailto:LLFI@noreply.github.com> Cc: "Mintz, Tiffany M." mintztm@ornl.gov<mailto:mintztm@ornl.gov> Subject: Re: [LLFI] Inst Trace causes crashes in LLFI ( version for LLVM 3.3) (#2)
My work is actually an extension to the current LLFI, so it won't be easy to merge my fix. I can send you the files that are affected individually. Is this OK?
P.S. the reason that it crashes is that the program runs out of memory because the trace is stored in stack. To get rid of that, we cannot store the name of each opcode (which was a string),but just storing the ID of that opcode.
— Reply to this email directly or view it on GitHubhttps://github.com/DependableSystemsLab/LLFI/issues/2#issuecomment-35470240.
Previously, it crashes because the program runs out of memory as the trace is stored in stack. The fix is not to store the name of each opcode; instead, we store the ID of the opcode.
See the fix here #39
Issue closed.
The crash happens when the instruction trace is enabled. The program didn't crash when it was small, meaning the amount of dynamic number of instructions are small, but it crashes if you increase the size of the problem.
A simple program would show this issue:
For a piece of code likes this:
include
int main() { int i; for(i= 0; i< 100; i++){ i = i +1; } printf("i is %d\n",i); return 0; }
There won't be a crash. But if we increase the size of the for loop to say, 1000000, the crash will happen.
An initial idea is that it can be related to the number of "Alloc" that LLFI creates to log the opcode for each instruction.
Bo