nanovms / nanos

A kernel designed to run one and only one application in a virtualized environment
https://nanos.org
Apache License 2.0
2.64k stars 137 forks source link

issue: assertion staging->end + min < size failed at /nanos/src/fs/tlog.c:427 in log_write_internal() #1970

Closed rinor closed 11 months ago

rinor commented 11 months ago

on latest master https://github.com/nanovms/nanos/commit/f1b4d78ef0b674a6d6309d7fcb4357fef6f01747 after https://github.com/nanovms/nanos/pull/1969 was merged in, having frequent occurrence of this:

frame trace: 
ffffc00001e1fed0:   ffffffff800a245e    (log_flush_timer_expired + 000000000000002e/000000000000007e)
ffffc00001e1fef0:   ffffffff80084b8a    (timer_service + 00000000000000ea/0000000000000372)
ffffc00001e1ff40:   ffffffff80056894    (runloop_internal + 0000000000000164/0000000000000b42)
ffffc00001e1ffc0:   ffffffff8004390f    (context_switch_finish + 000000000000006f/00000000000001c9)

loaded klibs: 
assertion staging->end + min < size failed at /nanos/src/fs/tlog.c:427 (IP 0xffffffff800a1120)  in log_write_internal(); halt
mutex_lock_internal: lock already held - cpu 1, mutex 0xffffc00000c0a080, ctx 0xffffc00001e18000, ra 0xffffffff800487be

and at times followed by:

frame trace: 
ffffc00001e1fa40:   ffffffff80052d53    (pagecache_sync_volume + 00000000000002b3/00000000000002c2)
ffffc00001e1fac0:   ffffffff8005a9b5    (storage_sync + 0000000000000095/00000000000000ef)
ffffc00001e1fb00:   ffffffff80042d43    (kernel_shutdown + 0000000000000163/0000000000000404)
ffffc00001e1fb60:   ffffffff80043896
ffffc00001e1fe60:   ffffffff80048712    (mutex_lock_internal + 0000000000000372/00000000000003d0)
ffffc00001e1fec0:   ffffffff800487be    (mutex_lock + 000000000000000e/0000000000000046)
ffffc00001e1fed0:   ffffffff80096da4    (fs_cache_sync_complete + 00000000000001f4/0000000000000297)
ffffc00001e1ff40:   ffffffff8005694a    (runloop_internal + 000000000000021a/0000000000000b42)
ffffc00001e1ffc0:   ffffffff8004390f    (context_switch_finish + 000000000000006f/00000000000001c9)

loaded klibs: 
assertion enqueue_n_irqsafe(async_queue_1, &aa, sizeof(aa) / sizeof(u64)) failed at /nanos/src/kernel/kernel.h:464 (IP 0xffffffff8004bc60)  in async_apply_1(); halt
francescolavra commented 11 months ago

OK, I see what is causing the assertion failure in the TFS code, I will send a fix shortly. Thanks