My Firefox did that a few weeks ago. After it was all fixed, I found that the reason was that something had "glitched" on the previous shutdown of Firefox, and corrupted the bookmarks file. I think it rewrites it at shutdown if you've added or changed a bookmark.
There's a utility on my PC - not sure if it's "basic" to Firefox or one of the umpteen options I've installed (probably the latter) - that keeps a daily copy of things like the Bookmarks. I just copied over the bookmarks.html file from the previous day's set.