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

loop on notcurses-demo fails to write JSON about 1% of the time #407

Closed
dankamongmen opened this issue Mar 17, 2020 · 6 comments
Closed
Assignees
Labels
bug Something isn't working demo relevant to notcurses-demo
Milestone

Comments

@dankamongmen
Copy link
Owner

For some graphs for the book, I've been running notcurses-demo in various terminals at geometries of Nx52, where 80 <= N < 192. I run all of these N for each terminal, three times each. The numbers are almost shockingly reproducible (see attached). Anyway, no matter the emulator, we write an empty JSON file about 1--2% of the time. I'm not sure whether we're crashing or what, but this needs be investigated and resolved.

@dankamongmen dankamongmen added bug Something isn't working demo relevant to notcurses-demo labels Mar 17, 2020
@dankamongmen dankamongmen added this to the 1.3.0 milestone Mar 17, 2020
@dankamongmen dankamongmen self-assigned this Mar 17, 2020
@dankamongmen
Copy link
Owner Author

Oddly enough, this seems to happen most often at two widths: 104 and 174. whaaaa

@dankamongmen
Copy link
Owner Author

I've currently got a hot reproducible segfault in luigi in alacritty at 104x52. On it!

@dankamongmen
Copy link
Owner Author

./notcurses-demo -p ../data/ -k -c -J d0-alacritty-3-52-104.json -d0 ethbcgrwuvlf, yep

@dankamongmen
Copy link
Owner Author

It's actually in fallin':

==2315424== Process terminating with default action of signal 11 (SIGSEGV)
==2315424==    at 0x48CDF8F: raise (raise.c:46)
==2315424==    by 0x48CE10F: ??? (in /lib/x86_64-linux-gnu/libpthread-2.30.so)
==2315424==    by 0x48569A4: ncplane_yx (in /home/dank/src/dankamongmen/notcurses-1.2.3/build/libnotcurses.so.1.2.3)
==2315424==    by 0x11190B: fallin_demo (in /home/dank/src/dankamongmen/notcurses-1.2.3/build/notcurses-demo)
==2315424==    by 0x10EE7D: main (in /home/dank/src/dankamongmen/notcurses-1.2.3/build/notcurses-demo)
==2315424==
==2315424== HEAP SUMMARY:
==2315424==     in use at exit: 20,812,540 bytes in 1,685 blocks
==2315424==   total heap usage: 127,843 allocs, 126,158 frees, 1,455,531,300 bytes allocated
==2315424==
==2315424== LEAK SUMMARY:
==2315424==    definitely lost: 15,812,416 bytes in 124 blocks
==2315424==    indirectly lost: 0 bytes in 0 blocks
==2315424==      possibly lost: 634,992 bytes in 4 blocks
==2315424==    still reachable: 4,365,132 bytes in 1,557 blocks
==2315424==         suppressed: 0 bytes in 0 blocks
==2315424== Rerun with --leak-check=full to see details of leaked memory
==2315424==

@dankamongmen
Copy link
Owner Author

Term: 104x52 alacritty (alacritty terminal emulator)
==2321024== Invalid read of size 4
==2321024==    at 0x485CA5B: ncplane_yx (notcurses.c:1840)
==2321024==    by 0x113687: drop_bricks (fallin.c:38)
==2321024==    by 0x113E03: fallin_demo (fallin.c:193)
==2321024==    by 0x110C5D: ext_demos (demo.c:212)
==2321024==    by 0x1124DD: main (demo.c:524)
==2321024==  Address 0x14 is not stack'd, malloc'd or (recently) free'd

@dankamongmen
Copy link
Owner Author

Got it.

dankamongmen added a commit that referenced this issue Mar 19, 2020
I noticed while running benchmarks against ranges of widths that
we failed on certain widths. I traced this down to a repeatable
failure when run with the -c flag at the 104x52 resolution. At this
geometry and PRNG seed, we NULLed out the first subwindow of fallin',
but didn't recompress the window array. On the next loop we thus used
it again, and segfaulted out. This fixes that up. We now pass 100% of
the benchmarks, whereas we were failing about 3% before #407.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working demo relevant to notcurses-demo
Projects
None yet
Development

No branches or pull requests

1 participant