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

Write recursion error on linux #396

Open
Marc-Pierre-Barbier opened this issue Oct 29, 2024 · 2 comments
Open

Write recursion error on linux #396

Marc-Pierre-Barbier opened this issue Oct 29, 2024 · 2 comments

Comments

@Marc-Pierre-Barbier
Copy link

Marc-Pierre-Barbier commented Oct 29, 2024

I was using conan2's command conan graph info . --format=html > output.html which generate a html report to a file

the problem is that conan use colorama to print and the massive input led to a recursion limit.

so inside ansitowin32.py i added this piece of code at the begning of write

 def write(self, text):
        global last_write
        last_write+=1
        f = open("/tmp/conankaboum" + str(last_write), "a")
        f.write(text)
        f.close()
        ....

which wrote a 383KB file called "conankaboum206" and 205 identical files.
i will be creating a similar report on conan's side.
conankaboum206.txt

here is the looping part of the stacktrace

  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 176, in write
    self.write_and_convert(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 204, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 209, in write_plain_text
    self.wrapped.write(text[start:end])
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 46, in write
    self.__convertor.write(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 176, in write
    self.write_and_convert(text)
  File "/usr/local/lib/python3.11/site-packages/colorama/ansitowin32.py", line 198, in write_and_convert
    text = self.convert_osc(text)
@Marc-Pierre-Barbier
Copy link
Author

it seems more than an input size issue:

$ sha256sum /tmp/conankaboum1
a5e56ea06e6ca856e3791f32d6cb142c680bcb705d104a972807380158c52709  /tmp/conankaboum1
$ sha256sum /tmp/conankaboum94
a5e56ea06e6ca856e3791f32d6cb142c680bcb705d104a972807380158c52709  /tmp/conankaboum94
$ sha256sum /tmp/conankaboum206
cc88039cb75c138726268529c8b2d858c73040a58dc916ad7182a755c665fe4d  /tmp/conankaboum206

all iteration are the same. so the recursion has a bad condition somewhere.

@Marc-Pierre-Barbier Marc-Pierre-Barbier changed the title Write recursion error on big inputs. Write recursion error on linux Oct 29, 2024
@Marc-Pierre-Barbier
Copy link
Author

Seems very similar to #140 might be a duplicate not sure

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

No branches or pull requests

1 participant