[SERVER-42470] Generate additional configuration for libunwind Created: 29/Jul/19  Updated: 29/Oct/23  Resolved: 12/Mar/22

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 5.3.0-rc4, 5.0.9, 4.4.15

Type: Task Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Daniel Moody
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-61856 Upgrade libunwind to 1.6.2+ Closed
is depended on by SERVER-61547 No stacktraces emitted to log by SIGU... Closed
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0, v4.4
Sprint: Dev Tools 2019-12-30, Dev Platform 2022-01-10, Dev Platform 2022-01-24, Dev Platform 2022-02-07, Dev Platform 2022-02-21, Dev Platform 2022-03-07, Dev Platform 2022-03-21
Participants:

 Description   

Right now we only generate the x86_64 linux variant, but we need the other linux variants as well.



 Comments   
Comment by Githook User [ 18/May/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-61856 SERVER-42470 update libunwind to 1.6.2

(cherry picked from commit 6dd404e028547a29c21b047c2d91ed90ebb1edfb)
Branch: v4.4
https://github.com/mongodb/mongo/commit/b0475e2657c3351b25499971d3340f054ea85b98

Comment by Githook User [ 18/May/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-61856 SERVER-42470 update libunwind to 1.6.2

(cherry picked from commit 6dd404e028547a29c21b047c2d91ed90ebb1edfb)
Branch: v5.0
https://github.com/mongodb/mongo/commit/1a5a5989af161da4baf52ef57e7218b7a42a675a

Comment by Githook User [ 12/Mar/22 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-61856 SERVER-42470 update libunwind to 1.6.2
Branch: master
https://github.com/mongodb/mongo/commit/6dd404e028547a29c21b047c2d91ed90ebb1edfb

Comment by Billy Donahue [ 13/Jan/20 ]

With 22f1d428ec3415fc4ee792eda9ac63b9d451b7d9, we have a build of libunwind for aarch64.
But `--use-libunwind` should not be used.

Mongod hits a SIGSEGV while unwinding certain stacks (inside SIGUSR2 handlers).
The stacktrace_test also hits this. It seems to be a flaw in libunwind's `dwarf/Gparser.c`.
OR it's a flaw in our generated dwarf under GCC. Either way, we can't use it and can't fix it directly.

We see this behavior even with `--use-system-libunwind`, so it's not just our customized SConscript build of libunwind that's showing the problem.

We could probably learn more by running libunwind's self-tests.

Comment by Githook User [ 13/Jan/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-42470 libunwind linux_aarch64 SConstruct and config artifacts
Branch: master
https://github.com/mongodb/mongo/commit/22f1d428ec3415fc4ee792eda9ac63b9d451b7d9

Comment by Githook User [ 10/Jan/20 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-42470 update libunwind to get mongo-local _asm_ patch

import to new v1.4-stable-mongo tag
Branch: master
https://github.com/mongodb/mongo/commit/bd8267ebcee61a9c131a931dbb7031f85dc6cd67

Comment by Billy Donahue [ 09/Jan/20 ]

I was able to build mongod on aarch64 with libunwind enabled.
When I send it a SIGUSR2, I get a crash inside `unw_backtrace()`, as it parses dwarf data.
Filed an upstream bug about it.[
https://github.com/libunwind/libunwind/issues/150
]

libunwind on aarch64 might not be feasible.

 

Effort so far:

    http://mongodbcr.appspot.com/546740270

Comment by Billy Donahue [ 09/Jan/20 ]

Needs a small patch to the aarch64 code, which uses asm instead of _asm_, which is incompatible with mongo scons' -std:c11.
Working on upstreaming from the mongodb-forks/libunwind repo.

https://github.com/libunwind/libunwind/pull/149

Generated at Thu Feb 08 05:00:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.