-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic (unexpected fault address) on db.meta when rollback #262
Comments
I got the same problem in v1.3.6 |
it seems like db.meta1 has been freed in b.rootNode.spill(). i guess. func (n *node) spill() error { |
We are experiencing the same problem in version
Ignoring the panic itself the underlying error which is returned ( |
Joining the discussion here. We are experiencing this same issue in a released product. In our case this is being run on a small limux SOM with limited resources. It certainly feels like its memory related ( I can recreate it by continuing to add to the database until it hits the 512MB mark, at which point it panics. But what is interesting, is that I can restart my test program on the existing database, and it will grow past the 512MB file size The system we are using only has 256MB of ram. It does not always panic and crash, and it seems to be related to how large the records are that are being added. It feels like if the records are small enough, it sometimes passes this threshold without any issues. Other times the program can restart and get past the threshold, and with even larger records being added, it will panic again on every attempt to add more records. I have small test program that I can provide, but in my case I am only seeing this on certain hardware. (we have other products that use a different SOM with different kernel and more ram.) But am more then willing to try out changes or specific tests if that is helpful. EDIT: here is some system specs in case that's helpful
|
@ptabor I had not looked at that before, looking at it now, and will try it and report back |
@ptabor setting the NoFreelistSync to true (it defaults to false, so thats what I was using in previous testing) in the config does not change the behavior, still crashing
|
Fixed in #362. Please anyone let me know if you still see the panic. |
Release: v1.3.5
Platform: windows/amd64
Cause:
According to the Call Stack, it went into panic when reading db.meta0 and db.meta1. By analyzing the code, I cannot find any lock when retrieving meta page references. So it seems that this would be the cause if the meta pages were re-mapped at the moment? Correct me if I am wrong, thanks!
// mmap opens the underlying memory-mapped file and initializes the meta references.
// minsz is the minimum size that the new mmap can be.
func (db *DB) mmap(minsz int) error {
db.mmaplock.Lock()
defer db.mmaplock.Unlock()
...
...
}
// meta retrieves the current meta page reference.
func (db *DB) meta() *meta {
// We have to return the meta with the highest txid which doesn't fail
// validation. Otherwise, we can cause errors when in fact the database is
// in a consistent state. metaA is the one with the higher txid.
metaA := db.meta0
metaB := db.meta1
if db.meta1.txid > db.meta0.txid {
metaA = db.meta1
metaB = db.meta0
}
...
}
Call Stack:
The text was updated successfully, but these errors were encountered: