# dump bug



## KernelPanic (Aug 5, 2021)

Since FreeBSD11 is reaching end of support, I recently upgraded my home firewall/fileserver/game server to FreeBSD 13. The fresh install greeted me with a bug:






						244470 – /sbin/dump crashes on larger filesystem
					






					bugs.freebsd.org
				




Running stable-13 on my home firewall isn't a great option, so I guess my only recourse waiting for 13.1?

Edit: My filesystem is only 1TB (899G)


----------



## richardtoohey2 (Aug 5, 2021)

It looks like a tiny patch - only 591 bytes - so you could build (or ask someone to do so) - an updated binary as a short-term fix?



			https://bz-attachments.freebsd.org/attachment.cgi?id=222230
		


It looks like a one byte change - the missing equals sign:
	
	



```
-    assert(spcl.c_count + blks < TP_NINDIR);
+    assert(spcl.c_count + blks <= TP_NINDIR);
```


----------



## Vull (Aug 5, 2021)

You could also try 13.0-RELEASE which has never given me any problems on 3 different machines. It's a little more stable than the -STABLE version according to this reference:









						Topics about unsupported FreeBSD versions
					

The FreeBSD Forums cater primarily to end-users and systems administrators. As such, the Forums focus almost exclusively on FreeBSD versions that are officially supported according to the official FreeBSD website. Since resources are scarce, the FreeBSD Forums strongly suggest that anyone asking...




					forums.freebsd.org


----------



## richardtoohey2 (Aug 5, 2021)

The bug is in 13.0 RELEASE.  I'm having a look (just for fun/the learning experience) at what's involved trying to fix it by building on another machine.

root@blob:/home/blob # cd /usr/src/
root@blob:/usr/src # fetch https://download.freebsd.org/ftp/releases/amd64/amd64/13.0-RELEASE/src.txz
root@blob:/usr/src # tar xzvf src.txz
root@blob:/usr/src # mv usr/src/* .

I got my directories a bit mixed up - hence having to mv things around - so above not the recommended steps!

Make the change to sbin/dump/traverse.c

root@blob:/usr/src # make install

And I have a new /sbin/dump ... but it's bigger than the old binary so suspect there's a clean/strip step somewhere along the line.  And the src file for 13.0 RELEASE might not be the best starting point, but don't think dump will have changed since release but could be very wrong!

EDIT: nothing wrong with the new binary file size - exactly the same as the old (I haven't made the code change at this point, just seeing if I could build from source easily), just me looking at the wrong thing.

So change line 759 to include the =

 759         assert(spcl.c_count + blks <= TP_NINDIR);

Then make clean and make and make install and I have a new binary. 

EDIT2: I don't use dump so don't know if this will fix the OP's problem - but the whole process has taken < 30 minutes (src.txz is 153M), so might be of use to you, KernelPanic.  But maybe try it all on a test machine, YMMV no warranties etc.!


----------



## grahamperrin@ (Nov 13, 2021)

KernelPanic please, was this resolved?


----------



## _martin (Nov 21, 2021)

Have a look in PR 244470. The other day somebody was asking about the code review here in forums ; the message from commit-hook: 
	
	



```
This assertion was added in this commit with no review by someone
    with expertise in the dump program:
```


----------



## grahamperrin@ (Nov 25, 2021)

NB (for readers who might not follow the link) the "no review" part of the sentence does *not* mean that there was no review.

Code _was_ reviewed prior to commit ☑ however the quality of the review turned out, in hindsight, to be _lacking_.


----------



## richardtoohey2 (Nov 26, 2021)

I'm a little bit confused - the patch I suggested is OK - it is the correct version?  Or not?   

I think OK: https://cgit.freebsd.org/src/commit/?id=efe145a7453e4208f032816ce3f80e9fb6b0e4ee

But if it's incorrect then I'd like to fix it.


----------



## grahamperrin@ (Nov 27, 2021)

richardtoohey2 said:


> I think OK: https://cgit.freebsd.org/src/commit/?id=efe145a7453e4208f032816ce3f80e9fb6b0e4ee



That 2021-05-17 commit mentions `2d518c6518cdb256ff6f2c463e6b115d89c104c3`, which relates (but does not link) to a 2018-06-11 commit: <https://cgit.freebsd.org/src/commit/?id=2d518c6518cdb256ff6f2c463e6b115d89c104c3>.


----------

