Source-Python-Dev-Team / Source.Python

This plugin aims to use boost::python and create an easily accessible wrapper around the Source Engine API for scripter use.
http://forums.sourcepython.com
GNU General Public License v3.0
163 stars 31 forks source link

Newest TF2 update causes SP to seg fault on boot #422

Closed p-hennessy closed 3 years ago

p-hennessy commented 3 years ago

Here is the error we are seeing, nothing particularly helpful:

Auto detecting CPUntinue to launch in 1 secondss
Using default binary: ./srcds_linux
Server will auto-restart if there is a crash.
Using Breakpad minidump system. Version: 6819039 AppID: 232250
Setting breakpad minidump AppID = 232250
Using breakpad crash handler
Loaded 10392 VPK file hashes from /home/tf/tf/tf2_textures.vpk for pure server operation.
Loaded 10392 VPK file hashes from /home/tf/tf/tf2_textures.vpk for pure server operation.
Loaded 478 VPK file hashes from /home/tf/tf/tf2_sound_vo_english.vpk for pure server operation.
Loaded 478 VPK file hashes from /home/tf/tf/tf2_sound_vo_english.vpk for pure server operation.
Loaded 1343 VPK file hashes from /home/tf/tf/tf2_sound_misc.vpk for pure server operation.
Loaded 1343 VPK file hashes from /home/tf/tf/tf2_sound_misc.vpk for pure server operation.
Loaded 2680 VPK file hashes from /home/tf/tf/tf2_misc.vpk for pure server operation.
Loaded 2680 VPK file hashes from /home/tf/tf/tf2_misc.vpk for pure server operation.
Loaded 2680 VPK file hashes from /home/tf/tf/tf2_misc.vpk for pure server operation.
Loaded 1217 VPK file hashes from /home/tf/hl2/hl2_textures.vpk for pure server operation.
Loaded 574 VPK file hashes from /home/tf/hl2/hl2_sound_vo_english.vpk for pure server operation.
Loaded 383 VPK file hashes from /home/tf/hl2/hl2_sound_misc.vpk for pure server operation.
Loaded 451 VPK file hashes from /home/tf/hl2/hl2_misc.vpk for pure server operation.
Loaded 451 VPK file hashes from /home/tf/hl2/hl2_misc.vpk for pure server operation.
Loaded 5 VPK file hashes from /home/tf/platform/platform_misc.vpk for pure server operation.
Loaded 5 VPK file hashes from /home/tf/platform/platform_misc.vpk for pure server operation.
server_srv.so loaded for "Team Fortress"
For FCVAR_REPLICATED, ConVar must be defined in client and game .dlls (sv_use_steam_voice)
ProtoDefs post data loaded.
ProtoDefs loaded. 18.03 MB used
ProtoDefs post data loaded.
ProtoDefs loaded. 18.03 MB used
[Source.Python] Loading...
Segmentation fault (core dumped)

We are using a recent build of SP from June i believe, not sure how to get the version info with the command though

jordanbriere commented 3 years ago

Please add +developer 1 to your launch command.

p-hennessy commented 3 years ago
[Source.Python] Setting sys.argv...
[Source.Python] Adding /home/tf/tf/addons/source-python/packages/source-python to path
[Source.Python] Adding /home/tf/tf/addons/source-python/Python3/plat-linux to path
[Source.Python] Adding /home/tf/tf/addons/source-python/Python3/lib-dynload to path
[Source.Python] Adding /home/tf/tf/addons/source-python/packages/site-packages to path
[Source.Python] Adding /home/tf/tf/addons/source-python/packages/custom to path
[Source.Python] Adding /home/tf/tf/addons/source-python/plugins to path
[Source.Python] Initializing _core._cache module
[Source.Python] Initializing _memory module
[Source.Python] Initializing _bitbuffers module
[Source.Python] Initializing _colors module
[Source.Python] Initializing _commands._client module
[Source.Python] Initializing _commands module
[Source.Python] Initializing _commands._say module
[Source.Python] Initializing _commands._server module
[Source.Python] Initializing _cvars module
[Source.Python] Initializing _effects module
[Source.Python] Initializing _effects._base module
[Source.Python] Initializing _engines module
[Source.Python] Initializing _engines._server module
[Source.Python] Initializing _engines._sound module
[Source.Python] Initializing _engines._trace module
[Source.Python] Initializing _engines._gamerules module
[Source.Python] Initializing _entities._constants module
[Source.Python] Initializing _entities._helpers module
[Source.Python] Initializing _entities module
[Source.Python] Initializing _entities._factories module
[Source.Python] Initializing _entities._datamaps module
[Source.Python] Initializing _entities._props module
[Source.Python] Initializing _entities._entity module
[Source.Python] Initializing _core module
[Source.Python] Initializing _events module
[Source.Python] Initializing _globals module
[Source.Python] Initializing _keyvalues module
[Source.Python] Initializing _listeners module
[Source.Python] Initializing _mathlib module
[Source.Python] Initializing _messages module
[Source.Python] Initializing _net_channel module
[Source.Python] Initializing _physics module
[Source.Python] Initializing _players._bots module
[Source.Python] Initializing _players._constants module
[Source.Python] Initializing _players._helpers module
[Source.Python] Initializing _players module
[Source.Python] Initializing _players._voice module
[Source.Python] Initializing _plugins module
[Source.Python] Initializing _filters._recipients module
[Source.Python] Initializing _filesystem module
[Source.Python] Initializing _steam module
[Source.Python] Initializing _stringtables module
[Source.Python] Initializing _studio module
[Source.Python] Initializing _studio._constants module
[Source.Python] Initializing _studio._cache module
[Source.Python] Initializing _weapons._constants module
[Source.Python] Initializing _weapons._scripts module
[Source.Python] Initializing _weapons._entity module
[Source.Python] Loading main module...
Segmentation fault (core dumped)
jordanbriere commented 3 years ago

Thanks. Please replace __init__.load: https://github.com/Source-Python-Dev-Team/Source.Python/blob/7d213dcb148f5f74ced10973622238ebcaa53b90/addons/source-python/packages/source-python/__init__.py#L79-L94

With:

def load():
    """Load Source.Python's Python side."""
    print('setup_stdout_redirect()')
    setup_stdout_redirect()
    print('setup_core_settings()')
    setup_core_settings()
    print('setup_logging()')
    setup_logging()
    print('setup_exception_hooks()')
    setup_exception_hooks()
    print('setup_data_update()')
    setup_data_update()
    print('setup_translations()')
    setup_translations()
    print('setup_data()')
    setup_data()
    print('setup_global_pointers()')
    setup_global_pointers()
    print('setup_sp_command()')
    setup_sp_command()
    print('setup_auth()')
    setup_auth()
    print('setup_user_settings()')
    setup_user_settings()
    print('setup_entities_listener()')
    setup_entities_listener()
    print('setup_versioning()')
    setup_versioning()
    print('setup_sqlite()')
    setup_sqlite()
    print('Done.')

And tell me what is the last output being printed out.

Ayuto commented 3 years ago

There was an update of the SDK, so we need to recompile. Unfortunately, I'm out of town until Tuesday, so I can't publish a new release until then.

p-hennessy commented 3 years ago

There was an update of the SDK, so we need to recompile. Unfortunately, I'm out of town until Tuesday, so I can't publish a new release until then.

Is there a way to compile with like some kind of CI server? Not sure if that kinda automation exists

Ayuto commented 3 years ago

In the past we had a CI, but unfortunately we don't have that server anymore. Now, I have a local Jenkins server.

jordanbriere commented 3 years ago

There was an update of the SDK, so we need to recompile. Unfortunately, I'm out of town until Tuesday, so I can't publish a new release until then.

I don't think this is what is causing the crash, because we don't call into IServer's dispatch table on load. 🤔

jordanbriere commented 3 years ago

@ns-phennessy Just saw your edit:

SP from June

That is your issue. Use the latest build available at http://downloads.sourcepython.com/ and you should be good to go unless a plugin you use call into IServer's dispatch table.

Ayuto commented 3 years ago

Oh, yeah that's true. Then it's maybe because of this change: https://github.com/alliedmodders/hl2sdk/commit/2cc52fc0ae8674a5e7f9c1e13c552066faa5dfd1

But for that we already have an update.

jordanbriere commented 3 years ago

Oh, yeah that's true. Then it's maybe because of this change: alliedmodders/hl2sdk@2cc52fc

But for that we already have an update.

If he is using the build from june like his edit suggest then yes, that is definitely the cause of the crash and updating to v709 should fixes it.

p-hennessy commented 3 years ago

@ns-phennessy Just saw your edit:

SP from June

That is your issue. Use the latest build available at http://downloads.sourcepython.com/ and you should be good to go unless a plugin you use call into IServer's dispatch table.

Awesome will do. Weird that this update today caused it to not work tho

In the past we had a CI, but unfortunately we don't have that server anymore. Now, I have a local Jenkins server.

Are there compliation instructions somewhere? I could prob help at least getting an sp build into a docker container so it could be used with GH actions or similar.

p-hennessy commented 3 years ago

Using the updated build worked. Thanks guys!

Do let me know if i can help build some automation for compiling though.

Ayuto commented 3 years ago

Thank you for offering your help! The problem is not the setup itself, but the costs that come with a CI.

p-hennessy commented 3 years ago

We should be able to host it using Github actions for basically free, so long as the compile doesnt take several hours i believe

p-hennessy commented 3 years ago

Im also happy to host something at my own expense, something like AWS codebuild, which could be done for like 3 bucks a month or less

Ayuto commented 3 years ago

Well, compiling all configurations already takes 45 minutes with 12 dedicated CPU cores. Free services are usually a lot slower (I have seen the differences with appveyor and Travis). So, I don't think the free minutes of GitHub actions will suffice.