写的qt程序为hello,然后运行命令为:valgrind ./hello,然后就报了如下错误:
==32140==
==32140== Process terminating with default action of signal 11 (SIGSEGV)
==32140== General Protection Fault
==32140== at 0x222D16E6: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x222DEBD5: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x222DEFFF: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x21BD5C62: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x22093C22: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x21F54D13: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x21F500B6: ??? (in /usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so)
==32140== by 0x96FC232: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0)
==32140== by 0x96D3D03: ??? (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0)
==32140== by 0x96CF811: glXGetFBConfigs (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0)
==32140== by 0x96D0C01: glXChooseFBConfig (in /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0)
==32140== by 0x178A9E16: ??? (in /home/zqh/Qt5.9.7/5.9.7/gcc_64/plugins/xcbglintegrations/libqxcb-glx-integration.so)
==32140==
==32140== HEAP SUMMARY:
==32140== in use at exit: 2,079,049 bytes in 19,963 blocks
==32140== total heap usage: 97,272 allocs, 77,309 frees, 8,220,928 bytes allocated
==32140==
==32140== LEAK SUMMARY:
==32140== definitely lost: 229 bytes in 4 blocks
==32140== indirectly lost: 2,549 bytes in 63 blocks
==32140== possibly lost: 27,040 bytes in 402 blocks
==32140== still reachable: 1,967,127 bytes in 18,823 blocks
==32140== of which reachable via heuristic:
==32140== length64 : 4,904 bytes in 80 blocks
==32140== newarray : 2,096 bytes in 51 blocks
==32140== suppressed: 0 bytes in 0 blocks
==32140== Rerun with --leak-check=full to see details of leaked memory
==32140==
==32140== For counts of detected and suppressed errors, rerun with: -v
==32140== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Killed
解决办法是: 在命令行里添加此行命令:export LIBGL_ALWAYS_SOFTWARE=1