寻求帮忙解决一下valgrind错误

内核编译和嵌入式产品的设计与开发
回复
yzcwestlife
帖子: 30
注册时间: 2009-09-15 18:34
送出感谢: 0
接收感谢: 0

寻求帮忙解决一下valgrind错误

#1

帖子 yzcwestlife » 2010-09-09 12:32

我用C写了个程序,但用valgrind检查总是出错。请大家帮我看看吧
(注:Uori是我写的一个class)


==3083== Memcheck, a memory error detector
==3083== Copyright (C) 2002-2009, and GNU GPL'd, by Julian Seward et al.
==3083== Using Valgrind-3.6.0.SVN-Debian and LibVEX; rerun with -h for copyright info
==3083== Command: ./grp
==3083==
==3083== Warning: client switching stacks? SP change: 0x7feffffc8 --> 0x7fe6e86c0
==3083== to suppress, use: --max-stackframe=9533704 or greater
==3083== Invalid write of size 8
==3083== at 0x409A51: GRPscheme(Uori***, Uori***, Uori***, Uori***, Uori***, Uori***, Uori***) (grpalgorithm.cpp:3)
==3083== by 0x40F205: main (GRP3d.cpp:101)
==3083== Address 0x7fe6e8738 is on thread 1's stack
==3083==
==3083==
==3083== Process terminating with default action of signal 11 (SIGSEGV)
==3083== Access not within mapped region at address 0x7FE6E8738
==3083== at 0x409A51: GRPscheme(Uori***, Uori***, Uori***, Uori***, Uori***, Uori***, Uori***) (grpalgorithm.cpp:3)
==3083== If you believe this happened as a result of a stack
==3083== overflow in your program's main thread (unlikely but
==3083== possible), you can try to increase the size of the
==3083== main thread stack using the --main-stacksize= flag.
==3083== The main thread stack size used in this run was 8388608.
==3083==
==3083== Process terminating with default action of signal 11 (SIGSEGV)
==3083== Access not within mapped region at address 0x7FE6E86B8
==3083== at 0x4A2369F: _vgnU_freeres (vg_preloaded.c:58)
==3083== If you believe this happened as a result of a stack
==3083== overflow in your program's main thread (unlikely but
==3083== possible), you can try to increase the size of the
==3083== main thread stack using the --main-stacksize= flag.
==3083== The main thread stack size used in this run was 8388608.
==3083==
==3083== HEAP SUMMARY:
==3083== in use at exit: 66,950,576 bytes in 27,349 blocks
==3083== total heap usage: 27,349 allocs, 0 frees, 66,950,576 bytes allocated
==3083==
==3083== LEAK SUMMARY:
==3083== definitely lost: 0 bytes in 0 blocks
==3083== indirectly lost: 0 bytes in 0 blocks
==3083== possibly lost: 0 bytes in 0 blocks
==3083== still reachable: 66,950,576 bytes in 27,349 blocks
==3083== suppressed: 0 bytes in 0 blocks
==3083== Rerun with --leak-check=full to see details of leaked memory
==3083==
==3083== For counts of detected and suppressed errors, rerun with: -v
==3083== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 4 from 4)
段错误
头像
linjiework
帖子: 240
注册时间: 2009-07-07 19:52
送出感谢: 0
接收感谢: 0

Re: 寻求帮忙解决一下valgrind错误

#2

帖子 linjiework » 2010-09-13 11:15

程序崩溃了,你不贴代码,大家咋帮你呢。
阿呆 : 天下第一呆!
回复

回到 “内核及嵌入式开发”