From owner-freebsd-current@FreeBSD.ORG Tue Jul 15 13:19:46 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF030936 for ; Tue, 15 Jul 2014 13:19:46 +0000 (UTC) Received: from ivan-labs.com (ivan-labs.com [162.243.251.239]) by mx1.freebsd.org (Postfix) with ESMTP id 978772556 for ; Tue, 15 Jul 2014 13:19:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ivan-labs.com (Postfix) with ESMTP id 91219120E43 for ; Tue, 15 Jul 2014 17:11:22 +0400 (MSK) X-Virus-Scanned: Debian amavisd-new at Received: from ivan-labs.com ([127.0.0.1]) by localhost (ivan-labs.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vAAKGM5bTpUk for ; Tue, 15 Jul 2014 17:11:22 +0400 (MSK) Received: from [192.168.43.253] (host-4-152-66-217.spbmts.ru [217.66.152.4]) by ivan-labs.com (Postfix) with ESMTPSA id BD27512026F for ; Tue, 15 Jul 2014 17:11:21 +0400 (MSK) Message-ID: <53C52873.5050309@ivan-labs.com> Date: Tue, 15 Jul 2014 17:11:15 +0400 From: "Ivan A. Kosarev" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org Subject: Demangling issues with libcxxrt.so.1 on v9.2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2014 13:19:46 -0000 Hello everybody, It seems there are problems with demandling some kinds of names with libcxxrt.so.1 on FreeBSD 9.2 (I didn't test other versions yet). This program: --- #include #include extern "C" 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(void) { test("_Z9NullDerefPi"); test("_ZL9NullDerefPi"); test("_ZN8DeepFreeILi0EE4freeEPc"); test("_ZN8DeepFreeILi13EE4freeEPc"); test("_ZN8DeepFreeILi36EE4freeEPc"); return 0; } --- outputs: --- _Z9NullDerefPi: status 0; demangled: 'NullDeref(int*)' _ZL9NullDerefPi: status -2 _ZN8DeepFreeILi0EE4freeEPc: status 0; demangled: 'DeepFree<0E>::free(char*)' _ZN8DeepFreeILi13EE4freeEPc: status 0; demangled: 'DeepFree<13E>::free(char*)' _ZN8DeepFreeILi36EE4freeEPc: status 0; demangled: 'DeepFree<36E>::free(char*)' --- Note that it fails to demangle the local name in the 2nd line and adds extra 'E' character in DeepFree<...E>s. The case with the local name is not critical, but the case with DeepFree<...E> prevents LLVM's address sanitizer tests from passing on FreeBSD so the question is: is there a chance the defect will be resolved any time soon or should I try to prepare a fix to speed up the process? Thanks a lot. --