Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id EA678200C3C for ; Mon, 3 Apr 2017 20:44:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E8FCC160B8F; Mon, 3 Apr 2017 18:44:47 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3D192160B8D for ; Mon, 3 Apr 2017 20:44:47 +0200 (CEST) Received: (qmail 12276 invoked by uid 500); 3 Apr 2017 18:44:46 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 12261 invoked by uid 99); 3 Apr 2017 18:44:46 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2017 18:44:46 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id DD456180535 for ; Mon, 3 Apr 2017 18:44:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 3whaXHjN69MT for ; Mon, 3 Apr 2017 18:44:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id F272760D87 for ; Mon, 3 Apr 2017 18:44:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 41168E053A for ; Mon, 3 Apr 2017 18:44:43 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 38A8A24024 for ; Mon, 3 Apr 2017 18:44:42 +0000 (UTC) Date: Mon, 3 Apr 2017 18:44:42 +0000 (UTC) From: "James E. King, III (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (THRIFT-4163) The debian package / autoconf build environment is not setting NDEBUG on production builds, leaving assertions active MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 03 Apr 2017 18:44:48 -0000 [ https://issues.apache.org/jira/browse/THRIFT-4163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15953982#comment-15953982 ] James E. King, III commented on THRIFT-4163: -------------------------------------------- To fix this I am pulling in an autoconf module to enable/disable debug and modified it a little. https://www.gnu.org/software/autoconf-archive/ax_check_enable_debug.html The syntax will be as follows: ||{{./configure --enable-debug=}}||Compiler Options Used||Default?|| |{{yes}}|{{-g -O0}}| | |{{info}}|{{-g -O2}}|yes| |{{profile}}|{{-g -O0 -pg}}| | |{{no}}|{{-O2}}| | {noformat} $ ./configure | grep debugging checking whether to enable debugging... no just optimize $ ./configure --enable-debug=yes | grep debugging checking whether to enable debugging... yes without any optimization $ ./configure --enable-debug=no | grep debugging checking whether to enable debugging... no just optimize {noformat} > The debian package / autoconf build environment is not setting NDEBUG on production builds, leaving assertions active > --------------------------------------------------------------------------------------------------------------------- > > Key: THRIFT-4163 > URL: https://issues.apache.org/jira/browse/THRIFT-4163 > Project: Thrift > Issue Type: Bug > Components: Build Process > Affects Versions: 0.10.0 > Reporter: James E. King, III > Assignee: James E. King, III > Priority: Critical > > In a project that uses thrift I was looking at a core and found an assertion inside thrift triggered it. This was rather strange being in a release build of thrift. > To understand if assertions are active in release builds, I modified PlatformSocket.h and added this close to the top: > {noformat} > #ifdef NDEBUG > #error "NDEBUG IS SET: ASSERTIONS ARE IGNORED" > #else > #error "NDEBUG IS NOT SET: ASSERTIONS ARE ACTIVE" > #endif > {noformat} > Then I built the ubuntu dockerfile and started a debian package distribution build: > {noformat} > # docker build -t thrift build/docker/ubuntu > # docker run -v $(pwd):/thrift/src -it thrift /bin/bash > # dpkg-buildpackage -d -tc 2>&1 | grep NDEBUG > ./src/thrift/transport/PlatformSocket.h:25:2: error: #error "NDEBUG IS NOT SET: ASSERTIONS ARE ACTIVE" > #error "NDEBUG IS NOT SET: ASSERTIONS ARE ACTIVE" > {noformat} > Assertions should not be active in release builds. > Assertions really shouldn't be used; exceptions are much better for C++. That's covered in THRIFT-3978 however. To fix this issue, the autoconf system needs to set NDEBUG for release builds. > I checked the cmake build environment and it does not suffer from this issue. -- This message was sent by Atlassian JIRA (v6.3.15#6346)