Page MenuHome

Error division by zero on commit "016fc7f - GPUVertexFormat: Reduce size of structs"
Closed, ResolvedPublic

Description

System Information
Operating system: Window 10
Graphics card: Geforce GTX 1070

Blender Version
Broken: 2.80, 016fc7f0c238, master, 2018-05-14
Worked: (optional)

Short description of error
Instant crash on starting blender due to call to padding with offset 0 and aligment 0.

Exact steps for others to reproduce the error
Start blender with commit 016fc7f - GPUVertexFormat: Reduce size of structs or above, on windows 10 with nVidia drivers.

Event Timeline

Just built blender after updating to latest commit with no errors while building but on startup it throws following and fails to start

Error : EXCEPTION_INT_DIVIDE_BY_ZERO
Address : 0x00007FF6F400BB10
Module : C:\blender-git\build_windows_Release_x64_vc15_Release\bin\Release\blender.exe

I believe this has to do with some changes on the way the GPU attributes are read or stored. The call stack ends up on file: gpu_format_format.c, function *uint padding* called by *VertexFormat_pack*.

Can someone give me the full stacktrace?

Here you go, this was a build with the latest commit (c66a782 - Interface: Free argument callback for popups):

blender.exe!padding(unsigned int offset, unsigned int alignment) Line 221 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_vertex_format.c:221)
blender.exe!VertexFormat_pack(GPUVertFormat * format) Line 259 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_vertex_format.c:259)
blender.exe!GPU_vertbuf_create_with_format_ex(const GPUVertFormat * format, GPUUsageType usage) Line 68 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_vertex_buffer.c:68)
blender.exe!gpu_batch_sphere(int lat_res, int lon_res) Line 129 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_batch_presets.c:129)
blender.exe!gpu_batch_presets_init() Line 202 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_batch_presets.c:202)
blender.exe!GPU_init() Line 62 (d:\dev\blender\blender\source\blender\gpu\intern\gpu_init_exit.c:62)
blender.exe!wm_window_ghostwindow_add(wmWindowManager * wm, const unsigned char * title, wmWindow * win) Line 739 (d:\dev\blender\blender\source\blender\windowmanager\intern\wm_window.c:739)
blender.exe!wm_window_ghostwindows_ensure(wmWindowManager * wm) Line 861 (d:\dev\blender\blender\source\blender\windowmanager\intern\wm_window.c:861)
blender.exe!WM_check(bContext * C) Line 290 (d:\dev\blender\blender\source\blender\windowmanager\intern\wm.c:290)
blender.exe!wm_homefile_read(bContext * C, ReportList * reports, bool use_factory_settings, bool use_empty_data, bool use_data, bool use_userdef, const unsigned char * filepath_startup_override, const unsigned char * app_template_override, bool * r_is_factory_startup) Line 1038 (d:\dev\blender\blender\source\blender\windowmanager\intern\wm_files.c:1038)
blender.exe!WM_init(bContext * C, int argc, const unsigned char * * argv) Line 272 (d:\dev\blender\blender\source\blender\windowmanager\intern\wm_init_exit.c:272)
blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 427 (d:\dev\blender\blender\source\creator\creator.c:427)
[Inline Frame] blender.exe!invoke_main() Line 78 (d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78)
blender.exe!__scrt_common_main_seh() Line 288 (d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288)
kernel32.dll!00007ff8358d7974() (Unknown Source:0)
ntdll.dll!00007ff836caa271() (Unknown Source:0)

Just built blender after updating to latest commit with no errors while building but on startup it throws following and fails to start
Error : EXCEPTION_INT_DIVIDE_BY_ZERO
Address : 0x00007FF6F400BB10
Module : C:\blender-git\build_windows_Release_x64_vc15_Release\bin\Release\blender.exe

Now I have a different log when I started with gpu debug mode

Switching to fully guarded memory allocator.
Blender 2.80 (sub 64)
Build: 14-05-2019 19:35 Windows
argv[0] = blender.exe
argv[1] = --debug
argv[2] = --debug-gpu
argv[3] = --python-expr
argv[4] = import bpy; bpy.ops.wm.sysinfo(filepath=r'C:\Users\DELL\AppData\Local\Temp\blender\debug_logs\blender_system_info.txt')
Read prefs: C:\Users\DELL\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
read file

Version 280 sub 39 date unknown hash unknown

GPUTexture: create : TEXTURE_CUBE_MAP, RGBA16F, w : 2, h : 2, d : 0, comp : 4, size : 0.00 MiB
GPUTexture: create : TEXTURE_1D, RGBA8, w : 1, h : 0, d : 0, comp : 4, size : 0.00 MiB
GPUTexture: create : TEXTURE_2D, RGBA8, w : 1, h : 1, d : 0, comp : 4, size : 0.00 MiB
GPUTexture: create : TEXTURE_3D, RGBA8, w : 1, h : 1, d : 1, comp : 4, size : 0.00 MiB
Using OpenGL 4.3 debug facilities
GL application marker: Successfully hooked OpenGL debug callback.
Error : EXCEPTION_INT_DIVIDE_BY_ZERO
Address : 0x00007FF61BD1BE20
Module : C:\blender-git\build_windows_Release_x64_vc15_Release\bin\Release\blender.exe

Same issues here on Windows 10.

Edit: Never mind, fixed by the commit.

That was compiler related. VisualStudio Compiler use signed integers for enum by defaults and the bit counts were not sufficient to store all the possible values.