dankamongmen / growlight

notcurses block device manager / system installation tool
https://nick-black.com/dankwiki/index.php/Growlight
GNU General Public License v3.0
85 stars 12 forks source link

Coredump in console mode scrolling through full screen #23

Closed dankamongmen closed 4 years ago

dankamongmen commented 5 years ago

I was in a text console (25 rows or so) on schwarzgerat, and started growlight 1.0.6.2. Moving down through the adapters, I was able to generate a sigfault (NOT an abort()). Seems pretty reproducible, so get at it.

dankamongmen commented 5 years ago

Also seeing some of this:

growlight-curses: src/ncurses.c:4138: use_next_controller: Assertion `top_reelbox == rb' failed.
dankamongmen commented 5 years ago
==32309== Memcheck, a memory error detector
==32309== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==32309== Using Valgrind-3.16.0.GIT and LibVEX; rerun with -h for copyright info
==32309== Command: ./growlight-curses
==32309== 
==32309== Thread 41:
==32309== Invalid read of size 8
==32309==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==32309==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==32309==    by 0x123248: free_reelbox (ncurses.c:3339)
==32309==    by 0x123248: free_reelbox (ncurses.c:3332)
==32309==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==32309==    by 0x12B8D9: resize_adapter (ncurses.c:3902)
==32309==    by 0x12F0D2: block_callback (ncurses.c:6864)
==32309==    by 0x111D1D: rescan (growlight.c:1126)
==32309==    by 0x111D1D: rescan (growlight.c:908)
==32309==    by 0x113325: create_new_device_inner (growlight.c:1144)
==32309==    by 0x113325: create_new_device (growlight.c:1186)
==32309==    by 0x1135A5: lookup_device (growlight.c:1256)
==32309==    by 0x1135A5: lookup_device (growlight.c:1208)
==32309==    by 0x114E8C: scan_device (growlight.c:1388)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309==  Address 0x1b4a9db8 is 8 bytes inside a block of size 296 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12323B: free_reelbox (ncurses.c:3338)
==32309==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==32309==    by 0x12B8D9: resize_adapter (ncurses.c:3902)
==32309==    by 0x12F0D2: block_callback (ncurses.c:6864)
==32309==    by 0x111D1D: rescan (growlight.c:1126)
==32309==    by 0x111D1D: rescan (growlight.c:908)
==32309==    by 0x113325: create_new_device_inner (growlight.c:1144)
==32309==    by 0x113325: create_new_device (growlight.c:1186)
==32309==    by 0x1135A5: lookup_device (growlight.c:1256)
==32309==    by 0x1135A5: lookup_device (growlight.c:1208)
==32309==    by 0x114E8C: scan_device (growlight.c:1388)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309==  Block was alloc'd at
==32309==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==32309==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12412C: create_reelbox (ncurses.c:3208)
==32309==    by 0x12D9F0: adapter_callback (ncurses.c:6636)
==32309==    by 0x12F299: block_callback (ncurses.c:6839)
==32309==    by 0x111D1D: rescan (growlight.c:1126)
==32309==    by 0x111D1D: rescan (growlight.c:908)
==32309==    by 0x113325: create_new_device_inner (growlight.c:1144)
==32309==    by 0x113325: create_new_device (growlight.c:1186)
==32309==    by 0x1135A5: lookup_device (growlight.c:1256)
==32309==    by 0x1135A5: lookup_device (growlight.c:1208)
==32309==    by 0x114E8C: scan_device (growlight.c:1388)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309== 
==32309== Thread 2:
==32309== Conditional jump or move depends on uninitialised value(s)
==32309==    at 0x483D226: rawmemchr (vg_replace_strmem.c:1421)
==32309==    by 0x529D181: _IO_str_init_static_internal (strops.c:41)
==32309==    by 0x52903DC: vsscanf (iovsscanf.c:40)
==32309==    by 0x528AB93: sscanf (sscanf.c:32)
==32309==    by 0x121399: lex_diskstats (stats.c:150)
==32309==    by 0x121399: read_diskstats (stats.c:176)
==32309==    by 0x115191: event_posix_thread (growlight.c:1676)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309== 
==32309== Thread 1:
==32309== Invalid read of size 8
==32309==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==32309==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==32309==    by 0x123248: free_reelbox (ncurses.c:3339)
==32309==    by 0x123248: free_reelbox (ncurses.c:3332)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133F37: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133F37: use_next_controller (ncurses.c:4148)
==32309==    by 0x133F37: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Address 0x1af04468 is 8 bytes inside a block of size 296 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12323B: free_reelbox (ncurses.c:3338)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133F37: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133F37: use_next_controller (ncurses.c:4148)
==32309==    by 0x133F37: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==32309==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12412C: create_reelbox (ncurses.c:3208)
==32309==    by 0x12D9F0: adapter_callback (ncurses.c:6636)
==32309==    by 0x12F299: block_callback (ncurses.c:6839)
==32309==    by 0x111D1D: rescan (growlight.c:1126)
==32309==    by 0x111D1D: rescan (growlight.c:908)
==32309==    by 0x113325: create_new_device_inner (growlight.c:1144)
==32309==    by 0x113325: create_new_device (growlight.c:1186)
==32309==    by 0x1135A5: lookup_device (growlight.c:1256)
==32309==    by 0x1135A5: lookup_device (growlight.c:1208)
==32309==    by 0x114E8C: scan_device (growlight.c:1388)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309== 
==32309== Thread 2:
==32309== Invalid read of size 8
==32309==    at 0x12B9F1: gap_below (ncurses.c:3803)
==32309==    by 0x12B9F1: resize_adapter (ncurses.c:3954)
==32309==    by 0x12F0D2: block_callback (ncurses.c:6864)
==32309==    by 0x1152B5: update_stats (growlight.c:1539)
==32309==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309==  Address 0x1bc552d0 is 0 bytes inside a block of size 56 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x124115: create_reelbox (ncurses.c:3207)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
==32309== Invalid read of size 2
==32309==    at 0x12B9FD: gap_below (ncurses.c:3803)
==32309==    by 0x12B9FD: resize_adapter (ncurses.c:3954)
==32309==    by 0x12F0D2: block_callback (ncurses.c:6864)
==32309==    by 0x1152B5: update_stats (growlight.c:1539)
==32309==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309==  Address 0x5a7df18 is 24 bytes inside a block of size 296 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12323B: free_reelbox (ncurses.c:3338)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==32309==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==32309==    by 0x12412C: create_reelbox (ncurses.c:3208)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
==32309== Invalid write of size 8
==32309==    at 0x12B96F: resize_adapter (ncurses.c:3974)
==32309==    by 0x12F0D2: block_callback (ncurses.c:6864)
==32309==    by 0x1152B5: update_stats (growlight.c:1539)
==32309==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==32309==    by 0x5204FA2: start_thread (pthread_create.c:486)
==32309==    by 0x53174CE: clone (clone.S:95)
==32309==  Address 0x1bc552e8 is 24 bytes inside a block of size 56 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x124115: create_reelbox (ncurses.c:3207)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
==32309== Thread 1:
==32309== Invalid read of size 4
==32309==    at 0x12AFEA: push_adapters_above.part.30 (ncurses.c:3832)
==32309==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==32309==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==32309==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Address 0x1bc552f8 is 40 bytes inside a block of size 56 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x124115: create_reelbox (ncurses.c:3207)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
==32309== Invalid write of size 4
==32309==    at 0x12AFFB: push_adapters_above.part.30 (ncurses.c:3832)
==32309==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==32309==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==32309==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Address 0x1bc552f8 is 40 bytes inside a block of size 56 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x124115: create_reelbox (ncurses.c:3207)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
==32309== Invalid read of size 8
==32309==    at 0x12A90E: move_adapter (ncurses.c:3271)
==32309==    by 0x12B002: move_adapter_generic (ncurses.c:3327)
==32309==    by 0x12B002: push_adapters_above.part.30 (ncurses.c:3833)
==32309==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==32309==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==32309==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Address 0x1bc552f0 is 32 bytes inside a block of size 56 free'd
==32309==    at 0x4836900: free (vg_replace_malloc.c:538)
==32309==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==32309==    by 0x133026: push_adapters_above (ncurses.c:3822)
==32309==    by 0x133026: use_next_controller (ncurses.c:4131)
==32309==    by 0x133026: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309==  Block was alloc'd at
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x124115: create_reelbox (ncurses.c:3207)
==32309==    by 0x134270: use_next_controller (ncurses.c:4090)
==32309==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== 
growlight-curses: src/ncurses.c:3275: move_adapter: Assertion `rb->as->rb == rb' failed.
==32309== 
==32309== Process terminating with default action of signal 6 (SIGABRT)
==32309==    at 0x52557BB: raise (raise.c:51)
==32309==    by 0x5240534: abort (abort.c:79)
==32309==    by 0x524040E: __assert_fail_base.cold.0 (assert.c:92)
==32309==    by 0x524E101: __assert_fail (assert.c:101)
==32309==    by 0x12AD9E: move_adapter (ncurses.c:3275)
==32309==    by 0x12B002: move_adapter_generic (ncurses.c:3327)
==32309==    by 0x12B002: push_adapters_above.part.30 (ncurses.c:3833)
==32309==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==32309==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==32309==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==32309==    by 0x110185: main (ncurses.c:7113)
==32309== Invalid read of size 8
==32309==    at 0x53E05A5: check_free (dlerror.c:188)
==32309==    by 0x53E0AB1: free_key_mem (dlerror.c:221)
==32309==    by 0x53E0AB1: __dlerror_main_freeres (dlerror.c:239)
==32309==    by 0x5386B71: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.28.so)
==32309==    by 0x482B196: _vgnU_freeres (vg_preloaded.c:75)
==32309==  Address 0x57285b8 is 12 bytes after a block of size 12 alloc'd
==32309==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==32309==    by 0x50A5328: CRYPTO_zalloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x50A156D: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x5082277: ERR_get_state (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x50823C8: ERR_clear_error (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x50A0C98: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x520C996: __pthread_once_slow (pthread_once.c:116)
==32309==    by 0x510A2E8: CRYPTO_THREAD_run_once (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x50A1443: OPENSSL_init_crypto (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x500CF17: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x50A0D0F: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==32309==    by 0x520C996: __pthread_once_slow (pthread_once.c:116)
==32309== 
==32309== 
==32309== HEAP SUMMARY:
==32309==     in use at exit: 1,128,673 bytes in 12,474 blocks
==32309==   total heap usage: 1,637,232 allocs, 1,624,758 frees, 1,386,527,637 bytes allocated
==32309== 
==32309== LEAK SUMMARY:
==32309==    definitely lost: 1,710 bytes in 2 blocks
==32309==    indirectly lost: 9 bytes in 1 blocks
==32309==      possibly lost: 432 bytes in 5 blocks
==32309==    still reachable: 1,126,522 bytes in 12,466 blocks
==32309==         suppressed: 0 bytes in 0 blocks
==32309== Rerun with --leak-check=full to see details of leaked memory
==32309== 
==32309== Use --track-origins=yes to see where uninitialised values come from
==32309== For lists of detected and suppressed errors, rerun with: -s
==32309== ERROR SUMMARY: 308 errors from 10 contexts (suppressed: 0 from 0)
dankamongmen commented 5 years ago

a different assert firing off:

==853== Memcheck, a memory error detector
==853== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==853== Using Valgrind-3.16.0.GIT and LibVEX; rerun with -h for copyright info
==853== Command: ./growlight-curses
==853== 
==853== Thread 2:
==853== Conditional jump or move depends on uninitialised value(s)
==853==    at 0x483D226: rawmemchr (vg_replace_strmem.c:1421)
==853==    by 0x529D181: _IO_str_init_static_internal (strops.c:41)
==853==    by 0x52903DC: vsscanf (iovsscanf.c:40)
==853==    by 0x528AB93: sscanf (sscanf.c:32)
==853==    by 0x121399: lex_diskstats (stats.c:150)
==853==    by 0x121399: read_diskstats (stats.c:176)
==853==    by 0x115191: event_posix_thread (growlight.c:1676)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853== 
==853== Thread 1:
==853== Invalid read of size 8
==853==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==853==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x123248: free_reelbox (ncurses.c:3339)
==853==    by 0x123248: free_reelbox (ncurses.c:3332)
==853==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==853==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==853==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==853==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b015488 is 8 bytes inside a block of size 296 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12323B: free_reelbox (ncurses.c:3338)
==853==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==853==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==853==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==853==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Block was alloc'd at
==853==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==853==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12412C: create_reelbox (ncurses.c:3208)
==853==    by 0x12D9F0: adapter_callback (ncurses.c:6636)
==853==    by 0x12F299: block_callback (ncurses.c:6839)
==853==    by 0x111D1D: rescan (growlight.c:1126)
==853==    by 0x111D1D: rescan (growlight.c:908)
==853==    by 0x113325: create_new_device_inner (growlight.c:1144)
==853==    by 0x113325: create_new_device (growlight.c:1186)
==853==    by 0x1135A5: lookup_device (growlight.c:1256)
==853==    by 0x1135A5: lookup_device (growlight.c:1208)
==853==    by 0x114E8C: scan_device (growlight.c:1388)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853== 
==853== Thread 2:
==853== Invalid read of size 8
==853==    at 0x12B5CC: gap_below (ncurses.c:3803)
==853==    by 0x12B5CC: resize_adapter (ncurses.c:3926)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Address 0x1b7a33a0 is 0 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==853==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==853==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==853==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 2
==853==    at 0x12B5D9: gap_below (ncurses.c:3803)
==853==    by 0x12B5D9: resize_adapter (ncurses.c:3926)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Address 0x1b30df98 is 24 bytes inside a block of size 296 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12323B: free_reelbox (ncurses.c:3338)
==853==    by 0x12B041: push_adapters_above.part.30 (ncurses.c:3840)
==853==    by 0x1342D2: push_adapters_above (ncurses.c:3822)
==853==    by 0x1342D2: use_next_controller (ncurses.c:4097)
==853==    by 0x1342D2: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Block was alloc'd at
==853==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==853==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12412C: create_reelbox (ncurses.c:3208)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==853==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x123248: free_reelbox (ncurses.c:3339)
==853==    by 0x123248: free_reelbox (ncurses.c:3332)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Address 0x1b5b0318 is 8 bytes inside a block of size 296 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12323B: free_reelbox (ncurses.c:3338)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==853==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12412C: create_reelbox (ncurses.c:3208)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x12B4BD: get_current_adapter (ncurses.c:3222)
==853==    by 0x12B4BD: resize_adapter (ncurses.c:3860)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Address 0x1b778ff0 is 32 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 4
==853==    at 0x12B836: resize_adapter (ncurses.c:3879)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Address 0x1b778ff8 is 40 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Thread 1:
==853== Invalid read of size 8
==853==    at 0x132F47: selection_active (ncurses.c:644)
==853==    by 0x132F47: handle_ncurses_input (ncurses.c:6382)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b779000 is 48 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x12BCEC: deselect_adapter_locked (ncurses.c:3258)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b779000 is 48 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid write of size 8
==853==    at 0x12BCF3: select_adapter_node (ncurses.c:3243)
==853==    by 0x12BCF3: deselect_adapter_locked (ncurses.c:3261)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b779000 is 48 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid write of size 4
==853==    at 0x12BCFB: select_adapter_node (ncurses.c:3244)
==853==    by 0x12BCFB: deselect_adapter_locked (ncurses.c:3261)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778ffc is 44 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x129611: redraw_adapter (ncurses.c:1590)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778ff0 is 32 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x129615: redraw_adapter (ncurses.c:1594)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778fd8 is 8 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x48A5A7E: panel_hidden (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12961D: redraw_adapter (ncurses.c:1594)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x599fc70 is 0 bytes inside a block of size 32 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48A567C: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x123248: free_reelbox (ncurses.c:3339)
==853==    by 0x123248: free_reelbox (ncurses.c:3332)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x48A5D32: new_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12413C: create_reelbox (ncurses.c:3209)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==853==    by 0x48A5A85: panel_hidden (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12961D: redraw_adapter (ncurses.c:1594)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b5b0318 is 8 bytes inside a block of size 296 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12323B: free_reelbox (ncurses.c:3338)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==853==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==853==    by 0x12412C: create_reelbox (ncurses.c:3208)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x48A5A93: panel_hidden (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12961D: redraw_adapter (ncurses.c:1594)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x599fc80 is 16 bytes inside a block of size 32 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48A567C: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x123248: free_reelbox (ncurses.c:3339)
==853==    by 0x123248: free_reelbox (ncurses.c:3332)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x48A5D32: new_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12413C: create_reelbox (ncurses.c:3209)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x48A5AA8: panel_hidden (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12961D: redraw_adapter (ncurses.c:1594)
==853==    by 0x132F56: handle_ncurses_input (ncurses.c:6383)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x599fc78 is 8 bytes inside a block of size 32 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x48A567C: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x123248: free_reelbox (ncurses.c:3339)
==853==    by 0x123248: free_reelbox (ncurses.c:3332)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x48A5D32: new_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==853==    by 0x12413C: create_reelbox (ncurses.c:3209)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x132F67: use_next_controller (ncurses.c:4077)
==853==    by 0x132F67: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778ff0 is 32 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x12BCEC: deselect_adapter_locked (ncurses.c:3258)
==853==    by 0x132F9D: use_next_controller (ncurses.c:4084)
==853==    by 0x132F9D: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b779000 is 48 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x132FA5: use_next_controller (ncurses.c:4086)
==853==    by 0x132FA5: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778fe0 is 16 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 8
==853==    at 0x134241: use_next_controller (ncurses.c:4087)
==853==    by 0x134241: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778ff0 is 32 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
==853== Invalid read of size 4
==853==    at 0x132FCC: use_next_controller (ncurses.c:4121)
==853==    by 0x132FCC: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853==  Address 0x1b778ff8 is 40 bytes inside a block of size 56 free'd
==853==    at 0x4836900: free (vg_replace_malloc.c:538)
==853==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==853==    by 0x12B617: resize_adapter (ncurses.c:3927)
==853==    by 0x12F0D2: block_callback (ncurses.c:6864)
==853==    by 0x1152B5: update_stats (growlight.c:1539)
==853==    by 0x1152B5: event_posix_thread (growlight.c:1681)
==853==    by 0x5204FA2: start_thread (pthread_create.c:486)
==853==    by 0x53174CE: clone (clone.S:95)
==853==  Block was alloc'd at
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x124115: create_reelbox (ncurses.c:3207)
==853==    by 0x134270: use_next_controller (ncurses.c:4090)
==853==    by 0x134270: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== 
growlight-curses: src/ncurses.c:4154: use_next_controller: Assertion `top_reelbox == rb' failed.
==853== 
==853== Process terminating with default action of signal 6 (SIGABRT)
==853==    at 0x52557BB: raise (raise.c:51)
==853==    by 0x5240534: abort (abort.c:79)
==853==    by 0x524040E: __assert_fail_base.cold.0 (assert.c:92)
==853==    by 0x524E101: __assert_fail (assert.c:101)
==853==    by 0x134D04: use_next_controller (ncurses.c:4154)
==853==    by 0x134D04: handle_ncurses_input (ncurses.c:6384)
==853==    by 0x110185: main (ncurses.c:7113)
==853== Invalid read of size 8
==853==    at 0x53E05A5: check_free (dlerror.c:188)
==853==    by 0x53E0AB1: free_key_mem (dlerror.c:221)
==853==    by 0x53E0AB1: __dlerror_main_freeres (dlerror.c:239)
==853==    by 0x5386B71: __libc_freeres (in /lib/x86_64-linux-gnu/libc-2.28.so)
==853==    by 0x482B196: _vgnU_freeres (vg_preloaded.c:75)
==853==  Address 0x56d2468 is 12 bytes after a block of size 12 alloc'd
==853==    at 0x4835753: malloc (vg_replace_malloc.c:307)
==853==    by 0x50A5328: CRYPTO_zalloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x50A156D: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x5082277: ERR_get_state (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x50823C8: ERR_clear_error (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x50A0C98: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x520C996: __pthread_once_slow (pthread_once.c:116)
==853==    by 0x510A2E8: CRYPTO_THREAD_run_once (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x50A1443: OPENSSL_init_crypto (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x500CF17: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x50A0D0F: ??? (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
==853==    by 0x520C996: __pthread_once_slow (pthread_once.c:116)
==853== 
==853== 
==853== HEAP SUMMARY:
==853==     in use at exit: 1,139,462 bytes in 12,503 blocks
==853==   total heap usage: 1,638,597 allocs, 1,626,094 frees, 1,389,734,541 bytes allocated
==853== 
==853== LEAK SUMMARY:
==853==    definitely lost: 1,710 bytes in 2 blocks
==853==    indirectly lost: 9 bytes in 1 blocks
==853==      possibly lost: 432 bytes in 5 blocks
==853==    still reachable: 1,137,311 bytes in 12,495 blocks
==853==         suppressed: 0 bytes in 0 blocks
==853== Rerun with --leak-check=full to see details of leaked memory
==853== 
==853== Use --track-origins=yes to see where uninitialised values come from
==853== For lists of detected and suppressed errors, rerun with: -s
==853== ERROR SUMMARY: 1800 errors from 23 contexts (suppressed: 0 from 0)
dankamongmen commented 5 years ago

While it doesn't assert, I'm able to get valgrind complaints just by launching (and then shutting down) growlight-curses in a 80x25 terminal on schwarzgerat:

==3859== Memcheck, a memory error detector
==3859== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3859== Using Valgrind-3.16.0.GIT and LibVEX; rerun with -h for copyright info
==3859== Command: ./growlight-curses
==3859== 
==3859== Thread 6:
==3859== Invalid read of size 8
==3859==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==3859==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==3859==    by 0x123248: free_reelbox (ncurses.c:3339)
==3859==    by 0x123248: free_reelbox (ncurses.c:3332)
==3859==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==3859==    by 0x12BB18: resize_adapter (ncurses.c:3938)
==3859==    by 0x12F0D2: block_callback (ncurses.c:6864)
==3859==    by 0x111D1D: rescan (growlight.c:1126)
==3859==    by 0x111D1D: rescan (growlight.c:908)
==3859==    by 0x113325: create_new_device_inner (growlight.c:1144)
==3859==    by 0x113325: create_new_device (growlight.c:1186)
==3859==    by 0x1135A5: lookup_device (growlight.c:1256)
==3859==    by 0x1135A5: lookup_device (growlight.c:1208)
==3859==    by 0x114E8C: scan_device (growlight.c:1388)
==3859==    by 0x5204FA2: start_thread (pthread_create.c:486)
==3859==    by 0x53174CE: clone (clone.S:95)
==3859==  Address 0x56b3ac8 is 8 bytes inside a block of size 296 free'd
==3859==    at 0x4836900: free (vg_replace_malloc.c:538)
==3859==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x12323B: free_reelbox (ncurses.c:3338)
==3859==    by 0x12AF71: push_adapters_below (ncurses.c:3370)
==3859==    by 0x12BB18: resize_adapter (ncurses.c:3938)
==3859==    by 0x12F0D2: block_callback (ncurses.c:6864)
==3859==    by 0x111D1D: rescan (growlight.c:1126)
==3859==    by 0x111D1D: rescan (growlight.c:908)
==3859==    by 0x113325: create_new_device_inner (growlight.c:1144)
==3859==    by 0x113325: create_new_device (growlight.c:1186)
==3859==    by 0x1135A5: lookup_device (growlight.c:1256)
==3859==    by 0x1135A5: lookup_device (growlight.c:1208)
==3859==    by 0x114E8C: scan_device (growlight.c:1388)
==3859==    by 0x5204FA2: start_thread (pthread_create.c:486)
==3859==    by 0x53174CE: clone (clone.S:95)
==3859==  Block was alloc'd at
==3859==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==3859==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x12412C: create_reelbox (ncurses.c:3208)
==3859==    by 0x12D9F0: adapter_callback (ncurses.c:6636)
==3859==    by 0x12F299: block_callback (ncurses.c:6839)
==3859==    by 0x111D1D: rescan (growlight.c:1126)
==3859==    by 0x111D1D: rescan (growlight.c:908)
==3859==    by 0x113325: create_new_device_inner (growlight.c:1144)
==3859==    by 0x113325: create_new_device (growlight.c:1186)
==3859==    by 0x1135A5: lookup_device (growlight.c:1256)
==3859==    by 0x1135A5: lookup_device (growlight.c:1208)
==3859==    by 0x114E8C: scan_device (growlight.c:1388)
==3859==    by 0x5204FA2: start_thread (pthread_create.c:486)
==3859==    by 0x53174CE: clone (clone.S:95)
==3859== 
==3859== Thread 2:
==3859== Conditional jump or move depends on uninitialised value(s)
==3859==    at 0x483D226: rawmemchr (vg_replace_strmem.c:1421)
==3859==    by 0x529D181: _IO_str_init_static_internal (strops.c:41)
==3859==    by 0x52903DC: vsscanf (iovsscanf.c:40)
==3859==    by 0x528AB93: sscanf (sscanf.c:32)
==3859==    by 0x121399: lex_diskstats (stats.c:150)
==3859==    by 0x121399: read_diskstats (stats.c:176)
==3859==    by 0x115191: event_posix_thread (growlight.c:1676)
==3859==    by 0x5204FA2: start_thread (pthread_create.c:486)
==3859==    by 0x53174CE: clone (clone.S:95)
==3859== 
==3859== Thread 1:
==3859== Invalid read of size 8
==3859==    at 0x48F7035: _nc_screen_of (in /lib/x86_64-linux-gnu/libtinfo.so.6.1)
==3859==    by 0x48A5581: del_panel (in /usr/lib/x86_64-linux-gnu/libpanelw.so.6.1)
==3859==    by 0x123248: free_reelbox (ncurses.c:3339)
==3859==    by 0x123248: free_reelbox (ncurses.c:3332)
==3859==    by 0x12DD5B: adapter_free (ncurses.c:6969)
==3859==    by 0x111494: free_devtable (growlight.c:472)
==3859==    by 0x111494: growlight_stop (growlight.c:2068)
==3859==    by 0x135822: shutdown_cycle (ncurses.c:6994)
==3859==    by 0x11018A: main (ncurses.c:7114)
==3859==  Address 0x58ded18 is 8 bytes inside a block of size 296 free'd
==3859==    at 0x4836900: free (vg_replace_malloc.c:538)
==3859==    by 0x48C1E15: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x12323B: free_reelbox (ncurses.c:3338)
==3859==    by 0x12DD5B: adapter_free (ncurses.c:6969)
==3859==    by 0x111494: free_devtable (growlight.c:472)
==3859==    by 0x111494: growlight_stop (growlight.c:2068)
==3859==    by 0x135822: shutdown_cycle (ncurses.c:6994)
==3859==    by 0x11018A: main (ncurses.c:7114)
==3859==  Block was alloc'd at
==3859==    at 0x48379A2: calloc (vg_replace_malloc.c:760)
==3859==    by 0x48C1EF9: ??? (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x48C211E: newwin_sp (in /lib/x86_64-linux-gnu/libncursesw.so.6.1)
==3859==    by 0x12412C: create_reelbox (ncurses.c:3208)
==3859==    by 0x12D9F0: adapter_callback (ncurses.c:6636)
==3859==    by 0x12F299: block_callback (ncurses.c:6839)
==3859==    by 0x111D1D: rescan (growlight.c:1126)
==3859==    by 0x111D1D: rescan (growlight.c:908)
==3859==    by 0x113325: create_new_device_inner (growlight.c:1144)
==3859==    by 0x113325: create_new_device (growlight.c:1186)
==3859==    by 0x1135A5: lookup_device (growlight.c:1256)
==3859==    by 0x1135A5: lookup_device (growlight.c:1208)
==3859==    by 0x114E8C: scan_device (growlight.c:1388)
==3859==    by 0x5204FA2: start_thread (pthread_create.c:486)
==3859==    by 0x53174CE: clone (clone.S:95)
==3859== 
==3859== 
==3859== HEAP SUMMARY:
==3859==     in use at exit: 855,010 bytes in 9,007 blocks
==3859==   total heap usage: 1,636,866 allocs, 1,627,859 frees, 1,385,606,032 bytes allocated
==3859== 
==3859== LEAK SUMMARY:
==3859==    definitely lost: 1,754 bytes in 3 blocks
==3859==    indirectly lost: 9 bytes in 1 blocks
==3859==      possibly lost: 96 bytes in 4 blocks
==3859==    still reachable: 853,151 bytes in 8,999 blocks
==3859==         suppressed: 0 bytes in 0 blocks
==3859== Rerun with --leak-check=full to see details of leaked memory
==3859== 
==3859== Use --track-origins=yes to see where uninitialised values come from
==3859== For lists of detected and suppressed errors, rerun with: -s
==3859== ERROR SUMMARY: 508 errors from 3 contexts (suppressed: 0 from 0)
dankamongmen commented 4 years ago
Want next adapter (Sandisk Corp WD Black 2018/PC SN720 NVMe SSD->Virtual devices)
Want next adapter (Virtual devices->Sandisk Corp WD Black 2018/PC SN720 NVMe SSD)
Want next adapter (Sandisk Corp WD Black 2018/PC SN720 NVMe SSD->Intel Corporation C610/X99 series chipset USB xHCI Host Controller)
Want next adapter (Intel Corporation C610/X99 series chipset USB xHCI Host Controller->Broadcom / LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon])
Want next adapter (Broadcom / LSI SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]->Intel Corporation C610/X99 series chipset 6-Port SATA Controller [AHCI mode])f
Want next adapter (Intel Corporation C610/X99 series chipset 6-Port SATA Controller [AHCI mode]->Intel Corporation C610/X99 series chipset sSATA Controller [AHCI mode])
Want next adapter (Intel Corporation C610/X99 series chipset sSATA Controller [AHCI mode]->Sandisk Corp WD Black 2018/PC SN720 NVMe SSD)

nvme-0 virtual xhci_pci nvme-1 mpt3sas-0 XX ahci-0 XX (focused) ahci-1 ---\ (split off screen)

--->

!!blankspace!! virtual xhci_pci nvme-1 mpt3sas-0 ahci-0 XX ahci-1 XX (focused, on screen)

----->

crash! nvme-0 ought be getting pulled up into the bottom, displacing ahci-1. ahci-1 actually moves higher up than it needs be to draw ahci-1; it looks like it wants to draw virtual, too. virtual and nvme-0 are both off-screen at the moment of crash. furthermore, on the previous iteration, nvme-0 ought have been partially visible at the top.

dankamongmen commented 4 years ago

Want next adapter (Intel Corporation C610/X99 series chipset 6-Port SATA Controller [AHCI mode]->Intel Corporation C610/X99 series chipset sSATA Controller [AHCI mode])
rb->as->c->name [Intel Corporation C610/X99 series chipset sSATA Controller [AHCI mode]] is PART-VISIBLE-BOTTOM

Want next adapter (Intel Corporation C610/X99 series chipset sSATA Controller [AHCI mode]->Sandisk Corp WD Black 2018/PC SN720 NVMe SSD)
rb->as->c->name [Sandisk Corp WD Black 2018/PC SN720 NVMe SSD] is VISIBLE

yeah that nvme-0 is not visible, and that's the fundamental problem -- it has no panel

dankamongmen commented 4 years ago

I think I've found the root cause. In move_adapter_generic(), we come in with the scrline we want. At the end, we assign getbegy(rb->win) to rb->scrline. In the case where we're partially visible on the top, this resets scrline to 0 when it really ought be negative. All the badness seems to flow from that.

Why is this final assignment necessary? It's definitely breaking us in this case :/.

dankamongmen commented 4 years ago
-------------> CORRECTING SCRLINE: 15 becomes 15 (5 / -1?)
-------------> CORRECTING SCRLINE: 16 becomes 16 (5 / -1?)
-------------> CORRECTING SCRLINE: 17 becomes 17 (5 / -1?)
-------------> CORRECTING SCRLINE: 18 becomes 18 (5 / -1?)
-------------> CORRECTING SCRLINE: 33 becomes 33 (5 / -1?)
-------------> CORRECTING SCRLINE: 42 becomes 42 (8 / -1?)
-------------> CORRECTING SCRLINE: 36 becomes 36 (5 / -1?)
-------------> CORRECTING SCRLINE: 45 becomes 45 (8 / -1?)
-------------> CORRECTING SCRLINE: 39 becomes 39 (5 / -1?)
-------------> CORRECTING SCRLINE: 48 becomes 48 (8 / -1?)
-------------> CORRECTING SCRLINE: 42 becomes 42 (5 / -1?)
-------------> CORRECTING SCRLINE: 51 becomes 51 (8 / -1?)
-------------> CORRECTING SCRLINE: 45 becomes 45 (5 / -1?)
-------------> CORRECTING SCRLINE: 54 becomes 54 (9 / -1?)
-------------> CORRECTING SCRLINE: 48 becomes 48 (5 / -1?)
-------------> CORRECTING SCRLINE: 27 becomes 27 (20 / -1?)
-------------> CORRECTING SCRLINE: 21 becomes 21 (5 / -1?)
-------------> CORRECTING SCRLINE: 13 becomes 13 (7 / -1?)
-------------> CORRECTING SCRLINE: -2 becomes 0 (3 / -1?)
-------------> CORRECTING SCRLINE: 4 becomes 4 (6 / -1?)
-------------> CORRECTING SCRLINE: 11 becomes 11 (7 / -1?)
-------------> CORRECTING SCRLINE: 19 becomes 19 (5 / -1?)
-------------> CORRECTING SCRLINE: 25 becomes 25 (20 / -1?)
-------------> CORRECTING SCRLINE: 46 becomes 46 (5 / -1?)
-------------> CORRECTING SCRLINE: 52 becomes 52 (11 / -1?)
-------------> CORRECTING SCRLINE: 1 becomes 1 (5 / -1?)
-------------> CORRECTING SCRLINE: 28 becomes 28 (20 / -1?)
-------------> CORRECTING SCRLINE: 22 becomes 22 (5 / -1?)
-------------> CORRECTING SCRLINE: 14 becomes 14 (7 / -1?)
-------------> CORRECTING SCRLINE: 7 becomes 7 (6 / -1?)
-------------> CORRECTING SCRLINE: 31 becomes 31 (20 / -1?)
-------------> CORRECTING SCRLINE: 25 becomes 25 (5 / -1?)
-------------> CORRECTING SCRLINE: 17 becomes 17 (7 / -1?)
-------------> CORRECTING SCRLINE: 10 becomes 10 (6 / -1?)
-------------> CORRECTING SCRLINE: 1 becomes 1 (6 / -1?)
-------------> CORRECTING SCRLINE: 8 becomes 8 (7 / -1?)
-------------> CORRECTING SCRLINE: 16 becomes 16 (5 / -1?)
-------------> CORRECTING SCRLINE: 22 becomes 22 (20 / -1?)
-------------> CORRECTING SCRLINE: 43 becomes 43 (11 / -1?)
dankamongmen commented 4 years ago

I removed the correction. The next problem is that when a block event is then delivered on the device at -2, it moves itself for some reason:

---------begin block event on nvme0n1
we're on line -2
  moved Sandisk Corp WD Black 2018/PC SN720 NVMe SSD by 3 to 1
  moving Sandisk Corp WD Black 2018/PC SN720 NVMe SSD (5) from 0 to 1 (3)
   Sandisk Corp WD Black 2018/PC SN720 NVMe SSD at 1 wants 5
  ASKED TO DRAW Sandisk Corp WD Black 2018/PC SN720 NVMe SSD
   Sandisk Corp WD Black 2018/PC SN720 NVMe SSD at 1 wants 5
-------------> CORRECTING SCRLINE: 1 becomes 1 (5 / -1?)
  ASKED TO DRAW Sandisk Corp WD Black 2018/PC SN720 NVMe SSD
  I'M HIDDEN, BITCH!
---------end block event on nvme0n1
dankamongmen commented 4 years ago
---------begin block event on nvme0n1
we're on line -2
into resize_adapter line -2
  moved Sandisk Corp WD Black 2018/PC SN720 NVMe SSD by 3 to 1
  moving Sandisk Corp WD Black 2018/PC SN720 NVMe SSD (5) from 0 to 1 (3)
   Sandisk Corp WD Black 2018/PC SN720 NVMe SSD at 1 wants 5
  ASKED TO DRAW Sandisk Corp WD Black 2018/PC SN720 NVMe SSD
   Sandisk Corp WD Black 2018/PC SN720 NVMe SSD at 1 wants 5
into recompute_selection line 1
into redraw_adapter line 1
  ASKED TO DRAW Sandisk Corp WD Black 2018/PC SN720 NVMe SSD
  I'M HIDDEN, BITCH!
---------end block event on nvme0n1
dankamongmen commented 4 years ago

Alright. If I check delta when moving up to ensure it's positive, not just non-zero, we no longer do this dumb move. That bug has probably existed for close to what 7 years? Bleh. We now hide ourselves unnecessarily and incorrectly:

---------begin block event on nvme0n1
we're on line -2
into resize_adapter line -2 hidden 0
into recompute_selection line -2
into redraw_adapter line -2 hidden 1
  ASKED TO DRAW Sandisk Corp WD Black 2018/PC SN720 NVMe SSD
  I'M HIDDEN, BITCH!
---------end block event on nvme0n1
dankamongmen commented 4 years ago

GOT IT! Needed one more check for delta being positive. I can now scroll happily in either direction all I wish, and everything works. Yay!

stallion