Git Product home page Git Product logo

Comments (4)

nickg avatar nickg commented on May 30, 2024

This one is a bit odd. I've tried running this test case under valgrind on x86-64 and it's clean. Can you try the same on your PowerPC machine as see if it reports any errors? E.g.

./src/nvc -a test/regress/fact.vhd && ./src/nvc -e fact && valgrind ./src/nvc -r fact

from nvc.

hiyuh avatar hiyuh commented on May 30, 2024

I did the command you mentioned:

$ cd ~/git-repos/nvc
$ export NVC_LIBPATH=./lib/std:./lib/ieee
$ ./src/nvc -a test/regress/fact.vhd && ./src/nvc -e fact && valgrind ./src/nvc -r fact
[gc: freed 742 trees; 414 allocated]
[gc: freed 2 trees; 403 allocated]
/usr/bin/llvm-ld -v -r -stats -b /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc /home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc
Linking bitcode file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Linked in file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Generating Bitcode To /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc
===-------------------------------------------------------------------------===
... Statistics Collected ...
===-------------------------------------------------------------------------===

1 cgscc-passmgr - Maximum CGSCCPassMgr iterations on one SCC
5 globaldce - Number of functions removed
2 globalopt - Number of aggregate globals broken into scalars
7 globalopt - Number of globals marked unnamed_addr
5 globalsmodref-aa - Number of global vars without address taken
3 gvn - Number of instructions deleted
3 gvn - Number of loads deleted
3 instcombine - Number of insts combined
2 licm - Number of instructions hoisted out of loop
1 licm - Number of load insts hoisted or sunk
2 licm - Number of memory locations promoted to registers
3 memdep - Number of block queries that were completely cached
5 memdep - Number of uncached non-local ptr responses

==15671== Memcheck, a memory error detector
==15671== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==15671== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==15671== Command: ./src/nvc -r fact
==15671==

hang up at last line of above outputs w/ 100% CPU usage.
to stop it, I'd have to do ctrl-c.
maybe, this hang up is caused by known issue of valgrind itself.
I'm waiting some replies from maintainers at https://bugs.gentoo.org/403827

w/o valgrind, it looks ok to me:

$ ./src/nvc -a test/regress/fact.vhd && ./src/nvc -e fact && ./src/nvc -r fact
[gc: freed 742 trees; 414 allocated]
[gc: freed 2 trees; 738 allocated]
/usr/bin/llvm-ld -v -r -stats -b /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc /home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc
Linking bitcode file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Linked in file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Generating Bitcode To /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc
===-------------------------------------------------------------------------===
... Statistics Collected ...
===-------------------------------------------------------------------------===

1 cgscc-passmgr - Maximum CGSCCPassMgr iterations on one SCC
5 globaldce - Number of functions removed
2 globalopt - Number of aggregate globals broken into scalars
7 globalopt - Number of globals marked unnamed_addr
5 globalsmodref-aa - Number of global vars without address taken
3 gvn - Number of instructions deleted
3 gvn - Number of loads deleted
3 instcombine - Number of insts combined
2 licm - Number of instructions hoisted out of loop
1 licm - Number of load insts hoisted or sunk
2 licm - Number of memory locations promoted to registers
3 memdep - Number of block queries that were completely cached
5 memdep - Number of uncached non-local ptr responses

0ms+1: Report Note: 1
File test/regress/fact.vhd, Line 41
0ms+3: Report Note: 2
File test/regress/fact.vhd, Line 41
0ms+5: Report Note: 6
File test/regress/fact.vhd, Line 41
0ms+7: Report Note: 24
File test/regress/fact.vhd, Line 41
0ms+9: Report Note: 120
File test/regress/fact.vhd, Line 41
0ms+11: Report Note: 720
File test/regress/fact.vhd, Line 41
0ms+13: Report Note: 5040
File test/regress/fact.vhd, Line 41
0ms+15: Report Note: 40320
File test/regress/fact.vhd, Line 41
0ms+17: Report Note: 362880
File test/regress/fact.vhd, Line 41
0ms+19: Report Note: 3628800
File test/regress/fact.vhd, Line 41
0ms+21: Report Note: 39916800
File test/regress/fact.vhd, Line 41
0ms+23: Report Note: 479001600
File test/regress/fact.vhd, Line 41
0ms+25: Report Note: 1932053504
File test/regress/fact.vhd, Line 41
0ms+27: Report Note: 1278945280
File test/regress/fact.vhd, Line 41
0ms+29: Report Note: 2004310016
File test/regress/fact.vhd, Line 41

but "make check" still fails:

