Thread overview
ldc hangs up in release mode
Apr 27, 2015
drug
Apr 27, 2015
Kai Nacke
Apr 28, 2015
drug
May 05, 2015
drug
May 05, 2015
Kai Nacke
May 05, 2015
Kai Nacke
April 27, 2015
What the best way to solve the problem and find out the reason of it?
April 27, 2015
On Monday, 27 April 2015 at 12:13:26 UTC, drug wrote:
> What the best way to solve the problem and find out the reason of it?

Hi drug!

I can think of 2 ways:
- use option -vv to find out if there is a loop in codegen
- fire up a debugger and break until ldc run some times to see where it loops

Could you provide an example?

Regards,
Kai
April 28, 2015
On 27.04.2015 23:00, Kai Nacke wrote:
> On Monday, 27 April 2015 at 12:13:26 UTC, drug wrote:
>> What the best way to solve the problem and find out the reason of it?
>
> Hi drug!
>
> I can think of 2 ways:
> - use option -vv to find out if there is a loop in codegen
> - fire up a debugger and break until ldc run some times to see where it
> loops
>
> Could you provide an example?
>
> Regards,
> Kai
I use gdb
```
Attaching to process 13474
Reading symbols from /usr/local/bin/ldc2...done.
Reading symbols from /usr/lib/x86_64-linux-gnu/libconfig.so.9...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libconfig.so.9
Reading symbols from /lib/x86_64-linux-gnu/libpthread.so.0...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libpthread-2.19.so...done.
done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Loaded symbols for /lib/x86_64-linux-gnu/libpthread.so.0
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libdl.so.2
Reading symbols from /lib/x86_64-linux-gnu/libtinfo.so.5...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libtinfo.so.5
Reading symbols from /lib/x86_64-linux-gnu/libz.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libz.so.1
Reading symbols from /usr/lib/x86_64-linux-gnu/libffi.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libffi.so.6
Reading symbols from /usr/lib/x86_64-linux-gnu/libedit.so.2...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libedit.so.2
Reading symbols from /usr/lib/x86_64-linux-gnu/libstdc++.so.6...(no debugging symbols found)...done.
Loaded symbols for /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Reading symbols from /lib/x86_64-linux-gnu/libm.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libm-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libm.so.6
Reading symbols from /lib/x86_64-linux-gnu/libgcc_s.so.1...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libgcc_s.so.1
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-2.19.so...done.
done.
Loaded symbols for /lib/x86_64-linux-gnu/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.19.so...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /lib/x86_64-linux-gnu/libbsd.so.0...(no debugging symbols found)...done.
Loaded symbols for /lib/x86_64-linux-gnu/libbsd.so.0
0x000000000120bb05 in (anonymous namespace)::SCCPSolver::getStructValueState(llvm::Value*, unsigned int) ()
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000000000120bb05 in (anonymous namespace)::SCCPSolver::getStructValueState(llvm::Value*, unsigned int) ()
(gdb) bt
#0  0x000000000120bb05 in (anonymous namespace)::SCCPSolver::getStructValueState(llvm::Value*, unsigned int) ()
#1  0x000000000120fd76 in llvm::InstVisitor<(anonymous namespace)::SCCPSolver, void>::visit(llvm::Instruction&) ()
#2  0x0000000001211ac7 in (anonymous namespace)::SCCPSolver::Solve() ()
#3  0x0000000001212af3 in (anonymous namespace)::IPSCCP::runOnModule(llvm::Module&) ()
#4  0x0000000001591f29 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#5  0x000000000078e5bf in ldc_optimize_module (M=M@entry=0x6037abf0) at /home/drug/3rdparties/ldc/ldc/gen/optimizer.cpp:441
#6  0x000000000064a951 in writeModule (m=0x6037abf0,

filename="service/.dub/build/normal-release-linux.posix-x86_64-ldmd2-91C4918C31AD443BF98F006B48FAF7C6/service.o")
    at /home/drug/3rdparties/ldc/ldc/driver/toobj.cpp:140
#7  0x0000000000619a4a in main (argc=<optimized out>, argv=<optimized out>) at /home/drug/3rdparties/ldc/ldc/driver/main.cpp:1411
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
0x000000000120bb05 in (anonymous namespace)::SCCPSolver::getStructValueState(llvm::Value*, unsigned int) ()
(gdb) bt
#0  0x000000000120bb05 in (anonymous namespace)::SCCPSolver::getStructValueState(llvm::Value*, unsigned int) ()
#1  0x000000000120fd76 in llvm::InstVisitor<(anonymous namespace)::SCCPSolver, void>::visit(llvm::Instruction&) ()
#2  0x0000000001211ac7 in (anonymous namespace)::SCCPSolver::Solve() ()
#3  0x0000000001212af3 in (anonymous namespace)::IPSCCP::runOnModule(llvm::Module&) ()
#4  0x0000000001591f29 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#5  0x000000000078e5bf in ldc_optimize_module (M=M@entry=0x6037abf0) at /home/drug/3rdparties/ldc/ldc/gen/optimizer.cpp:441
#6  0x000000000064a951 in writeModule (m=0x6037abf0,

filename="service/.dub/build/normal-release-linux.posix-x86_64-ldmd2-91C4918C31AD443BF98F006B48FAF7C6/service.o")
    at /home/drug/3rdparties/ldc/ldc/driver/toobj.cpp:140
#7  0x0000000000619a4a in main (argc=<optimized out>, argv=<optimized out>) at /home/drug/3rdparties/ldc/ldc/driver/main.cpp:1411
(gdb)
```
I several times breaks execution and every time ldc is in ::SCCPSolver::getStructValueState() function. Hope it's useful
May 05, 2015
Sorry for incovenience, it was a broken compiler installation.
May 05, 2015
On Tuesday, 5 May 2015 at 08:33:13 UTC, drug wrote:
> Sorry for incovenience, it was a broken compiler installation.

Glad to hear that you solved the problem!

Regards,
Kai
May 05, 2015
On Tuesday, 5 May 2015 at 08:33:13 UTC, drug wrote:
> Sorry for incovenience, it was a broken compiler installation.

Glad to hear that you solved the problem!

Regards,
Kai