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

visual glitch with many progress bars scrolling up screen #8

Closed
joeyh opened this issue Apr 3, 2015 · 5 comments
Closed

visual glitch with many progress bars scrolling up screen #8

joeyh opened this issue Apr 3, 2015 · 5 comments

Comments

@joeyh
Copy link

joeyh commented Apr 3, 2015

I modified MultiExample.hs in 2 ways for this test:

  1. Reduced the delays so the bars update 1000 times faster.
  2. Made main recursively call main once all progress bars were updated.

This image shows the visual glitch that resulted from the resulting stream of progress bars.

http://tmp.kitenet.net/multimultibug.png

I see this in multiple different terminal emulators (eg, gnome-terminal). It seems to be somewhat timing dependent, ie changing the *1000 in the delay to * 10 doesn't produce it, but * 1 does.

BTW, the original goal in this test was to check if there were any memory leaks when using enormous numbers of progress bars. Good job -- no memory leaks found!

@joeyh
Copy link
Author

joeyh commented Apr 4, 2015

Probably this is just 2 progress bars updating at the same time and outputting to console at the same time.

@joeyh
Copy link
Author

joeyh commented Apr 10, 2015

I have git-annex using ascii-progress now. This bug is one of the blockers for merging that into git-annex:master

@yamadapc
Copy link
Owner

Looking at this

@yamadapc
Copy link
Owner

I'll need to use a VM to reproduce this, because nor iTerm nor Terminal have this problem on OSX. I'll make a fix by tomorrow, then bump and republish with the other improvements. GHC 7.6.2 (and 7.6.1) support is still pending, because of some weird hspec problem. Hopefully if I can set-up a decent virtual environment this will be easier to understand.

I'm going to limit the amount of updates done per second too, maybe have a single writer-thread after all. Maybe that fixes it.

Let me try to understand this better. You tweaked the multi-example to be faster and have a recursive call to main before the three wait calls or after them? Can you send me your tweaked MultiExample.hs?

@joeyh
Copy link
Author

joeyh commented Apr 10, 2015

Pedro Tacla Yamada wrote:

Let me try to understand this better. You tweaked the multi-example to be
faster and have a recursive call to main before the three wait calls or after
them? Can you send me your tweaked MultiExample.hs?

I've attached it.

In extreme cases (when git-annex is driving it), the concurrent writers can
overlap completely, I've seen output that includes things like this:

E [ TE1EEEATGTTT AAAA N aNNNNNaaaa

This was 6 threads all printing out something like ETA NaN.

This is on Linux BTW.

Basically the same as:

Prelude> import Control.Concurrent
Prelude> forkIO (print (repeat 'a')) >> forkIO (print (repeat 'b'))
abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababa

see shy jo

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

No branches or pull requests

2 participants