[SERVER-72219] v4 clang defaults to dwarf4 which is incompat with dwarf64 Created: 16/Dec/22  Updated: 29/Oct/23  Resolved: 19/Dec/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Daniel Moody Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Backwards Compatibility: Fully Compatible
Participants:

 Description   

Our build attempts to turn on dwarf64 if the flag is supported, which it is with clang, but not with dwarf4 which is what clang defaults too. This results in an seg fault when debugging with GDB like this:

0xffffffffffffffff ???
---------------------
/data/mci/f4e13283150adfd2356a788ccb8aaf0a/toolchain-builder/tmp/build-gdb-v4.sh-mGA/src/gdb-12.1/gdb/dwarf2/read.c:6628: internal-error: cutu_reader: Assertion `this_cu->length == cu->header.get_length ()' failed.
A problem internal to GDB has been detected, 

We need to force clangs default to dwarg5 or force clang builds to dwarf32.

 

Workarounds:
Set DWARF_VERSION=5 on the scons command line

OR

Set DWARF_WIDTH=32 on the scons command line 

 



 Comments   
Comment by Githook User [ 17/Dec/22 ]

Author:

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

Message: SERVER-72219 make clang use DWARF5 to be compat with DWARF64
Branch: master
https://github.com/mongodb/mongo/commit/84a5bcfe8d428b15f1fb5d9014da4ab0bfae7927

Generated at Thu Feb 08 06:21:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.