Skip to content

Error getting variable in PUAE core running CD32. #17

@JSensebe

Description

@JSensebe

Using the puae_libretro core, when attempting to build a session which loads a CD32 game, the following error is issued:

Exception ignored on calling ctypes callback function: <bound method DictEnvironmentDriver.environment of <libretro.drivers.environment.composite.CompositeEnvironmentDriver object at 0x0000025A936C6CF0>>
Traceback (most recent call last):
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\dict.py", line 44, in environment
    return self._envcalls[envcall](data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\default.py", line 97, in <lambda>
    EnvironmentCall.GET_VARIABLE: lambda data: self._get_variable(
                                               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\environment\composite.py", line 527, in _get_variable
    result = self._options.get_variable(string_at(var.key) if var.key else None)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\jsens\AppData\Roaming\Python\Python312\site-packages\libretro\drivers\options\dict.py", line 75, in get_variable
    value = string_at(self._options_us[key].default_value)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python312\Lib\ctypes\__init__.py", line 525, in string_at
    return _string_at(ptr, size)
           ^^^^^^^^^^^^^^^^^^^^^
OSError: exception: access violation reading 0x0000000000000000

The system appears to run fine after the error.

The variable (key) is b'puae_cart_file'. It is in self._options_us but not in self._variables.
self._options_us[key].default_value is set to None, which means it's essentially trying to get string_at(None). There probably should be a check for this case, but I don't know off-hand what a reasonable return value would be (b'', None, or even b'None'?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions