Repository: baldurk/renderdoc

Issue #901: Crash in libGPUPerfAPIGL.so while loading capture
Created: 2018-03-07T17:28:42Z
Ok, seeing my Android device is too old, I thought I would switch to local capture.
So after launching a local linux app, and it tries to load capture, I get a SEGV with this call stack:
#0  strlen () at ../sysdeps/x86_64/strlen.S:106
#1  0x00007fffdcefb2c8 in GPA_HWInfo::SetDeviceName(char const*) () from /home/bram/Downloads/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#2  0x00007fffdcef7f49 in GPA_IMP_GetHWInfo(void*, GPA_HWInfo*) () from /home/bram/Downloads/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#3  0x00007fffdcf00037 in GetHWInfo(void*, GPA_HWInfo*) () from /home/bram/Downloads/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#4  0x00007fffdcf02afe in GPA_OpenContext () from /home/bram/Downloads/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#5  0x00007ffff7286a6e in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#6  0x00007ffff6be75f0 in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#7  0x00007ffff6c70194 in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#8  0x00007ffff6ebfa82 in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#9  0x00007ffff72a1464 in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#10 0x00007ffff7371e8d in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#11 0x00007ffff735d58d in ?? () from /home/bram/Downloads/renderdoc_1.0/bin/../lib/librenderdoc.so
#12 0x0000000000b2687b in ReplayManager::run(int, QString const&, std::function<void (float)>) ()
#13 0x0000000000b271c7 in ?? ()
#14 0x0000000000b26f5d in ?? ()
#15 0x0000000000b2b6ae in std::function<void ()>::operator()() const ()
#16 0x0000000000b2b203 in LambdaThread::process() ()
#17 0x0000000000b2b65a in QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (LambdaThread::*)()>::call(void (LambdaThread::*)(), LambdaThread*, void**) ()
#18 0x0000000000b2b5d0 in void QtPrivate::FunctionPointer<void (LambdaThread::*)()>::call<QtPrivate::List<>, void>(void (LambdaThread::*)(), LambdaThread*, void**) ()
#19 0x0000000000b2b506 in QtPrivate::QSlotObject<void (LambdaThread::*)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) ()
#20 0x0000000001d0fe8a in ?? ()
#21 0x0000000001b4bb9d in ?? ()
#22 0x00007ffff50af6ba in start_thread (arg=0x7fffde7fc700) at pthread_create.c:333
#23 0x00007ffff4bcf41d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

The program log:
Log     - Opening RDCFile /tmp/RenderDoc/biplane_2018.03.07_17.22.55_frame785.rdc
AL lib: (EE) alc_cleanup: 1 device not closed
Log     - Vendor checks for 45 (NVIDIA Corporation / GeForce GTX 750 Ti/PCIe/SSE2 / 4.5.0 NVIDIA 384.111)
Log     - Running GL replay on: NVIDIA Corporation / GeForce GTX 750 Ti/PCIe/SSE2 / 4.5.0 NVIDIA 384.111
Log     - [0]: GL_AMD_multi_draw_indirect, [1]: GL_AMD_seamless_cubemap_per_texture, [2]: GL_ARB_arrays_of_arrays, [3]: GL_ARB_base_instance, [4]: GL_ARB_bindless_texture, [5]: GL_ARB_blend_func_extended, [6]: GL_ARB_buffer_storage, [7]: GL_ARB_clear_buffer_object, [8]: GL_ARB_clear_texture, [9]: GL_ARB_clip_control, [10]: GL_ARB_color_buffer_float, [11]: GL_ARB_compressed_texture_pixel_storage, [12]: GL_ARB_conservative_depth, [13]: GL_ARB_compute_shader, [14]: GL_ARB_compute_variable_group_size, [15]: GL_ARB_conditional_render_inverted, [16]: GL_ARB_copy_buffer, [17]: GL_ARB_copy_image, [18]: GL_ARB_cull_distance, [19]: GL_ARB_debug_output, [20]: GL_ARB_depth_buffer_float, [21]: GL_ARB_depth_clamp, [22]: GL_ARB_depth_texture, [23]: GL_ARB_derivative_control, [24]: GL_ARB_direct_state_access, [25]: GL_ARB_draw_buffers, [26]: GL_ARB_draw_buffers_blend, [27]: GL_ARB_draw_indirect, [28]: GL_ARB_draw_elements_base_vertex, [29]: GL_ARB_draw_instanced, [30]: GL_ARB_enhanced_layouts, [31]: GL_ARB_ES2_compatibility, [32]: GL_ARB_ES3_compatibility, [33]: GL_ARB_ES3_1_compatibility, [34]: GL_ARB_ES3_2_compatibility, [35]: GL_ARB_explicit_attrib_location, [36]: GL_ARB_explicit_uniform_location, [37]: GL_ARB_fragment_coord_conventions, [38]: GL_ARB_fragment_layer_viewport, [39]: GL_ARB_fragment_program, [40]: GL_ARB_fragment_program_shadow, [41]: GL_ARB_fragment_shader, [42]: GL_ARB_framebuffer_no_attachments, [43]: GL_ARB_framebuffer_object, [44]: GL_ARB_framebuffer_sRGB, [45]: GL_ARB_geometry_shader4, [46]: GL_ARB_get_program_binary, [47]: GL_ARB_get_texture_sub_image, [48]: GL_ARB_gl_spirv, [49]: GL_ARB_gpu_shader5, [50]: GL_ARB_gpu_shader_fp64, [51]: GL_ARB_gpu_shader_int64, [52]: GL_ARB_half_float_pixel, [53]: GL_ARB_half_float_vertex, [54]: GL_ARB_imaging, [55]: GL_ARB_indirect_parameters, [56]: GL_ARB_instanced_arrays, [57]: GL_ARB_internalformat_query, [58]: GL_ARB_internalformat_query2, [59]: GL_ARB_invalidate_subdata, [60]: GL_ARB_map_buffer_alignment, [61]: GL_ARB_map_buffer_range, [62]: GL_ARB_multi_bind, [63]: GL_ARB_multi_draw_indirect, [64]: GL_ARB_multisample, [65]: GL_ARB_multitexture, [66]: GL_ARB_occlusion_query, [67]: GL_ARB_occlusion_query2, [68]: GL_ARB_parallel_shader_compile, [69]: GL_ARB_pipeline_statistics_query, [70]: GL_ARB_pixel_buffer_object, [71]: GL_ARB_point_parameters, [72]: GL_ARB_point_sprite, [73]: GL_ARB_program_interface_query, [74]: GL_ARB_provoking_vertex, [75]: GL_ARB_query_buffer_object, [76]: GL_ARB_robust_buffer_access_behavior, [77]: GL_ARB_robustness, [78]: GL_ARB_sample_shading, [79]: GL_ARB_sampler_objects, [80]: GL_ARB_seamless_cube_map, [81]: GL_ARB_seamless_cubemap_per_texture, [82]: GL_ARB_separate_shader_objects, [83]: GL_ARB_shader_atomic_counter_ops, [84]: GL_ARB_shader_atomic_counters, [85]: GL_ARB_shader_ballot, [86]: GL_ARB_shader_bit_encoding, [87]: GL_ARB_shader_clock, [88]: GL_ARB_shader_draw_parameters, [89]: GL_ARB_shader_group_vote, [90]: GL_ARB_shader_image_load_store, [91]: GL_ARB_shader_image_size, [92]: GL_ARB_shader_objects, [93]: GL_ARB_shader_precision, [94]: GL_ARB_shader_storage_buffer_object, [95]: GL_ARB_shader_subroutine, [96]: GL_ARB_shader_texture_image_samples, [97]: GL_ARB_shader_texture_lod, [98]: GL_ARB_shading_language_100, [99]: GL_ARB_shading_language_420pack, [100]: GL_ARB_shading_language_include, 
Log     - [101]: GL_ARB_shading_language_packing, [102]: GL_ARB_shadow, [103]: GL_ARB_sparse_buffer, [104]: GL_ARB_sparse_texture, [105]: GL_ARB_stencil_texturing, [106]: GL_ARB_sync, [107]: GL_ARB_tessellation_shader, [108]: GL_ARB_texture_barrier, [109]: GL_ARB_texture_border_clamp, [110]: GL_ARB_texture_buffer_object, [111]: GL_ARB_texture_buffer_object_rgb32, [112]: GL_ARB_texture_buffer_range, [113]: GL_ARB_texture_compression, [114]: GL_ARB_texture_compression_bptc, [115]: GL_ARB_texture_compression_rgtc, [116]: GL_ARB_texture_cube_map, [117]: GL_ARB_texture_cube_map_array, [118]: GL_ARB_texture_env_add, [119]: GL_ARB_texture_env_combine, [120]: GL_ARB_texture_env_crossbar, [121]: GL_ARB_texture_env_dot3, [122]: GL_ARB_texture_float, [123]: GL_ARB_texture_gather, [124]: GL_ARB_texture_mirror_clamp_to_edge, [125]: GL_ARB_texture_mirrored_repeat, [126]: GL_ARB_texture_multisample, [127]: GL_ARB_texture_non_power_of_two, [128]: GL_ARB_texture_query_levels, [129]: GL_ARB_texture_query_lod, [130]: GL_ARB_texture_rectangle, [131]: GL_ARB_texture_rg, [132]: GL_ARB_texture_rgb10_a2ui, [133]: GL_ARB_texture_stencil8, [134]: GL_ARB_texture_storage, [135]: GL_ARB_texture_storage_multisample, [136]: GL_ARB_texture_swizzle, [137]: GL_ARB_texture_view, [138]: GL_ARB_timer_query, [139]: GL_ARB_transform_feedback2, [140]: GL_ARB_transform_feedback3, [141]: GL_ARB_transform_feedback_instanced, [142]: GL_ARB_transform_feedback_overflow_query, [143]: GL_ARB_transpose_matrix, [144]: GL_ARB_uniform_buffer_object, [145]: GL_ARB_vertex_array_bgra, [146]: GL_ARB_vertex_array_object, [147]: GL_ARB_vertex_attrib_64bit, [148]: GL_ARB_vertex_attrib_binding, [149]: GL_ARB_vertex_buffer_object, [150]: GL_ARB_vertex_program, [151]: GL_ARB_vertex_shader, [152]: GL_ARB_vertex_type_10f_11f_11f_rev, [153]: GL_ARB_vertex_type_2_10_10_10_rev, [154]: GL_ARB_viewport_array, [155]: GL_ARB_window_pos, [156]: GL_ATI_draw_buffers, [157]: GL_ATI_texture_float, [158]: GL_ATI_texture_mirror_once, [159]: GL_S3_s3tc, [160]: GL_EXT_texture_env_add, [161]: GL_EXT_abgr, [162]: GL_EXT_bgra, [163]: GL_EXT_bindable_uniform, [164]: GL_EXT_blend_color, [165]: GL_EXT_blend_equation_separate, [166]: GL_EXT_blend_func_separate, [167]: GL_EXT_blend_minmax, [168]: GL_EXT_blend_subtract, [169]: GL_EXT_compiled_vertex_array, [170]: GL_EXT_Cg_shader, [171]: GL_EXT_depth_bounds_test, [172]: GL_EXT_direct_state_access, [173]: GL_EXT_draw_buffers2, [174]: GL_EXT_draw_instanced, [175]: GL_EXT_draw_range_elements, [176]: GL_EXT_fog_coord, [177]: GL_EXT_framebuffer_blit, [178]: GL_EXT_framebuffer_multisample, [179]: GL_EXTX_framebuffer_mixed_formats, [180]: GL_EXT_framebuffer_multisample_blit_scaled, [181]: GL_EXT_framebuffer_object, [182]: GL_EXT_framebuffer_sRGB, [183]: GL_EXT_geometry_shader4, [184]: GL_EXT_gpu_program_parameters, [185]: GL_EXT_gpu_shader4, [186]: GL_EXT_multi_draw_arrays, [187]: GL_EXT_packed_depth_stencil, [188]: GL_EXT_packed_float, [189]: GL_EXT_packed_pixels, [190]: GL_EXT_pixel_buffer_object, [191]: GL_EXT_point_parameters, [192]: GL_EXT_polygon_offset_clamp, [193]: GL_EXT_provoking_vertex, [194]: GL_EXT_rescale_normal, [195]: GL_EXT_secondary_color, [196]: GL_EXT_separate_shader_objects, [197]: GL_EXT_separate_specular_color, [198]: GL_EXT_shader_image_load_formatted, [199]: GL_EXT_shader_image_load_store, [200]: GL_EXT_shader_integer_mix, 
Log     - [201]: GL_EXT_shadow_funcs, [202]: GL_EXT_stencil_two_side, [203]: GL_EXT_stencil_wrap, [204]: GL_EXT_texture3D, [205]: GL_EXT_texture_array, [206]: GL_EXT_texture_buffer_object, [207]: GL_EXT_texture_compression_dxt1, [208]: GL_EXT_texture_compression_latc, [209]: GL_EXT_texture_compression_rgtc, [210]: GL_EXT_texture_compression_s3tc, [211]: GL_EXT_texture_cube_map, [212]: GL_EXT_texture_edge_clamp, [213]: GL_EXT_texture_env_combine, [214]: GL_EXT_texture_env_dot3, [215]: GL_EXT_texture_filter_anisotropic, [216]: GL_EXT_texture_integer, [217]: GL_EXT_texture_lod, [218]: GL_EXT_texture_lod_bias, [219]: GL_EXT_texture_mirror_clamp, [220]: GL_EXT_texture_object, [221]: GL_EXT_texture_shared_exponent, [222]: GL_EXT_texture_sRGB, [223]: GL_EXT_texture_sRGB_decode, [224]: GL_EXT_texture_storage, [225]: GL_EXT_texture_swizzle, [226]: GL_EXT_timer_query, [227]: GL_EXT_transform_feedback2, [228]: GL_EXT_vertex_array, [229]: GL_EXT_vertex_array_bgra, [230]: GL_EXT_vertex_attrib_64bit, [231]: GL_EXT_window_rectangles, [232]: GL_EXT_x11_sync_object, [233]: GL_EXT_import_sync_object, [234]: GL_NV_robustness_video_memory_purge, [235]: GL_IBM_rasterpos_clip, [236]: GL_IBM_texture_mirrored_repeat, [237]: GL_KHR_context_flush_control, [238]: GL_KHR_debug, [239]: GL_EXT_memory_object, [240]: GL_EXT_memory_object_fd, [241]: GL_KHR_no_error, [242]: GL_KHR_robust_buffer_access_behavior, [243]: GL_KHR_robustness, [244]: GL_EXT_semaphore, [245]: GL_EXT_semaphore_fd, [246]: GL_KTX_buffer_region, [247]: GL_NV_alpha_to_coverage_dither_control, [248]: GL_NV_bindless_multi_draw_indirect, [249]: GL_NV_bindless_multi_draw_indirect_count, [250]: GL_NV_bindless_texture, [251]: GL_NV_blend_equation_advanced, [252]: GL_NV_blend_equation_advanced_coherent, [253]: GL_NV_blend_square, [254]: GL_NV_command_list, [255]: GL_NV_compute_program5, [256]: GL_NV_conditional_render, [257]: GL_NV_copy_depth_to_color, [258]: GL_NV_copy_image, [259]: GL_NV_depth_buffer_float, [260]: GL_NV_depth_clamp, [261]: GL_NV_draw_texture, [262]: GL_NV_draw_vulkan_image, [263]: GL_NV_ES1_1_compatibility, [264]: GL_NV_ES3_1_compatibility, [265]: GL_NV_explicit_multisample, [266]: GL_NV_fence, [267]: GL_NV_float_buffer, [268]: GL_NV_fog_distance, [269]: GL_NV_fragment_program, [270]: GL_NV_fragment_program_option, [271]: GL_NV_fragment_program2, [272]: GL_NV_framebuffer_multisample_coverage, [273]: GL_NV_geometry_shader4, [274]: GL_NV_gpu_program4, [275]: GL_NV_internalformat_sample_query, [276]: GL_NV_gpu_program4_1, [277]: GL_NV_gpu_program5, [278]: GL_NV_gpu_program5_mem_extended, [279]: GL_NV_gpu_program_fp64, [280]: GL_NV_gpu_shader5, [281]: GL_NV_half_float, [282]: GL_NV_light_max_exponent, [283]: GL_NV_multisample_coverage, [284]: GL_NV_multisample_filter_hint, [285]: GL_NV_occlusion_query, [286]: GL_NV_packed_depth_stencil, [287]: GL_NV_parameter_buffer_object, [288]: GL_NV_parameter_buffer_object2, [289]: GL_NV_path_rendering, [290]: GL_NV_pixel_data_range, [291]: GL_NV_point_sprite, [292]: GL_NV_primitive_restart, [293]: GL_NV_register_combiners, [294]: GL_NV_register_combiners2, [295]: GL_NV_shader_atomic_counters, [296]: GL_NV_shader_atomic_float, [297]: GL_NV_shader_atomic_int64, [298]: GL_NV_shader_buffer_load, [299]: GL_NV_shader_storage_buffer_object, [300]: GL_NV_texgen_reflection, 
Log     - [301]: GL_NV_texture_barrier, [302]: GL_NV_texture_compression_vtc, [303]: GL_NV_texture_env_combine4, [304]: GL_NV_texture_multisample, [305]: GL_NV_texture_rectangle, [306]: GL_NV_texture_shader, [307]: GL_NV_texture_shader2, [308]: GL_NV_texture_shader3, [309]: GL_NV_transform_feedback, [310]: GL_NV_transform_feedback2, [311]: GL_NV_uniform_buffer_unified_memory, [312]: GL_NV_vdpau_interop, [313]: GL_NV_vertex_array_range, [314]: GL_NV_vertex_array_range2, [315]: GL_NV_vertex_attrib_integer_64bit, [316]: GL_NV_vertex_buffer_unified_memory, [317]: GL_NV_vertex_program, [318]: GL_NV_vertex_program1_1, [319]: GL_NV_vertex_program2, [320]: GL_NV_vertex_program2_option, [321]: GL_NV_vertex_program3, [322]: GL_NVX_conditional_render, [323]: GL_NVX_gpu_memory_info, [324]: GL_NVX_nvenc_interop, [325]: GL_NV_shader_thread_group, [326]: GL_NV_shader_thread_shuffle, [327]: GL_KHR_blend_equation_advanced, [328]: GL_KHR_blend_equation_advanced_coherent, [329]: GL_SGIS_generate_mipmap, [330]: GL_SGIS_texture_lod, [331]: GL_SGIX_depth_texture, [332]: GL_SGIX_shadow, [333]: GL_SUN_slice_accum, 
Log     - Function pointers available:
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111101111111111111110
Log     - 0000001111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111111111111111111111111111111111111111111111111111111111
Log     - 1111111111110000000000000000000000000000000000000000000000000000
Log     - Created device.
Log     - GLSL version 450
Warning - FBOs are shared on this implementation
Log     - Logging callback registered successfully.
Log     - Using OpenGL 3.x method to query extensions.

