Willy-JL / F95Checker

GNU General Public License v3.0
101 stars 16 forks source link

Weird crash on launch through RDP session #43

Closed FaceCrap closed 1 year ago

FaceCrap commented 1 year ago

I haven't had this happen before, but then again, it's always been already running when I remote into my desktop on mobile. See log below

Traceback (most recent call last):
File C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-pack line 138, in run
File C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-pack line 16, in run
File D:\a\F95Checker\F95Checker\main.py line 72, in <module>
File D:\a\F95Checker\F95Checker\main.py line 46, in main
File D:\a\F95Checker\F95Checker\modules\gui.pyline 591, in main_loop
File C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-pack line 113, in process_inputs
File C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-pack line 11, in compute_fb_scale
ZeroDivisionError: float division by zero

Bizar, Just got home, launched it on the desktop, and it started like nothing the matter...

This isn't the first time I experience weirdness accessing F95Checker through Microsoft's iOS RD Client, When it is already running, I can't get it to respond to the mouse either...

FaceCrap commented 1 year ago

Well, paint me purple and call me silly... Just read the post on F95Zone re build 691. Tried it again through remoting in... and it started ... kept trying a couple of times, no issue...

Then I got the notification for build 698... tried that a couple of times... first few times nothing, both exe versions just launched,

Then suddenly the regular exe bombed again during launch and threw the same error with the exact same line numbers in a dialogue popup (just like 691) and nothing in the log file... and the debug exe launched just fine...

After that the regular exe just kept throwing that same error until I ran 691 again, which launched, and this may be coincidence, but I ran 698 again and suddenly the regular exe launched fine again. Frankly I'm baffled... I've got no idea why it happens or what triggers it.

Willy-JL commented 1 year ago

Looks like a simple distraction error by the pyimgui team, I will submit a pull request shortly.

The issue:

def compute_fb_scale(window_size, frame_buffer_size):
    win_width, win_height = window_size
    fb_width, fb_height = frame_buffer_size

    # future: remove floats after dropping py27 support
    if win_width != 0 and win_width != 0:  # ISSUE HERE
        return float(fb_width) / win_width, float(fb_height) / win_height

    return 1., 1.

here they divide the framebuffer dimensions by the window dimensions, and logically if either of the window dimensions is 0 the division is skipped because a division by 0 will cause an error. however the check for 0ed dimensions checks both times on the width, never on the height

Willy-JL commented 1 year ago

Released in version 9.5