$ make check
[SNIP]
fact : *** glibc detected *** /home/hiyuh/git-repos/nvc/src/nvc: double free or corruption (out): 0x10efb748 ***
======= Backtrace: =========
/lib/libc.so.6(+0x81d20)[0xfac3d20]
/lib/libc.so.6(cfree+0x8c)[0xfac9054]
/home/hiyuh/git-repos/nvc/src/nvc[0x10442b54]
/home/hiyuh/git-repos/nvc/src/nvc[0x1044b414]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm13LPPassManager13runOnFunctionERNS_8FunctionE+0x23c)[0x1052c7a8]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x118)[0x10616ca8]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm23FunctionPassManagerImpl3runERNS_8FunctionE+0x60)[0x10616e68]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm19FunctionPassManager3runERNS_8FunctionE+0xb4)[0x10616f8c]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT14jitTheFunctionEPNS_8FunctionERKNS_10MutexGuardE+0x34)[0x1035cf18]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT24runJITOnFunctionUnlockedEPNS_8FunctionERKNS_10MutexGuardE+0x2c)[0x1035cf5c]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm3JIT20getPointerToFunctionEPNS_8FunctionE+0x1ac)[0x1035d150]
/home/hiyuh/git-repos/nvc/src/nvc(_ZN4llvm15ExecutionEngine18getPointerToGlobalEPKNS_11GlobalValueE+0x44)[0x1036e48c]
/home/hiyuh/git-repos/nvc/src/nvc(LLVMGetPointerToGlobal+0x24)[0x103720cc]
/home/hiyuh/git-repos/nvc/src/nvc(jit_fun_ptr+0x54)[0x1023a4b4]
/home/hiyuh/git-repos/nvc/src/nvc[0x10235fbc]
/home/hiyuh/git-repos/nvc/src/nvc(rt_batch_exec+0x60)[0x102379c0]
/home/hiyuh/git-repos/nvc/src/nvc(main+0x8e4)[0x102093e4]
/lib/libc.so.6(+0x23110)[0xfa65110]
/lib/libc.so.6(+0x232a0)[0xfa652a0]
======= Memory map: ========
00100000-00103000 r-xp 00000000 00:00 0 [vdso]
0f9e0000-0fa1e000 r-xp 00000000 08:06 1480582 /lib/libncurses.so.5.9
0fa1e000-0fa2e000 ---p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
0fa2e000-0fa31000 r--p 0003e000 08:06 1480582 /lib/libncurses.so.5.9
0fa31000-0fa32000 rw-p 00041000 08:06 1480582 /lib/libncurses.so.5.9
0fa42000-0fba6000 r-xp 00000000 08:06 1740830 /lib/libc-2.14.1.so
0fba6000-0fbb6000 ---p 00164000 08:06 1740830 /lib/libc-2.14.1.so
0fbb6000-0fbba000 r--p 00164000 08:06 1740830 /lib/libc-2.14.1.so
0fbba000-0fbbb000 rw-p 00168000 08:06 1740830 /lib/libc-2.14.1.so
0fbbb000-0fbbe000 rw-p 00000000 00:00 0
0fbce000-0fbe3000 r-xp 00000000 08:06 267158 /lib/libgcc_s.so.1
0fbe3000-0fbf3000 ---p 00015000 08:06 267158 /lib/libgcc_s.so.1
0fbf3000-0fbf4000 r--p 00015000 08:06 267158 /lib/libgcc_s.so.1
0fbf4000-0fbf5000 rw-p 00016000 08:06 267158 /lib/libgcc_s.so.1
0fc05000-0fcaa000 r-xp 00000000 08:06 1740232 /lib/libm-2.14.1.so
0fcaa000-0fcba000 ---p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
0fcba000-0fcbd000 r--p 000a5000 08:06 1740232 /lib/libm-2.14.1.so
0fcbd000-0fcbe000 rw-p 000a8000 08:06 1740232 /lib/libm-2.14.1.so
0fcce000-0fdd5000 r-xp 00000000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
0fdd5000-0fde4000 ---p 00107000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
0fde4000-0fde9000 r--p 00106000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
0fde9000-0fdeb000 rw-p 0010b000 08:06 2375450 /usr/lib/gcc/powerpc-unknown-linux-gnu/4.5.3/libstdc++.so.6.0.14
0fdeb000-0fdf1000 rw-p 00000000 00:00 0
0fe01000-0fe35000 r-xp 00000000 08:06 1203034 /lib/libreadline.so.6.2
0fe35000-0fe44000 ---p 00034000 08:06 1203034 /lib/libreadline.so.6.2
0fe44000-0fe46000 r--p 00033000 08:06 1203034 /lib/libreadline.so.6.2
0fe46000-0fe49000 rw-p 00035000 08:06 1203034 /lib/libreadline.so.6.2
0fe49000-0fe4b000 rw-p 00000000 00:00 0
0fe5b000-0ff4f000 r-xp 00000000 08:06 1593415 /usr/lib/libtcl8.5.so
0ff4f000-0ff5e000 ---p 000f4000 08:06 1593415 /usr/lib/libtcl8.5.so
0ff5e000-0ff63000 r--p 000f3000 08:06 1593415 /usr/lib/libtcl8.5.so
0ff63000-0ff67000 rw-p 000f8000 08:06 1593415 /usr/lib/libtcl8.5.so
0ff67000-0ff68000 rw-p 00000000 00:00 0
0ff78000-0ff7b000 r-xp 00000000 08:06 1740289 /lib/libdl-2.14.1.so
0ff7b000-0ff8a000 ---p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
0ff8a000-0ff8b000 r--p 00002000 08:06 1740289 /lib/libdl-2.14.1.so
0ff8b000-0ff8c000 rw-p 00003000 08:06 1740289 /lib/libdl-2.14.1.so
0ff9c000-0ffa3000 r-xp 00000000 08:06 1204137 /usr/lib/libffi.so.5.0.10
0ffa3000-0ffb3000 ---p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
0ffb3000-0ffb4000 r--p 00007000 08:06 1204137 /usr/lib/libffi.so.5.0.10
0ffb4000-0ffb5000 rw-p 00008000 08:06 1204137 /usr/lib/libffi.so.5.0.10
0ffc5000-0ffdc000 r-xp 00000000 08:06 1740593 /lib/libpthread-2.14.1.so
0ffdc000-0ffec000 ---p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
0ffec000-0ffed000 r--p 00017000 08:06 1740593 /lib/libpthread-2.14.1.so
0ffed000-0ffee000 rw-p 00018000 08:06 1740593 /lib/libpthread-2.14.1.so
0ffee000-0fff0000 rw-p 00000000 00:00 0
10000000-106b2000 r-xp 00000000 08:06 1468037 /home/hiyuh/git-repos/nvc/src/nvc
106c1000-106d8000 r--p 006b1000 08:06 1468037 /home/hiyuh/git-repos/nvc/src/nvc
106d8000-106e3000 rw-p 006c8000 08:06 1468037 /home/hiyuh/git-repos/nvc/src/nvc
106e3000-106ea000 rwxp 00000000 00:00 0
10ea3000-10f08000 rwxp 00000000 00:00 0 [heap]
48000000-48020000 r-xp 00000000 08:06 1740829 /lib/ld-2.14.1.so
48020000-48021000 rw-p 00000000 00:00 0
48021000-48022000 r--p 00021000 08:06 1740829 /lib/ld-2.14.1.so
48022000-48023000 rw-p 00022000 08:06 1740829 /lib/ld-2.14.1.so
48023000-48025000 rw-p 00000000 00:00 0
4802d000-48031000 rw-p 00000000 00:00 0
48031000-480c1000 rwxp 00000000 00:00 0
bf998000-bf9b9000 rw-p 00000000 00:00 0 [stack]
failed
/home/hiyuh/git-repos/nvc/src/nvc -a /home/hiyuh/git-repos/nvc/test/regress/fact.vhd
[gc: freed 742 trees; 414 allocated]
/home/hiyuh/git-repos/nvc/src/nvc -e fact
Linking bitcode file '/home/hiyuh/git-repos/nvc/test/logs/fact/work/_WORK.FACT.elab.bc'
Linked in file '/home/hiyuh/git-repos/nvc/test/logs/fact/work/_WORK.FACT.elab.bc'
Generating Bitcode To /home/hiyuh/git-repos/nvc/test/logs/fact/work/_WORK.FACT.final.bc
===-------------------------------------------------------------------------===
... Statistics Collected ...
===-------------------------------------------------------------------------===

1 cgscc-passmgr - Maximum CGSCCPassMgr iterations on one SCC
5 globaldce - Number of functions removed
2 globalopt - Number of aggregate globals broken into scalars
7 globalopt - Number of globals marked unnamed_addr
5 globalsmodref-aa - Number of global vars without address taken
3 gvn - Number of instructions deleted
3 gvn - Number of loads deleted
3 instcombine - Number of insts combined
2 licm - Number of instructions hoisted out of loop
1 licm - Number of load insts hoisted or sunk
2 licm - Number of memory locations promoted to registers
3 memdep - Number of block queries that were completely cached
5 memdep - Number of uncached non-local ptr responses

[gc: freed 2 trees; 738 allocated]
/usr/bin/llvm-ld -v -r -stats -b /home/hiyuh/git-repos/nvc/test/logs/fact/work/_WORK.FACT.final.bc /home/hiyuh/git-repos/nvc/test/logs/fact/work/_WORK.FACT.elab.bc
/home/hiyuh/git-repos/nvc/src/nvc -r fact
Stack dump:
0. Running pass 'Loop Pass Manager' on function '@":fact(test):uut:_proc"'

  1.  Running pass 'Loop Strength Reduction' on basic block '%while'
    

[SNIP]

maybe, my ruby is broken?

