Giter VIP home page Giter VIP logo

Comments (4)

cfbolz avatar cfbolz commented on June 3, 2024

the first problem I suspect is a complicated bug/limitation in rpython's handling of function pointers. I tried to make primites rely less on those in the branch prims-fewer-func-ptrs, which makes the first problem go away. I didn't manage to run tests there yet, but if you do so and they pass, you should just merge the branch.

as soon as I can reproduce the bug in the second traceback, I can try to debug it more. what you can try is get a pdb at the error location, and go up a few frames into eval, and look for a local variable called "graph" there. that would tell you in which rpython level function the null pointer exception is occurring.

from pycket.

cderici avatar cderici commented on June 3, 2024

@cfbolz I'm running the tests now and it seems to be working, I'll wait until all of it passes and then merge it. So were you able to successfully run the meta_interp on pypy after this fix?

from pycket.

cfbolz avatar cfbolz commented on June 3, 2024

successfully in the sense that I now get a SchemeException, meaning it behaves the same as cpython at least.

from pycket.

cderici avatar cderici commented on June 3, 2024

@cfbolz It seems the null pointer exception on CPython is about the JSONDecoder and ll_dicts. I made a little investigation and the error seems to be in the ll_dict_getitem_with_hash function in rordereddict.py . However, I still don't see where the null pointer is. As you can see in the pdb ineractions below, everything seems to be a valid pointer.

Note that I'm able to run this on PyPy without any problem.

(Pdb) att
AttributeError("'NoneType' object has no attribute '_getattr'",)
(Pdb) u
> /home/cderici/pycketland/pycket/pypy/rpython/rtyper/llinterp.py(285)eval()
-> nextblock, args = self.eval_block(nextblock)
(Pdb) graph
<FunctionGraph of (rpython.rtyper.lltypesystem.rordereddict:645)ll_dict_getitem_with_hash__dicttablePtr_tuple4Ptr_Signed at 0x7f10edb725d0>
(Pdb) self.args
(<* struct dicttable { num_live_items=28, num_ever_used_items=28, resize_counter=44, indexes=..., lookup_function_no=0, entries=..., fnkeyeq=None, fnkeyhash=None }>, <* struct tuple4 { item0=..., item1=6848, item2=7, item3=3617620788958626453 }>, 3617620788958626453)
(Pdb) self.args[0].lookup_function
<function ll_call_lookup_function_look_inside_iff at 0x7f110b6a7050>
(Pdb) self.args[0].entries
<* array [ odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, (...), odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...}, odictentry {key=..., value=...} ]>
(Pdb) self.args[0].lookup_function_no
0
(Pdb) u
...
(Pdb) u
> /home/cderici/pycketland/pycket/pypy/rpython/rtyper/llinterp.py(285)eval()
-> nextblock, args = self.eval_block(nextblock)
(Pdb) graph
<FunctionGraph of (rpython.rtyper.lltypesystem.rordereddict:642)ll_dict_getitem__dicttablePtr_tuple4Ptr at 0x7f1106428810>
(Pdb) u
...
(Pdb) u
> /home/cderici/pycketland/pycket/pypy/rpython/rtyper/llinterp.py(285)eval()
-> nextblock, args = self.eval_block(nextblock)
(Pdb) graph
<FunctionGraph of (pypy.module._pypyjson.interp_decoder:391)JSONDecoder.decode_key at 0x7f11090c7490>
(Pdb) u
...
(Pdb) u
> /home/cderici/pycketland/pycket/pypy/rpython/rtyper/llinterp.py(285)eval()
-> nextblock, args = self.eval_block(nextblock)
(Pdb) graph
<FunctionGraph of (pypy.module._pypyjson.interp_decoder:243)JSONDecoder.decode_object at 0x7f1109b4bad0>
(Pdb) u
...
(Pdb) u
> /home/cderici/pycketland/pycket/pypy/rpython/rtyper/llinterp.py(285)eval()
-> nextblock, args = self.eval_block(nextblock)
(Pdb) graph
<FunctionGraph of (pypy.module._pypyjson.interp_decoder:76)JSONDecoder.decode_any at 0x7f1109a99450>
...

from pycket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.