Page MenuHomeFreeBSD

Overwrite the oldest coredump.
ClosedPublic

Authored by oshogbo on Jun 24 2018, 9:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 12 2024, 10:10 AM
Unknown Object (File)
Dec 20 2023, 2:46 AM
Unknown Object (File)
Sep 6 2023, 10:46 PM
Unknown Object (File)
Sep 6 2023, 10:46 PM
Unknown Object (File)
Sep 6 2023, 10:44 PM
Unknown Object (File)
Sep 6 2023, 10:44 PM
Unknown Object (File)
Sep 6 2023, 10:44 PM
Unknown Object (File)
Sep 1 2023, 4:34 PM
Subscribers

Details

Summary

If we are using %I option in the core dump fileformat we will create as many core dumps as we have CPUs.
The problem is that if we create those core dump the only core dump which will be overwrite will be the last one.
With this patch we will create a new core dump if there is a free slot or if all slot are taken we will overwrite the oldest one.

If you agree about this change I think I should also add the UPDATE note, right?

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

In principle I am indifferent about this, but see the list of the implementation issues.

sys/kern/kern_sig.c
3326

Locals should be declared in the locals block.

3341

I would directly assigned to *vpp and returned there.

3344

Why not use VOP_GETATTR() directly ? You do not need anything except st_mtim.

3351

I believe you should compare whole st_mtim, not only the seconds part.

3354

It seems you need close_locked() local helper.

3481

Local vars should be grouped in the block at the start of the function. Why did you moved tham ?

oshogbo marked 3 inline comments as done.
oshogbo added inline comments.
sys/kern/kern_sig.c
3341

You still need to unlock the oldvpp.

3344

Because I didn't know about it. Fixed.

3481

I prefer to declare the variables in the blocks that are really used, especially when we are moving code around and there is chance that we missed some use of variable. I believe that in OpenSolaris this is the standard.

But I don't want to start any style discussion. I'm ok with moving that.

sys/kern/kern_sig.c
3304

I would not use vn_ namespace in kern_sig.c. vnode_close_locked() is fine as well.

3358

This is wrong test. You should do

lasttime.tv_sec > vattr.va_mtime.tv_sec || (lasttime.tv_sec == vattr.va_mtime.tv_sec && lasttime_tv_nsec >= vattr.va_mtime.tv_nsec)

Your test fails if A.tv_sec > B.tv_sec while A.tv_nsec < B.tv_nsec.

oshogbo marked an inline comment as done.
oshogbo added inline comments.
sys/kern/kern_sig.c
3358

Ofc you are right.

This revision is now accepted and ready to land.Jun 29 2018, 6:08 AM
This revision was automatically updated to reflect the committed changes.