Bug 192115

Summary: Demangling issues with libcxxrt.so.1
Product: Base System Reporter: Ivan Kosarev <ivan>
Component: standardsAssignee: Ed Maste <emaste>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste, mmokhi
Priority: --- Keywords: needs-qa
Version: 9.2-RELEASE   
Hardware: Any   
OS: Any   

Description Ivan Kosarev 2014-07-25 15:17:46 UTC
This test program:

---
#include <stdlib.h>
#include <stdio.h>

char* __cxa_demangle(const char* mangled_name,
                     char* buf,
                     size_t* n,
                     int* status);

void test(const char *mangled)
{
  int status = 0;
  char *DemangledName = __cxa_demangle(mangled, NULL, NULL, &status);
  printf("%s: status %d", mangled, status);
  if(status == 0)  {
    printf("; demangled: '%s'", DemangledName);
  }
  free(DemangledName);
  printf("\n");
}

int main() {
  test("_ZN8DeepFreeILi17EE4freeEPc");
  return 0;
}
--- 

when linked against libcxxrt.so.1 on x86-64 FreeBSD 9.2 print:

---
_ZN8DeepFreeILi17EE4freeEPc: status 0; demangled: 'DeepFree<17E>::free(char*)'
---

Note the extra 'E' in 'DeepFree<17E>'.

'DeepFree<17>' is expected.

This bug affects passing LLVM's address sanitizers tests on FreeBSD.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2014-07-25 17:11:02 UTC
LLVM cross-reference: http://reviews.llvm.org/D4668
Comment 2 Ed Maste freebsd_committer freebsd_triage 2015-05-04 21:05:47 UTC
Reported upstream at: https://sourceforge.net/p/elftoolchain/tickets/488/
Comment 3 VK 2016-06-04 14:49:52 UTC
Guys, does this problem still exist? The upstream reports fixed. Adding proper maintainer-feedback request now, as it was never set to begin with (so no timeout). There are open PRs to upgrade libcxxrt, so I'm setting a dependency relationship. Please correct if wrong.
Comment 4 VK 2016-06-04 15:00:51 UTC
I see now the original report is about libcxxrt in the base. I have wrongly associated this with the port. Reverting. However, since the upstream report is closed, fixed, what to do with this PR?
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2016-08-08 07:27:48 UTC
Upstream reports this as closed/fixed and the PR is a year old, so AFAICT it is obsolete.
Comment 6 Ed Maste freebsd_committer freebsd_triage 2016-08-08 10:36:43 UTC
Testing on stable/10 and HEAD shows that this issue no longer exists.

The upstream ELF Tool Chain fix was merged to libcxxrt in 
https://github.com/pathscale/libcxxrt/commit/58e8df3e30043c1a5d5e6dab5932e429a55d3613 and from there merged to FreeBSD in r284551. Merged to stable/10 in r288182.