gpt4 book ai didi

c++ - Valgrind 在 ATI 上运行 opengl 程序时报告很多错误 - 我应该担心吗?

转载 作者:行者123 更新时间:2023-12-03 09:46:26 25 4
gpt4 key购买 nike

关闭。这个问题需要debugging details .它目前不接受答案。












想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。

9 个月前关闭。




Improve this question




我有一个非常复杂的 OpenGL 应用程序,它运行在带有 ATI 图形芯片的嵌入式设备上,运行 RT linux。应用程序的部分通过单元测试进行测试。它们都通过了,并且没有报告内存泄漏或无效访问。但是,该应用程序有一些怪癖,并且有些事情表现不佳。

今天我尝试使用 valgrind 运行这个应用程序,在初始化期间我看到一些无效的内存读/写,所有这些都与 ATI 驱动程序有关:

==14347== Invalid read of size 8
==14347== at 0x67C3868: ??? (in /usr/lib/catalyst/libGL.so.1.2)
==14347== Address 0x8f6b398 is 208 bytes inside a block of size 212 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0x6762701: ??? (in /usr/lib/catalyst/libGL.so.1.2)
==14347== by 0x8F6B05F: ???
==14347==
==14347== Syscall param ioctl(generic) points to uninitialised byte(s)
==14347== at 0x8A57B9: ioctl (in /lib/libc-2.14.1.so)
==14347== by 0x6A0E345: ukiCreateContext (in /usr/lib/catalyst/libatiuki.so.1.0)
==14347== by 0xA9D4570: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xbeceacb4 is on thread 1's stack
==14347==
==14347== Conditional jump or move depends on uninitialised value(s)
==14347== at 0xAA46C42: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0xAA46285: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0xAA46484: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0xAA36F32: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAA7B4: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2000 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid read of size 4
==14347== at 0xAAAA95D: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77d2000 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA8F3: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2000 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA8F7: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2010 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA8FC: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2020 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA901: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2030 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA91A: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2040 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA91F: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2050 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA924: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2060 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAA929: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb77c2070 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC2D1: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163000 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC584: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163010 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC588: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163020 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0DD: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163550 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0E3: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163554 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0E9: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb7163558 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0EF: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb716355c is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0C5: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70e9300 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0CB: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70e9304 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0D1: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70e9308 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0D7: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70e930c is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC558: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb870b78 is 3,160 bytes inside a block of size 3,164 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA835931: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC418: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb897c68 is 3,160 bytes inside a block of size 3,164 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACAE9: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1600 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACAF3: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1610 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACAFD: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1620 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACB07: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1630 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACB11: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1640 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC88F: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1800 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC893: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1810 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8A2: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1820 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8A7: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1830 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8B6: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1840 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8BB: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1850 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8D0: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1860 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC8D5: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1870 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0AD: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1c00 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0B3: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1c04 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0B9: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1c08 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0BF: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1c0c is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC558: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x4F: ???
==14347== Address 0x8aa8cb8 is 0 bytes after a block of size 80 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x3F: ???
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC09B: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1400 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0A1: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1404 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 4
==14347== at 0xAAAC0A7: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1408 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACADF: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1000 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC418: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x63010100: ???
==14347== Address 0x89c6d58 is 0 bytes after a block of size 224 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC508: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x63010100: ???
==14347== Address 0xbe44b08 is 0 bytes after a block of size 384 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAACAD5: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1100 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC698: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xbefdb08 is 3,240 bytes inside a block of size 3,244 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Syscall param ioctl(generic) points to uninitialised byte(s)
==14347== at 0x8A57B9: ioctl (in /lib/libc-2.14.1.so)
==14347== by 0xA9DCE45: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x8A1AA8F: ???
==14347== Address 0xbecf8984 is on thread 1's stack
==14347==
==14347== Syscall param ioctl(generic) points to uninitialised byte(s)
==14347== at 0x8A57B9: ioctl (in /lib/libc-2.14.1.so)
==14347== by 0xA9DD354: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xbecf89f0 is on thread 1's stack
==14347==
==14347== Invalid read of size 8
==14347== at 0xAAAC558: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x63010100: ???
==14347== Address 0xc7c1288 is 0 bytes after a block of size 3,568 alloc'd
==14347== at 0x400AE44: malloc (vg_replace_malloc.c:270)
==14347== by 0xA9A33CE: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== by 0x63010100: ???
==14347==
==14347== Invalid write of size 4
==14347== at 0x9BDC84A: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb70c1a00 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Conditional jump or move depends on uninitialised value(s)
==14347== at 0x938F092: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Conditional jump or move depends on uninitialised value(s)
==14347== at 0x93B9F10: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC764: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb6ec2010 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC768: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb6ec2020 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Conditional jump or move depends on uninitialised value(s)
==14347== at 0x9F83794: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC4E4: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb6ec2210 is not stack'd, malloc'd or (recently) free'd
==14347==
==14347== Invalid write of size 8
==14347== at 0xAAAC4E8: ??? (in /usr/lib/dri/fglrx_dri.so)
==14347== Address 0xb6ec2220 is not stack'd, malloc'd or (recently) free'd
==14347==

我很清楚这些读/写是未定义的行为,而且 ATI 在 linux 上有坏驱动程序的名声。

问题是,我应该担心这些错误吗?我知道 valgrind 有时会报告错误的问题。

最佳答案

Valgrind 可能会产生误报,尤其是在读取时。由于填充字节,这通常在将结构复制为块内存时发生,例如使用 memcopy。
如果读取在分配的块内,这通常没问题。从释放的内存中读取不是。
但是,无效的写入通常是一个问题。
在这种情况下,因为这是一个驱动程序,我怀疑这些与直接内存访问/内存映射 I/O 相关,因此“未堆栈”、“分配”或“(最近)释放”等是好的。

关于c++ - Valgrind 在 ATI 上运行 opengl 程序时报告很多错误 - 我应该担心吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16162833/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com