如果我调用clGetPlatformIDs并直接在它之后调用SDL_Quit(),程序崩溃(segfault)。 OpenGL版本似乎根本不重要(尝试过2.1,3.1,3.2,3.3)。操作系统是Fedora 18,完全更新。我已经安装了fglrx驱动程序。
问题似乎不仅仅是SDL; GLFW在glfwTerminate()上发生了非常类似的崩溃。 GLFW并没有告诉我任何关于坠机的事情,只是它是一个段错误。但幸运的是,SDL提供了更多信息:
*** glibc detected *** bin/Debug/voxel renderer: double free or corruption (fasttop): 0x0000000001086220 ***
======= Backtrace: =========
/lib64/libc.so.6[0x322c87ca8e]
/usr/local/lib/libSDL2-2.0.so.0(+0xb0a56)[0x7f256e97ba56]
/usr/local/lib/libSDL2-2.0.so.0(SDL_VideoQuit+0x6e)[0x7f256e960d4e]
/usr/local/lib/libSDL2-2.0.so.0(SDL_QuitSubSystem+0x18d)[0x7f256e8daded]
/usr/local/lib/libSDL2-2.0.so.0(SDL_Quit+0x18)[0x7f256e8daf18]
/usr/local/lib/libSDL2-2.0.so.0(+0x10d5f)[0x7f256e8dbd5f]
/lib64/libpthread.so.0[0x322d00f000]
======= Memory map: ========
00400000-00408000 r-xp 00000000 fd:02 13762941 /home/julius/Ohjelmointi/Raytracer/bin/Debug/voxel renderer
00607000-00608000 r--p 00007000 fd:02 13762941 /home/julius/Ohjelmointi/Raytracer/bin/Debug/voxel renderer
00608000-00609000 rw-p 00008000 fd:02 13762941 /home/julius/Ohjelmointi/Raytracer/bin/Debug/voxel renderer
01083000-028e5000 rw-p 00000000 00:00 0 [heap]
322c400000-322c420000 r-xp 00000000 fd:01 669659 /usr/lib64/ld-2.16.so
322c620000-322c621000 r--p 00020000 fd:01 669659 /usr/lib64/ld-2.16.so
322c621000-322c622000 rw-p 00021000 fd:01 669659 /usr/lib64/ld-2.16.so
322c622000-322c623000 rw-p 00000000 00:00 0
322c800000-322c9ad000 r-xp 00000000 fd:01 669660 /usr/lib64/libc-2.16.so
322c9ad000-322cbad000 ---p 001ad000 fd:01 669660 /usr/lib64/libc-2.16.so
322cbad000-322cbb1000 r--p 001ad000 fd:01 669660 /usr/lib64/libc-2.16.so
322cbb1000-322cbb3000 rw-p 001b1000 fd:01 669660 /usr/lib64/libc-2.16.so
322cbb3000-322cbb8000 rw-p 00000000 00:00 0
322cc00000-322cc03000 r-xp 00000000 fd:01 669661 /usr/lib64/libdl-2.16.so
322cc03000-322ce02000 ---p 00003000 fd:01 669661 /usr/lib64/libdl-2.16.so
322ce02000-322ce03000 r--p 00002000 fd:01 669661 /usr/lib64/libdl-2.16.so
322ce03000-322ce04000 rw-p 00003000 fd:01 669661 /usr/lib64/libdl-2.16.so
322d000000-322d016000 r-xp 00000000 fd:01 669662 /usr/lib64/libpthread-2.16.so
322d016000-322d216000 ---p 00016000 fd:01 669662 /usr/lib64/libpthread-2.16.so
322d216000-322d217000 r--p 00016000 fd:01 669662 /usr/lib64/libpthread-2.16.so
322d217000-322d218000 rw-p 00017000 fd:01 669662 /usr/lib64/libpthread-2.16.so
322d218000-322d21c000 rw-p 00000000 00:00 0
322d400000-322d407000 r-xp 00000000 fd:01 669663 /usr/lib64/librt-2.16.so
322d407000-322d606000 ---p 00007000 fd:01 669663 /usr/lib64/librt-2.16.so
322d606000-322d607000 r--p 00006000 fd:01 669663 /usr/lib64/librt-2.16.so
322d607000-322d608000 rw-p 00007000 fd:01 669663 /usr/lib64/librt-2.16.so
322dc00000-322dd00000 r-xp 00000000 fd:01 663279 /usr/lib64/libm-2.16.so
322dd00000-322deff000 ---p 00100000 fd:01 663279 /usr/lib64/libm-2.16.so
322deff000-322df00000 r--p 000ff000 fd:01 663279 /usr/lib64/libm-2.16.so
322df00000-322df01000 rw-p 00100000 fd:01 663279 /usr/lib64/libm-2.16.so
322e800000-322e815000 r-xp 00000000 fd:01 669679 /usr/lib64/libgcc_s-4.7.2-20121109.so.1
322e815000-322ea14000 ---p 00015000 fd:01 669679 /usr/lib64/libgcc_s-4.7.2-20121109.so.1
322ea14000-322ea15000 r--p 00014000 fd:01 669679 /usr/lib64/libgcc_s-4.7.2-20121109.so.1
322ea15000-322ea16000 rw-p 00015000 fd:01 669679 /usr/lib64/libgcc_s-4.7.2-20121109.so.1
3230800000-32308e5000 r-xp 00000000 fd:01 669721 /usr/lib64/libstdc++.so.6.0.17
32308e5000-3230ae4000 ---p 000e5000 fd:01 669721 /usr/lib64/libstdc++.so.6.0.17
3230ae4000-3230aec000 r--p 000e4000 fd:01 669721 /usr/lib64/libstdc++.so.6.0.17
3230aec000-3230aee000 rw-p 000ec000 fd:01 669721 /usr/lib64/libstdc++.so.6.0.17
3230aee000-3230b03000 rw-p 00000000 00:00 0
3230c00000-3230d34000 r-xp 00000000 fd:01 669700 /usr/lib64/libX11.so.6.3.0
3230d34000-3230f34000 ---p 00134000 fd:01 669700 /usr/lib64/libX11.so.6.3.0
3230f34000-3230f35000 r--p 00134000 fd:01 669700 /usr/lib64/libX11.so.6.3.0
3230f35000-3230f3a000 rw-p 00135000 fd:01 669700 /usr/lib64/libX11.so.6.3.0
3231000000-3231002000 r-xp 00000000 fd:01 669698 /usr/lib64/libXau.so.6.0.0
3231002000-3231202000 ---p 00002000 fd:01 669698 /usr/lib64/libXau.so.6.0.0
3231202000-3231203000 r--p 00002000 fd:01 669698 /usr/lib64/libXau.so.6.0.0
3231203000-3231204000 rw-p 00003000 fd:01 669698 /usr/lib64/libXau.so.6.0.0
3231400000-323141d000 r-xp 00000000 fd:01 669699 /usr/lib64/libxcb.so.1.1.0
323141d000-323161c000 ---p 0001d000 fd:01 669699 /usr/lib64/libxcb.so.1.1.0
323161c000-323161d000 r--p 0001c000 fd:01 669699 /usr/lib64/libxcb.so.1.1.0
323161d000-323161e000 rw-p 0001d000 fd:01 669699 /usr/lib64/libxcb.so.1.1.0
3231c00000-3231c11000 r-xp 00000000 fd:01 669716 /usr/lib64/libXext.so.6.4.0
3231c11000-3231e10000 ---p 00011000 fd:01 669716 /usr/lib64/libXext.so.6.4.0
3231e10000-3231e11000 r--p 00010000 fd:01 669716 /usr/lib64/libXext.so.6.4.0
3231e11000-3231e12000 rw-p 00011000 fd:01 669716 /usr/lib64/libXext.so.6.4.0
3232c00000-3232c09000 r-xp 00000000 fd:01 669715 /usr/lib64/libXrender.so.1.3.0
3232c09000-3232e08000 ---p 00009000 fd:01 669715 /usr/lib64/libXrender.so.1.3.0
3232e08000-3232e09000 r--p 00008000 fd:01 669715 /usr/lib64/libXrender.so.1.3.0
3232e09000-3232e0a000 rw-p 00009000 fd:01 669715 /usr/lib64/libXrender.so.1.3.0
3233000000-3233002000 r-xp 00000000 fd:01 669729 /usr/lib64/libXinerama.so.1.0.0
3233002000-3233201000 ---p 00002000 fd:01 669729 /usr/lib64/libXinerama.so.1.0.0
3233201000-3233202000 r--p 00001000 fd:01 669729 /usr/lib64/libXinerama.so.1.0.0
3233202000-3233203000 rw-p 00002000 fd:01 669729 /usr/lib64/libXinerama.so.1.0.0
3233c00000-3233c09000 r-xp 00000000 fd:01 669731 /usr/lib64/libXrandr.so.2.2.0
3233c09000-3233e08000 ---p 00009000 fd:01 669731 /usr/lib64/libXrandr.so.2.2.0
3233e08000-3233e09000 r--p 00008000 fd:01 669731 /usr/lib64/libXrandr.so.2.2.0
3233e09000-3233e0a000 rw-p 00009000 fd:01 669731 /usr/lib64/libXrandr.so.2.2.0
3235800000-32358bf000 r-xp 00000000 fd:01 794670 /usr/lib64/catalyst/libGL.so.1.2
32358bf000-32359bf000 ---p 000bf000 fd:01 794670 /usr/lib64/catalyst/libGL.so.1.2
32359bf000-32359e6000 rwxp 000bf000 fd:01 794670 /usr/lib64/catalyst/libGL.so.1.2
32359e6000-3235a08000 rwxp 00000000 00:00 0
3235c00000-3235c0f000 r-xp 00000000 fd:01 794669 /usr/lib64/catalyst/libatiuki.so.1.0
3235c0f000-3235d0e000 ---p 0000f000 fd:01 794669 /usr/lib64/catalyst/libatiuki.so.1.0
3235d0e000-3235d1a000 rw-p 0000e000 fd:01 794669 /usr/lib64/catalyst/libatiuki.so.1.0
323f600000-323f604000 r-xp 00000000 fd:01 669766 /usr/lib64/libXxf86vm.so.1.0.0
323f604000-323f804000 ---p 00004000 fd:01 669766 /usr/lib64/libXxf86vm.so.1.0.0
323f804000-323f805000 r--p 00004000 fd:01 669766 /usr/lib64/libXxf86vm.so.1.0.0
323f805000-323f806000 rw-p 00005000 fd:01 669766 /usr/lib64/libXxf86vm.so.1.0.0
3a2e200000-3a2e276000 r-xp 00000000 fd:01 655591 /usr/lib64/libGLEW.so.1.7.0
3a2e276000-3a2e475000 ---p 00076000 fd:01 655591 /usr/lib64/libGLEW.so.1.7.0
3a2e475000-3a2e47b000 r--p 00075000 fd:01 655591 /usr/lib64/libGLEW.so.1.7.0
3a2e47b000-3a2e47c000 rw-p 0007b000 fd:01 655591 /usr/lib64/libGLEW.so.1.7.0
3a2e47c000-3a2e480000 rw-p 00000000 00:00 0
3c2ce00000-3c2ce7d000 r-xp 00000000 fd:01 663378 /usr/lib64/libGLU.so.1.3.1
3c2ce7d000-3c2d07c000 ---p 0007d000 fd:01 663378 /usr/lib64/libGLU.so.1.3.1
3c2d07c000-3c2d07e000 r--p 0007c000 fd:01 663378 /usr/lib64/libGLU.so.1.3.1
3c2d07e000-3c2d07f000 rw-p 0007e000 fd:01 663378 /usr/lib64/libGLU.so.1.3.1
7f2564000000-7f25644c2000 rw-p 00000000 00:00 0
7f25644c2000-7f2568000000 ---p 00000000 00:00 0
7f25688c3000-7f25688c4000 ---p 00000000 00:00 0
7f25688c4000-7f2568904000 rw-p 00000000 00:00 0
7f2568904000-7f2568905000 rw-s 1cee5000 00:05 19449 /dev/ati/card0
7f2568905000-7f2568966000 rw-s 1cee4000 00:05 19449 /dev/ati/card0
7f2568966000-7f2568986000 rw-s 00004000 00:05 19449 /dev/ati/card0
7f2568986000-7f2568988000 rw-s 00002000 00:05 19449 /dev/ati/card0
7f2568988000-7f256ab96000 r-xp 00000000 fd:01 926157 /opt/AMDAPP/lib/x86_64/libamdocl64.so
7f256ab96000-7f256ad96000 ---p 0220e000 fd:01 926157 /opt/AMDAPP/lib/x86_64/libamdocl64.so
7f256ad96000-7f256afa9000 rw-p 0220e000 fd:01 926157 /opt/AMDAPP/lib/x86_64/libamdocl64.so
7f256afa9000-7f256b0bd000 rw-p 00000000 00:00 0
7f256b2bf000-7f256b308000 rw-p 00000000 00:00 0
7f256b308000-7f256b348000 rw-s 00027000 00:05 19449 /dev/ati/card0
7f256b348000-7f256ba48000 rw-s 00006000 00:05 19449 /dev/ati/card0
7f256ba82000-7f256ba89000 r--s 00000000 fd:01 791548 /usr/lib64/gconv/gconv-modules.cache
7f256ba89000-7f256bd09000 rw-p 00000000 00:00 0
7f256bd09000-7f256bd5a000 r-xp 00000000 fd:01 794075 /usr/lib64/catalyst/libatiadlxx.so
7f256bd5a000-7f256be5a000 ---p 00051000 fd:01 794075 /usr/lib64/catalyst/libatiadlxx.so
7f256be5a000-7f256be66000 rw-p 00051000 fd:01 794075 /usr/lib64/catalyst/libatiadlxx.so
7f256be66000-7f256be76000 rw-p 00000000 00:00 0
7f256be94000-7f256be95000 rw-s 00005000 00:05 19449 /dev/ati/card0
7f256be95000-7f256beb5000 rw-s 00004000 00:05 19449 /dev/ati/card0
7f256beb5000-7f256db10000 r-xp 00000000 fd:01 794085 /usr/lib64/dri/fglrx_dri.so
7f256db10000-7f256dc10000 ---p 01c5b000 fd:01 794085 /usr/lib64/dri/fglrx_dri.so
7f256dc10000-7f256dd76000 rwxp 01c5b000 fd:01 794085 /usr/lib64/dri/fglrx_dri.so
7f256dd76000-7f256de9a000 rwxp 00000000 00:00 0
7f256de9a000-7f256de9b000 ---p 00000000 00:00 0
7f256de9b000-7f256e6a5000 rw-p 00000000 00:00 0 [stack:27487]
7f256e6a5000-7f256e6ab000 r-xp 00000000 fd:01 926159 /opt/AMDAPP/lib/x86_64/libOpenCL.so.1
7f256e6ab000-7f256e8aa000 ---p 00006000 fd:01 926159 /opt/AMDAPP/lib/x86_64/libOpenCL.so.1
7f256e8aa000-7f256e8ab000 rw-p 00005000 fd:01 926159 /opt/AMDAPP/lib/x86_64/libOpenCL.so.1
7f256e8ab000-7f256e8ad000 rw-p 00000000 00:00 0
7f256e8b5000-7f256e8b6000 rw-p 00000000 00:00 0
7f256e8c8000-7f256e8c9000 rw-p 00000000 00:00 0
7f256e8c9000-7f256e8cb000 rw-s 00002000 00:05 19449 /dev/ati/card0
7f256e8cb000-7f256e9a7000 r-xp 00000000 fd:01 656113 /usr/local/lib/libSDL2-2.0.so.0.0.0
7f256e9a7000-7f256eba7000 ---p 000dc000 fd:01 656113 /usr/local/lib/libSDL2-2.0.so.0.0.0
7f256eba7000-7f256ebaa000 r--p 000dc000 fd:01 656113 /usr/local/lib/libSDL2-2.0.so.0.0.0
7f256ebaa000-7f256ebb5000 rw-p 000df000 fd:01 656113 /usr/local/lib/libSDL2-2.0.so.0.0.0
7f256ebb5000-7f256ebb9000 rw-p 00000000 00:00 0
7ffff46c4000-7ffff46e5000 rw-p 00000000 00:00 0 [stack]
7ffff47ff000-7ffff4800000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
尽管如此,我找不到它崩溃原因的确切原因。在崩溃之前,OpenCL,OpenGL和SDL都按预期工作。
那么,有没有人知道什么可能导致OpenCL这种崩溃?