dankamongmen / growlight

notcurses block device manager / system installation tool

Home Page:https://nick-black.com/dankwiki/index.php/Growlight

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segfault unmounting unmounted new vfat

dankamongmen opened this issue · comments

I created a new VFAT filesystem on my USB drive. I then pressed 'O' instead of 'o', and got a segfault. 1.2.22.

It looks like the new filesystem perhaps didn't take? That would be its own bug, sigh.

[grimes](139) $ cat e
==550315== Memcheck, a memory error detector
==550315== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==550315== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==550315== Command: ./growlight
==550315== 
Term: 52x80 vte-256color (VTE with xterm 256-colors)
==550315== Invalid read of size 1
==550315==    at 0x12D114: fstype_swap_p (fs.h:27)
==550315==    by 0x12D114: umount_filesystem (notcurses.c:4848)
==550315==    by 0x111E04: handle_input (notcurses.c:5484)
==550315==    by 0x111E04: main (notcurses.c:6133)
==550315==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==550315== 
==550315== 
==550315== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==550315==    at 0x4BBEF53: raise (in /usr/lib/libpthread-2.32.so)
==550315==    by 0x4BBF0EF: ??? (in /usr/lib/libpthread-2.32.so)
==550315==    by 0x12D113: fstype_swap_p (fs.h:27)
==550315==    by 0x12D113: umount_filesystem (notcurses.c:4848)
==550315==    by 0x111E04: handle_input (notcurses.c:5484)
==550315==    by 0x111E04: main (notcurses.c:6133)
==550315== 
==550315== HEAP SUMMARY:
==550315==     in use at exit: 1,373,844 bytes in 9,168 blocks
==550315==   total heap usage: 156,863 allocs, 147,695 frees, 1,296,403,226 bytes allocated
==550315== 
==550315== LEAK SUMMARY:
==550315==    definitely lost: 9,896 bytes in 3 blocks
==550315==    indirectly lost: 9 bytes in 1 blocks
==550315==      possibly lost: 480 bytes in 1 blocks
==550315==    still reachable: 1,363,459 bytes in 9,163 blocks
==550315==         suppressed: 0 bytes in 0 blocks
==550315== Rerun with --leak-check=full to see details of leaked memory
==550315== 
==550315== For lists of detected and suppressed errors, rerun with: -s
==550315== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
[grimes](0) $ 

completely reproducible.

it looks like creating this vfat filesystem is breaking our GPT header :(.

Simple enough to solve the segfault, done.