Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reassignment of 'getattr' leads to gpython crashing #202

Open
xiaxinmeng opened this issue Dec 5, 2022 · 2 comments
Open

Reassignment of 'getattr' leads to gpython crashing #202

xiaxinmeng opened this issue Dec 5, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@xiaxinmeng
Copy link

Reassigning getattr with getattr in a class and then using the attribute 'spam' triggers gpython crashing. See the following example. We test the example on the online gpython i.e., GO/wasm and Gopherjs. GO/wasm can well handle the test while it crashes on the Gopherjs.

test.py


class c(object):
    __getattr__ = getattr
c().spam

Output on Gopherjs (https://gpython.org/)

Gpython 3.4.0 running in your browser with gopherjs
>>> class c(object):
...     __getattr__ = getattr
... 
>>> c().spam
[USER]: https://gpython.org/gpython.js: too much recursion
$assertType@https://gpython.org/gpython.js:4:20889
GL.ptr.prototype.Call@https://gpython.org/gpython.js:41:291927
GL.ptr.prototype.M__call__@https://gpython.org/gpython.js:41:301617
FK@https://gpython.org/gpython.js:41:255589
MH.ptr.prototype.CallMethod@https://gpython.org/gpython.js:41:369579
MP@https://gpython.org/gpython.js:41:370268
MR@https://gpython.org/gpython.js:41:371135
FO@https://gpython.org/gpython.js:41:262478
FP@https://gpython.org/gpython.js:41:264051
P@https://gpython.org/gpython.js:54:33516
GL.ptr.prototype.Call@https://gpython.org/gpython.js:41:292125
GL.ptr.prototype.M__call__@https://gpython.org/gpython.js:41:301617
FK@https://gpython.org/gpython.js:41:255589
MH.ptr.prototype.CallMethod@https://gpython.org/gpython.js:41:369579
MP@https://gpython.org/gpython.js:41:370268
MR@https://gpython.org/gpython.js:41:371135
FO@https://gpython.org/gpython.js:41:262478
FP@https://gpython.org/gpython.js:41:264051
P@https://gpython.org/gpython.js:54:33516
GL.ptr.prototype.Call@https://gpython.org/gpython.js:41:292125
GL.ptr.prototype.M__call__@https://gpython.org/gpython.js:41:301617
FK@https://gpython.org/gpython.js:41:255589
MH.ptr.prototype.CallMethod@https://gpython.org/gpython.js:41:369579
MP@https://gpython.org/gpython.js:41:370268
MR@https://gpython.org/gpython.js:41:371135
FO@https://gpython.org/gpython.js:41:262478
...

@ncw
Copy link
Collaborator

ncw commented Dec 5, 2022

I can confirm this on gpython master.

Want to try to fix @xiaxinmeng ?

@ncw ncw added the bug Something isn't working label Dec 5, 2022
@xiaxinmeng
Copy link
Author

Thanks for confirm these bugs very much. But I am sorry that I cannot fix these bugs because I am not familiar with go language. The fixing task is difficult for me. I will be grateful if you can fix these bugs. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants