Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to start with runtime error: division by zero #644

Closed
cosemansbert opened this issue Feb 28, 2020 · 5 comments · Fixed by #645
Closed

Fails to start with runtime error: division by zero #644

cosemansbert opened this issue Feb 28, 2020 · 5 comments · Fixed by #645

Comments

@cosemansbert
Copy link

cosemansbert commented Feb 28, 2020

Hi,

I've compiled an up-to-date master from source on a debian buster machine.
When i try to run the binary, it immediately crashes with this error:


/data/diablo/source/devilutionX/SourceX/display.cpp:107:25: runtime error: division by zero 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==3816==ERROR: AddressSanitizer: FPE on unknown address 0x55b1beb047bc (pc 0X55b1beb047bc bp 0x7ffedf25e260 sp 0x7ffedf25e0f0 T0)
    #0 0x55b1beb047bb in dvl::SpawnWindow(char const*, int, int) /data/diablo/source/devilutionX/SourceX/display.cpp:107
    #1 0x55b1bedbc1e6 in init_create_window /data/diablo/source/devilutionX/Source/init.cpp:47
    #2 0x55b1bec8fc35 in dvl::diablo_init() /data/diablo/source/devilutionX/Source/diablo.cpp:255
    #3 0x55b1bec8fda0 in DiabloMain /data/diablo/source/devilutionX/Source/diablo.cpp:297
    #4 0x55b1bebbb4c0 in main /data/diablo/source/devilutionX/SourceX/main.cpp:28
    #5 0x7fde2896409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #6 0x55b1bead77c9 in _start (/data/diablo/devilutionx+0xd287c9)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: FPE /data/diablo/source/devilutionX/SourceX/display.cpp:107 in dvl::SpawnWindow(char const*, int, int)
==3816==ABORTING

The error occurs in both fullscreen and windowed ( -x parameter) mode.

The SDL version i'm using:

ii  libsdl-image1.2:amd64                                       1.2.12-10+deb10u1                                       amd64        Image loading library for Simple DirectMedia Layer 1.2, libraries
rc  libsdl-mixer1.2:amd64                                       1.2.12-3                                                amd64        Mixer library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-net1.2:amd64                                         1.2.8-6                                                 amd64        Network library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-sound1.2:amd64                                       1.0.3-9                                                 amd64        Sound library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl-ttf2.0-0:amd64                                       2.0.11-6                                                amd64        TrueType Font library for Simple DirectMedia Layer 1.2, libraries
ii  libsdl1.2debian:amd64                                       1.2.15+dfsg2-4                                          amd64        Simple DirectMedia Layer
ii  libsdl1.2debian:i386                                        1.2.15+dfsg2-4                                          i386         Simple DirectMedia Layer
ii  libsdl2-2.0-0:amd64                                         2.0.9+dfsg1-1                                           amd64        Simple DirectMedia Layer
ii  libsdl2-2.0-0:i386                                          2.0.9+dfsg1-1                                           i386         Simple DirectMedia Layer
ii  libsdl2-dev                                                 2.0.9+dfsg1-1                                           amd64        Simple DirectMedia Layer development files
ii  libsdl2-mixer-2.0-0:amd64                                   2.0.4+dfsg1-1                                           amd64        Mixer library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-mixer-dev:amd64                                     2.0.4+dfsg1-1                                           amd64        Mixer library for Simple DirectMedia Layer 2, development files
ii  libsdl2-ttf-2.0-0:amd64                                     2.0.15+dfsg1-1                                          amd64        TrueType Font library for Simple DirectMedia Layer 2, libraries
ii  libsdl2-ttf-dev:amd64                                       2.0.15+dfsg1-1                                          amd64        TrueType Font library for Simple DirectMedia Layer 2, development files

@AJenbo
Copy link
Member

AJenbo commented Feb 28, 2020

What GPU driver is this on?

@cosemansbert
Copy link
Author

I'm using the nvidia driver, version 418.74-1

@AJenbo
Copy link
Member

AJenbo commented Feb 28, 2020

What is your monitor refresh rate and do you have some sort of adaptive/g sync enabled?

The crash is caused by the driver reporting the refresh rate as 0

@cosemansbert
Copy link
Author

The refresh rate is 60HZ. Everything should be pretty basic.
These are the attributes set in the nvidia settings:

0/SyncToVBlank=1
0/LogAniso=0
0/FSAA=0
0/TextureClamping=1
0/FXAA=0
0/AllowFlipping=1
0/FSAAAppControlled=1
0/LogAnisoAppControlled=1
0/OpenGLImageSettings=1
0/FSAAAppEnhanced=0
0/ShowGraphicsVisualIndicator=0
0/RedBrightness=0.000000
0/GreenBrightness=0.000000
0/BlueBrightness=0.000000
0/RedContrast=0.000000
0/GreenContrast=0.000000
0/BlueContrast=0.000000
0/RedGamma=1.000000
0/GreenGamma=1.000000
0/BlueGamma=1.000000

@AJenbo
Copy link
Member

AJenbo commented Feb 29, 2020

Looks like the refresh_rate can be reported as 0 when it isn't specified, thanks for reporting this. https://wiki.libsdl.org/SDL_DisplayMode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants