Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Error on security-hardened systems #72

Closed
mardy opened this issue Sep 6, 2019 · 6 comments · Fixed by #77
Closed

Error on security-hardened systems #72

mardy opened this issue Sep 6, 2019 · 6 comments · Fixed by #77

Comments

@mardy
Copy link

mardy commented Sep 6, 2019

Hi!
I'm running isso (which depends on misaka) in dreamhost. Since a couple of months my isso CGI stopped working:

$ ~/mardy.it/cgi-bin/isso.fcgi 
Traceback (most recent call last):
  File "/home/mardy/mardy.it/cgi-bin/isso.fcgi", line 7, in <module>
    from isso import make_app
  File "/home/mardy/isso/lib/python3.6/site-packages/isso/__init__.py", line 72, in <module>
    from isso.utils import http, JSONRequest, html, hash
  File "/home/mardy/isso/lib/python3.6/site-packages/isso/utils/html.py", line 6, in <module>
    import misaka
  File "/home/mardy/isso/lib/python3.6/site-packages/misaka/__init__.py", line 3, in <module>
    from .api import *
  File "/home/mardy/isso/lib/python3.6/site-packages/misaka/api.py", line 10, in <module>
    from .callbacks import python_callbacks, to_string
  File "/home/mardy/isso/lib/python3.6/site-packages/misaka/callbacks.py", line 8, in <module>
    @ffi.callback('void(hoedown_buffer *ob, const hoedown_buffer *text, '
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

I understand that this will be eventually solved by #69, but I wonder if you are aware of a quicker workaround to get things working?

@FSX
Copy link
Owner

FSX commented Sep 6, 2019 via email

@mardy
Copy link
Author

mardy commented Sep 6, 2019

Hi, thanks for the report! Do you have more details about the system you're running? Then I can reproduce the issue and see what I can do.

Not really, but the page linked in the error message has some informative recommendation:

To fix the issue once and for all on the affected platforms, you need to refactor the involved code so that it no longer uses ffi.callback().

For the time being, I've "fixed" the issue by making isso use mark3 instead of misaka, just on my own hosting.

@FSX
Copy link
Owner

FSX commented Sep 6, 2019 via email

@FSX
Copy link
Owner

FSX commented Sep 7, 2019

@mardy
Copy link
Author

mardy commented Sep 7, 2019

Wow, that was fast! Works like a charm :-)

@FSX
Copy link
Owner

FSX commented Sep 7, 2019

Good. I'll make a release shortly (and then close this issue).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants