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

Clang segfaults when sub-loop > 1 #1

Closed
Fuzion24 opened this issue Dec 31, 2013 · 2 comments
Closed

Clang segfaults when sub-loop > 1 #1

Fuzion24 opened this issue Dec 31, 2013 · 2 comments
Assignees

Comments

@Fuzion24
Copy link

Very nice tool. I was playing around a bit with it and it seems that anytime I try to do function sub more than one loop, it blows clang up.

(note: I receive the same where when not trying to emit llvm-ir)

➜  llvm-obfuscator git:(master) ✗ build/bin/clang -S -emit-llvm test.c -mllvm -sub -mllvm -fla -mllvm -sub-loop=2
0  clang-3.2       0x0000000001152fff
1  clang-3.2       0x00000000011533a4
2  libpthread.so.0 0x00007f145dff8bb0
3  clang-3.2       0x0000000001059bf0 llvm::Instruction::eraseFromParent() + 16
4  clang-3.2       0x0000000001aa2bec
5  clang-3.2       0x000000000107ca54 llvm::FPPassManager::runOnFunction(llvm::Function&) + 596
6  clang-3.2       0x0000000000ed2a22
7  clang-3.2       0x000000000107ceb7 llvm::MPPassManager::runOnModule(llvm::Module&) + 439
8  clang-3.2       0x000000000107cfbb llvm::PassManagerImpl::run(llvm::Module&) + 123
9  clang-3.2       0x000000000117512a clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 1802
10 clang-3.2       0x0000000001173047
11 clang-3.2       0x00000000013bcdf3 clang::ParseAST(clang::Sema&, bool, bool) + 515
12 clang-3.2       0x000000000131c081 clang::FrontendAction::Execute() + 113
13 clang-3.2       0x00000000012fbb90 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 288
14 clang-3.2       0x0000000001155cff clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1471
15 clang-3.2       0x00000000006c4e00 cc1_main(char const**, char const**, char const*, void*) + 7120
16 clang-3.2       0x00000000006ab3cb main + 7771
17 libc.so.6       0x00007f145d424de5 __libc_start_main + 245
18 clang-3.2       0x00000000006c14c9

1.      <eof> parser at end of file
2.      Per-module optimization passes
3.      Running pass 'CallGraph Pass Manager' on module 'test.c'.
4.      Running pass 'operators substitution' on function '@add'
clang-3: error: unable to execute command: Segmentation fault (core dumped)
clang-3: error: clang frontend command failed due to signal (use -v to see invocation)
LLVM version 3.2 
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang-3: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang-3: note: diagnostic msg: 
********************

➜ llvm-obfuscator git:(master) ✗ cat test.c

#include <stdio.h>

int add(int x, int y){
 return x + y;
}

int main(void){
printf("Hello, there: I've added things: %d\n", add(1,4));

return 0;
}


On another note, what repo did you pull from initially?  I was thinking it may be nice to rebase on top of it, so that it would be possible to follow upstream changes in LLVM.
@pyknite
Copy link
Collaborator

pyknite commented Dec 31, 2013

Hi !

Thanks for your feedback !

I’ll look at this bug tomorrow or after tomorrow to see what’s wrong with the code.

On another note, what repo did you pull from initially?  I was thinking it may be nice to rebase on top of it, so that it   would be possible to follow upstream changes in LLVM.

Currently, the base code is from Apple release (http://www.opensource.apple.com/source/clang/clang-425.0.24/). But we will update the repository as soon as the LLVM team release LLVM 3.4 !

@ghost ghost assigned pyknite Dec 31, 2013
obfuscator-llvm added a commit that referenced this issue Jan 2, 2014
@pyknite pyknite closed this as completed Jan 2, 2014
@pyknite
Copy link
Collaborator

pyknite commented Jan 2, 2014

Fixed... I tested it with the test-suite of the latest version of libGMP, OpenSSL and libtomcrypt (note that the OpenSSL test-suite fail on the elliptic curves tests even without obfuscation)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants