1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Question - Code Networking functions causing "non-zero status" crashes in

Discussion in 'GameMaker Studio 2 Community Tech Support' started by RhyminGarFunkle, Nov 5, 2019.

  1. RhyminGarFunkle

    RhyminGarFunkle Member

    Jan 10, 2017
    My game is networked between mobile devices and a PC host, and several network functions that previously functioned perfectly now cause frequent "non-zero status" crashes. These crashes are somewhat intermittent (but still present) on most devices except when on Nexus 7, in which case they're easily replicated. Was there a change in the way networking functions work in the newest versions? I don't know exactly which version the crashes started on, I wasn't able to work on this project between August and last week (I believe there were three updates in that time) and have only now noticed the issues.

    I've also tested this on the official YoYo Games LAN platforming tutorial, with no modifications, and got a non-zero status crash on the Nexus 7, where previously it worked perfectly - a few seconds after joining the server, it crashes to the home screen with no freezing or error messages.

    One example is a simple loop ran on game start that determines the IP address of the device that the game is running on (used so it can be run on both IPv4 and IPv6). Here's the previous code that worked under previous versions and now causes crashes:
    connectip = "0"
    broadcast_buffer = buffer_create(32,buffer_fixed,1)
    serverid = network_create_server(network_socket_tcp,dport,10)
    checkserver = network_create_server(network_socket_udp,dport,100)
    alarm[0] = 1
    buffer_write(broadcast_buffer,buffer_string,"Test Server")
    alarm[0] = 2
    //networking async
    var ip;
    ip = ds_map_find_value(async_load,"ip")
    connectip = ip
    This caused crashes every time on Nexus 7, roughly 1 in 3 times on other Android devices, and roughly 1 in 5 times on PC. I was able to fix this by breaking every network_create_server into separate alarms, triggered one after another, and having the networks be destroyed in another alarm event whose timer is set in the networking_async event, but again, this code previously worked perfectly every time on every platform, so the fact that it doesn't anymore sets off alarm bells.

    I'm still getting frequent networking errors on the Nexus 7 that seem to happen any time , and occasional errors on my other Android devices that I test on. As near as I can tell, they're caused by having a network async event occur during the same step as other networking functions are used - in the example above, it was having network_destroy() happen in the async event, but I'm also getting crashes when (I think) a device connects to a network and receives data back from the server in the same step.

    Does anyone know what happened, perhaps what I'm doing wrong and if there are any workarounds, or should I file a bug report?
    Last edited: Nov 5, 2019
  2. RhyminGarFunkle

    RhyminGarFunkle Member

    Jan 10, 2017
    Here are some example files showing just the particular networking problem:


    networkbug has two objects, oIPGetter which will run the code in the OP and if successful, create oDrawIP, which will draw the IP address that was found. Stepping through the code in debug mode, you can see that everything seems to work fine and every variable is properly set, but at the end of the network async event the game will mysteriously crash with no error message and the following in the output box:
    X://windows/Runner.exe exited with non-zero status (-1073741819)
    elapsed time 00:00:18.9342578s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-" -j=8 -options="C:\Users\matth\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 11/05/2019 03:42:20
    "cmd"  /c subst Z: /d
    elapsed time 00:00:00.0530041s for command "cmd" /c subst Z: /d started at 11/05/2019 03:42:39
    "cmd"  /c subst Y: /d
    elapsed time 00:00:00.0590038s for command "cmd" /c subst Y: /d started at 11/05/2019 03:42:39
    "cmd"  /c subst X: /d
    elapsed time 00:00:00.0513398s for command "cmd" /c subst X: /d started at 11/05/2019 03:42:39
    FAILED: Run Program Complete
    With everything deleted except the troublesome code, the error happens every time, not just occasionally.

    networkbugfixed shows the same code, but broken up with alarms between all the networking function calls, and it works fine. This is just the easiest to isolate and demonstrate issue, lots of stuff related to networking is now broken for me.
  3. rIKmAN

    rIKmAN Member

    Sep 6, 2016
    Report it as a bug and attach the example projects to the bug report so YYG can take a look.

    Use Help > Report a Bug in the IDE and follow the steps.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice