Opened 18 years ago

Closed 18 years ago

Last modified 14 years ago

#146 closed defect (fixed)

Assertion in wsdl screen_to_client

Reported by: Nicolai Hähnle Owned by: Jan Wassenberg
Priority: Should Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

During startup of the game, I got the following error (unfortunately, I wasn't able to reproduce it).

This is in Windows XP, running the game in a 800x600 window, the screen resolution is 1280x1024. The window appeared in to top-left corner of the screen.

Here's the error message from the error dialog:

Assertion failed: "pt.x >= 0 && pt.y >= 0"
Location: wsdl.cpp:802 (screen_to_client)
errno = 42 (?)
OS error = Der Vorgang wurde erfolgreich beendet.


Call stack:

screen_to_client (wsdl.cpp:802)
    screen_x = (unavailable - stored in register 0x0)
    screen_y = (unavailable - stored in register 0x0)
    x = (unavailable - stored in register 0x0)
    y = (unavailable - stored in register 0x0)
    pt = { x = 5791740, y = 179 }
    suppress__ = 0x00
    suppress__ = 0x00

OnMouseButton (wsdl.cpp:903)
    __formal = 0x0048C874 (..)
    uMsg = (unavailable - stored in register 0x0)
    screen_x = 182
    screen_y = 16
    __formal = 0x0048C874
    outstanding_press_events = 1
    x = 0x7FFDF000
    y = 0x00000001

wndproc (wsdl.cpp:1035)
    hWnd = 0x00050600 (..)
    uMsg = 0x00000201
    wParam = 0x00000001
    lParam = 1048758
    ps = 
        hdc = 0x0012FCC0 (..)
        fErase = 1
        rcPaint = 
            left = 0
            top = 0
            right = 16
            bottom = 0

        fRestore = 0
        fIncUpdate = 1
        rgbReserved = [32] 
            0x00
            0x00
            0x00
            0x00
            0x00
            0x00
            0x00
            0x00
            0x44 ('D')
            0xFC
            0x12
            0x00
            0x48 ('H')
            0xFC
            0x12
            0x00 ...


GetDC (:0)

GetDC (:0)

IsWindowUnicode (:0)

CallWindowProcW (:0)

wglSwapBuffers (:0)

GetDC (:0)

GetDC (:0)

GetWindowLongW (:0)

DispatchMessageW (:0)

SDL_PumpEvents (wsdl.cpp:1051)
    msg = 
        hwnd = 0x00000001
        message = 0x00050600
        wParam = 0x00000201
        lParam = 1
        time = 0x001000B6
        pt = { x = 12142140, y = 185 }


SDL_PollEvent (wsdl.cpp:1061)
    ev = 0x0012FEFC -> 
        type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }
        key = 
            type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }
            keysym = { type = [8] { 0x10, 0xFF, 0x12, 0x00, 0x01, 0x00, 0x00, 0x00 }, sym = 1, unicode = 0xF1F9 }

        motion = { type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }, x = 0x0000, y = 0xFF10 }
        button = 
            type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }
            button = [8] { 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00, 0x01 }
            state = [8] { 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00, 0x01, 0x00 }
            x = 0xFF10
            y = 0x0012

        active = { type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }, gain = [8] { 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00, 0x01 }, state = [8] { 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00, 0x01, 0x00 } }
        user = { type = [8] { 0x00, 0x00, 0x00, 0x00, 0x10, 0xFF, 0x12, 0x00 }, code = 1244944, data1 = 0x00000001 }


PumpEvents (main.cpp:91)
    ev = 
        ev = 
            type = 0xFC
            key = 
                type = 0xFC
                keysym = { type = 0x00, sym = 1244944, unicode = 0x0001 }

            motion = { type = 0xFC, x = 0x0012, y = 0x0000 }
            button = 
                type = 0xFC
                button = 0xFE
                state = 0x12
                x = 0x0000
                y = 0x0000

            active = { type = 0xFC, gain = 0xFE, state = 0x12 }
            user = { type = 0xFC, code = 0, data1 = 0x0012FF10 }



Frame (main.cpp:240)
    need_update = true 
    TimeSinceLastFrame = 3.62822e-038
    need_render = false
    suppress__ = 0x00
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)
    __profile = (CProfileSample)

main (main.cpp:382)
    argc = 1
    argv = 0x00384EA0 -> 0x00384EA8 -> "c:\Wildfiregames\0ad\binaries\system\pyrogenesis.exe"

__tmainCRTStartup (crtexe.c:586)
    nested = 1245020

SEH_wrapped_entry (win.cpp:338)
    ret = 1245076

RegisterWaitForInputIdle (:0)

Change History (4)

comment:1 by Jan Wassenberg, 18 years ago

Status: newassigned

Confirmed. Happens when mouse is over NC area (e.g. title bar) and left of window frame.

comment:2 by Jan Wassenberg, 18 years ago

Resolution: fixed
Status: assignedclosed

(In [4324]) # more mouse fixes (windowed mode) note: previous fix (clamp to 0 in screen_to_client) causes spurious messages if mouse moves outside of the window (which is bad). "client" coords are allowed to be negative, but "idealized client coords" (which are defended by assert >= 0 or is_in_window) aren't. fixes #146

comment:3 by Philip Taylor, 14 years ago

Milestone: Pre-AlphaUnclassified

Milestone Pre-Alpha deleted

comment:4 by (none), 14 years ago

Milestone: Unclassified

Milestone Unclassified deleted

Note: See TracTickets for help on using tickets.