bedrock icon indicating copy to clipboard operation
bedrock copied to clipboard

Can't read world because of access violation

Open filips123 opened this issue 6 years ago • 4 comments

I can't read world's chinks and blocks. When I try to do this, the error occours:

Traceback (most recent call last):
  File "<pyshell#8>", line 1, in <module>
    world.getChunk(0, 0)
  File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 30, in getChunk
    chunk = Chunk(self.db, x, z)
  File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 65, in __init__
    self.version = self._loadVersion(db)
  File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\bedrock.py", line 82, in _loadVersion
    version = ldb.get(db, self.keyBase + b"v")
  File "D:\Users\filips\Downloads\MCPE\venv\lib\site-packages\bedrock-0.1-py3.7.egg\bedrock\leveldb.py", line 164, in get
    valPtr = ldb.leveldb_get(db, ro, key, len(key), ctypes.byref(size), ctypes.byref(error))
OSError: exception: access violation reading 0x0000000000000000

I'm using Python 3.7 on Windows 10 (64-bit) and with DLLs that are provided in this repository.

filips123 avatar Oct 26 '19 21:10 filips123

did you unzipped the .mcworld file?

fangzhangmnm avatar Dec 02 '19 23:12 fangzhangmnm

Which .mcworld file? I copied worlds from Android phone with Pocket Edition (which is Bedrock), and I just have level.dat, various .ldb and other files.

filips123 avatar Dec 05 '19 16:12 filips123

Can confirm this issue is still happening. I'm using Windows 10 64 bits with Python 3.8.3 and I've tried both the provided DLLs and some compiled by myself. Here's the output:

  File "F:\Escritorio\Saves Script\bedrock\leveldb.py", line 161, in get
    valPtr = ldb.leveldb_get(db, ro, key, len(key), ctypes.byref(size), ctypes.byref(error))
  File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 95, in _loadVersion
    version = ldb.get(db, self.keyBase + b"v")
  File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 78, in __init__
    self.version = self._loadVersion(db)
  File "F:\Escritorio\Saves Script\bedrock\bedrock.py", line 30, in getChunk
    chunk = Chunk(self.db, x, z)
  File "F:\Escritorio\Saves Script\main.py", line 4, in <module>
    spawnchunk = world.getChunk(0, 0)

ChameleonIVCR avatar Jun 21 '20 04:06 ChameleonIVCR

I'm unfortunately not particularly familiar with the low level windows/ctypes issue this appears to be, and can't reproduce myself. I'm open to a PR fixing it however.

BluCodeGH avatar Jun 23 '20 18:06 BluCodeGH