LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 697|回复: 3

是不是我的gentoo没装好?

[复制链接]
发表于 2009-6-5 22:32:16 | 显示全部楼层 |阅读模式
装完gentoo,用valgrind测试代码有很多问题。
$ cat 1.c
int main()
{
  return 0;
}

$ gcc 1.c -o 1
$ valgrind -v --track-origins=yes --trace-children=yes --undef-value-errors=yes --leak-check=full --show-reachable=yes --log-file=debug.log ./1

很多错误信息:
==4528== 401 errors in context 297 of 297:
==4528== Use of uninitialised value of size 8
==4528==    at 0x4009082: (within /lib64/ld-2.10.1.so)
==4528==    by 0x40095AD: (within /lib64/ld-2.10.1.so)
==4528==    by 0x400AD28: (within /lib64/ld-2.10.1.so)
==4528==    by 0x40039D8: (within /lib64/ld-2.10.1.so)
==4528==    by 0x401422B: (within /lib64/ld-2.10.1.so)
==4528==    by 0x4001471: (within /lib64/ld-2.10.1.so)
==4528==    by 0x4000BA7: (within /lib64/ld-2.10.1.so)
==4528==  Uninitialised value was created by a stack allocation
==4528==    at 0x4003BE1: (within /lib64/ld-2.10.1.so)
--4528--
--4528-- supp:     21 dl-hack3-cond-2
--4528-- supp:      4 dl-hack3-cond-3
--4528-- supp:    855 dl-hack3-cond-1
==4528==
==4528== IN SUMMARY: 3805 errors from 297 contexts (suppressed: 880 from 3)
==4528==
==4528== malloc/free: in use at exit: 0 bytes in 0 blocks.
==4528== malloc/free: 0 allocs, 0 frees, 0 bytes allocated.
==4528==
==4528== All heap blocks were freed -- no leaks are possible.
--4528--  memcheck: sanity checks: 0 cheap, 1 expensive
--4528--  memcheck: auxmaps: 0 auxmap entries (0k, 0M) in use
--4528--  memcheck: auxmaps_L1: 0 searches, 0 cmps, ratio 0:10
--4528--  memcheck: auxmaps_L2: 0 searches, 0 nodes
--4528--  memcheck: SMs: n_issued      = 13 (208k, 0M)
--4528--  memcheck: SMs: n_deissued    = 0 (0k, 0M)
--4528--  memcheck: SMs: max_noaccess  = 524287 (8388592k, 8191M)
--4528--  memcheck: SMs: max_undefined = 0 (0k, 0M)
--4528--  memcheck: SMs: max_defined   = 118 (1888k, 1M)
--4528--  memcheck: SMs: max_non_DSM   = 13 (208k, 0M)
--4528--  memcheck: max sec V bit nodes:    92 (7k, 0M)
--4528--  memcheck: set_sec_vbits8 calls: 1258 (new: 92, updates: 1166)
--4528--  memcheck: max shadow mem size:   4359k, 4M
--4528--  ocacheL1:    2,182,637 refs        251,780 misses (0 lossage)
--4528--  ocacheL1:    1,923,048 at 0          7,809 at 1
--4528--  ocacheL1:            0 at 2+       251,842 move-fwds
--4528--  ocacheL1:  100,663,296 sizeB    67,108,864 useful
--4528--  ocacheL2:      251,780 refs        251,780 misses
--4528--  ocacheL2:            0 max nodes         0 curr nodes
--4528--  niacache:        2,256 refs            374 misses
--4528-- translate:            fast SP updates identified: 1,130 ( 88.6%)
--4528-- translate:   generic_known SP updates identified: 103 (  8.0%)
--4528-- translate: generic_unknown SP updates identified: 42 (  3.2%)
--4528--     tt/tc: 3,032 tt lookups requiring 3,047 probes
--4528--     tt/tc: 3,032 fast-cache updates, 2 flushes
--4528--  transtab: new        1,510 (35,136 -> 802,717; ratio 228:10) [0 scs]
--4528--  transtab: dumped     0 (0 -> ??)
--4528--  transtab: discarded  0 (0 -> ??)
--4528-- scheduler: 21,528 jumps (bb entries).
--4528-- scheduler: 0/1,566 major/minor sched events.
--4528--    sanity: 1 cheap, 1 expensive checks.
--4528--    exectx: 1,543 lists, 1,463 contexts (avg 0 per list)
--4528--    exectx: 5,822 searches, 5,291 full compares (908 per 1000)
--4528--    exectx: 110,212 cmp2, 6,379 cmp4, 0 cmpAll
--4528--  errormgr: 398 supplist searches, 23,632 comparisons during search
--4528--  errormgr: 4,685 errlist searches, 174,347 comparisons during search
 楼主| 发表于 2009-6-5 22:36:13 | 显示全部楼层
OS系统是最新的,刚更新过:
Linux localhost 2.6.29-gentoo-r5 #2 SMP Sat May 30 14:15:20 CST 2009 x86_64 Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz GenuineIntel GNU/Linux
回复 支持 反对

使用道具 举报

发表于 2009-6-6 21:15:26 | 显示全部楼层
emerge --info看看系统基本情况
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-6-7 09:44:07 | 显示全部楼层
我又试了一下,gcc升级到 gcc-4.3.3-r2,就会出现上面到问题
现在使用4.3.2-r3,是正常的
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表