and just for the record, "make check" depends ruby + gem is really nasty for distro packaging...

from nvc.

hiyuh avatar hiyuh commented on May 30, 2024

now I realize my gcc breaks some programs w/ -Os.
using valgrind which is build w/ -O2, fact looks fine to me too:

[gc: freed 742 trees; 414 allocated]
[gc: freed 2 trees; 738 allocated]
/usr/bin/llvm-ld -v -r -stats -b /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc /home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc
Linking bitcode file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Linked in file '/home/hiyuh/git-repos/nvc/work/_WORK.FACT.elab.bc'
Generating Bitcode To /home/hiyuh/git-repos/nvc/work/_WORK.FACT.final.bc
===-------------------------------------------------------------------------===
... Statistics Collected ...
===-------------------------------------------------------------------------===

1 cgscc-passmgr - Maximum CGSCCPassMgr iterations on one SCC
5 globaldce - Number of functions removed
2 globalopt - Number of aggregate globals broken into scalars
7 globalopt - Number of globals marked unnamed_addr
5 globalsmodref-aa - Number of global vars without address taken
3 gvn - Number of instructions deleted
3 gvn - Number of loads deleted
3 instcombine - Number of insts combined
2 licm - Number of instructions hoisted out of loop
1 licm - Number of load insts hoisted or sunk
2 licm - Number of memory locations promoted to registers
3 memdep - Number of block queries that were completely cached
5 memdep - Number of uncached non-local ptr responses

==24509== Memcheck, a memory error detector
==24509== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==24509== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==24509== Command: ./src/nvc -r fact
==24509==
0ms+1: Report Note: 1
File test/regress/fact.vhd, Line 41
0ms+3: Report Note: 2
File test/regress/fact.vhd, Line 41
0ms+5: Report Note: 6
File test/regress/fact.vhd, Line 41
0ms+7: Report Note: 24
File test/regress/fact.vhd, Line 41
0ms+9: Report Note: 120
File test/regress/fact.vhd, Line 41
0ms+11: Report Note: 720
File test/regress/fact.vhd, Line 41
0ms+13: Report Note: 5040
File test/regress/fact.vhd, Line 41
0ms+15: Report Note: 40320
File test/regress/fact.vhd, Line 41
0ms+17: Report Note: 362880
File test/regress/fact.vhd, Line 41
0ms+19: Report Note: 3628800
File test/regress/fact.vhd, Line 41
0ms+21: Report Note: 39916800
File test/regress/fact.vhd, Line 41
0ms+23: Report Note: 479001600
File test/regress/fact.vhd, Line 41
0ms+25: Report Note: 1932053504
File test/regress/fact.vhd, Line 41
0ms+27: Report Note: 1278945280
File test/regress/fact.vhd, Line 41
0ms+29: Report Note: 2004310016
File test/regress/fact.vhd, Line 41
==24509==
==24509== HEAP SUMMARY:
==24509== in use at exit: 155,082 bytes in 2,463 blocks
==24509== total heap usage: 6,428 allocs, 3,965 frees, 1,016,954 bytes allocated
==24509==
==24509== LEAK SUMMARY:
==24509== definitely lost: 0 bytes in 0 blocks
==24509== indirectly lost: 0 bytes in 0 blocks
==24509== possibly lost: 0 bytes in 0 blocks
==24509== still reachable: 155,082 bytes in 2,463 blocks
==24509== suppressed: 0 bytes in 0 blocks
==24509== Rerun with --leak-check=full to see details of leaked memory
==24509==
==24509== For counts of detected and suppressed errors, rerun with: -v
==24509== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 5)

maybe, my ruby or llvm may also be broken by -Os.
feel free to close this issue if you're OK.
sorry for noise from stupid gentoo ricer. :D

from nvc.

nickg avatar nickg commented on May 30, 2024

OK, I'll close it. I'd still like to know what's going on here but the stack trace is somewhere deep inside the LLVM JIT code.

from nvc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.