Duplicate issue #935: Segfault on replay, on Ubuntu
Created: 2018-03-26T12:37:12Z
Repro steps
Take a snapshot, and try to open it. Happens with both the Qt and CLI programs.
snapshot
gdb session log:
#0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:62
#1  0x00007fffecc1e2c8 in GPA_HWInfo::SetDeviceName(char const*) () from /media/media/tmp/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#2  0x00007fffecc1af49 in GPA_IMP_GetHWInfo(void*, GPA_HWInfo*) () from /media/media/tmp/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#3  0x00007fffecc23037 in GetHWInfo(void*, GPA_HWInfo*) () from /media/media/tmp/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#4  0x00007fffecc25afe in GPA_OpenContext () from /media/media/tmp/renderdoc_1.0/bin/../share/renderdoc/plugins/amd/counters/libGPUPerfAPIGL.so
#5  0x00007ffff7487a6e in ?? () from /media/media/tmp/renderdoc_1.0/bin/../lib/librenderdoc.so
...

I don't have any handy & simple OpenGL programs to test with that aren't glium-based. It's probably not related. You can compile it with:
# have rustup installed
$ git clone https://github.com/glium/glium
$ cd glium
$ cargo build --example teapot

Environment
This is using the v1.0 release from the website.
Ubuntu Artful, glxinfo
I built from source (that Qt dependency is a right pain), and it works fine, was able to poke around a bit. RenderDoc will be extremely helpful, so thank you!

Closing comment (2018-03-26T14:27:57Z): This is the same as #901, it's a bug in the AMD GPUPerfAPI counters library that breaks on some non-AMD machines (although not consistently as they and me were unable to repro this).
If you want to continue using the v1.0 release you can delete the share/renderdoc/plugins/amd/counters/ folder and this should go away.