"Brian C. Lane" writes: > On Tue, Feb 12, 2019 at 04:41:47PM +0000, Mike Small wrote: >> "Brian C. Lane" writes: >> >> > On Fri, Feb 08, 2019 at 11:03:55PM +0000, Mike Small wrote: >> >> Hi, >> >> >> >> Someone shared with me a case where parted 3.2 (3.2-15 as packaged in >> >> Ubuntu Xenial) hit a sigsegv when run as follows: >> > >> > Good job tracking this down! Yes, a test would be good to have, I think >> > this is one of those corner cases that can bite people and lead to lots >> > of confusion :) >> >> I'll start working on the tests today. Maybe I should try installing >> nilfs on a partition and make sure that still works too after the patch >> is in good shape. > > That's probably a good idea. I've attached a patch with a test case that fails without the fix. I've also included a nearly identical test that tries to check the case where the s_bytes field has a reasonable value but one that should make the crc32 check run over bytes beyond the end of what alloca set aside on the stack. Unfortunately, reading that far out on the stack doesn't seem to run into any problem, so the test passed even without the fix. Maybe you won't want that test. When I looked more closely at your tests I saw that t1700 tests detection of a nilfs2 filesystem as long as it's run with PARTED_SECTOR_SIZE=512. That test passed with or without this fix. I'll send the corrected fix in a separate email. -- Mike Small smallm@sdf.org