Bug 224491 - REDZONE: Buffer overflow detected in swap
Summary: REDZONE: Buffer overflow detected in swap
Status: Closed DUPLICATE of bug 231116
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-20 21:13 UTC by Stephen Hurd
Modified: 2018-09-03 18:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Hurd freebsd_committer freebsd_triage 2017-12-20 21:13:58 UTC
When shutting down with redzone enabled, I get the following:

REDZONE: Buffer overflow detected. 16 bytes corrupted after 0xfffffe0091e67688 (6710920 bytes allocated).
Allocation backtrace:
#0 0xffffffff80d66c09 at redzone_setup+0xe9
#1 0xffffffff80a35323 at malloc+0x273
#2 0xffffffff80a8c967 at blist_create+0x97
#3 0xffffffff80d6bcd7 at swaponsomething+0xa7
#4 0xffffffff80d6a3d3 at sys_swapon+0x413
#5 0xffffffff80f06ceb at amd64_syscall+0x79b
#6 0xffffffff80ee58eb at Xfast_syscall+0xfb
Free backtrace:
#0 0xffffffff80d66f74 at redzone_check+0x304
#1 0xffffffff80a353f4 at free+0x54
#2 0xffffffff80d6ac2d at swapoff_one+0x61d
#3 0xffffffff80d6adb7 at swapoff_all+0xd7
#4 0xffffffff80b05c18 at bufshutdown+0x398
#5 0xffffffff80a5a259 at kern_reboot+0x1d9
#6 0xffffffff80a5a024 at sys_reboot+0x3c4
#7 0xffffffff80f06ceb at amd64_syscall+0x79b
#8 0xffffffff80ee58eb at Xfast_syscall+0xfb
Uptime: 1h29m58s

This is with -CURRENT as of today, zfsroot with a separate swap partition that's considerably larger than current RAM (approx 6x as large).  16GB of RAM, 96GB of swap.
Comment 1 Conrad Meyer freebsd_committer freebsd_triage 2017-12-20 21:25:48 UTC
Possibly related to bug 224485, also filed today.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2018-09-03 18:49:21 UTC
This is the same bug as PR 231116: for an allocation of 6710920 bytes we get 6710896 / 16 = 419431 nodes, which is the number of nodes needed to map 33554432 = 2^24 + 2^23 blocks.
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2018-09-03 18:49:34 UTC

*** This bug has been marked as a duplicate of bug 231116 ***