From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS autolearn=no autolearn_force=no version=3.4.4 Received: from blvuug.org (hurricane.the-brannons.com [IPv6:2602:ff06:725:1:20::25]) by inbox.vuxu.org (Postfix) with ESMTP id A377E21731 for ; Fri, 5 Apr 2024 10:29:41 +0200 (CEST) Received: from hurricane (localhost.localdomain [127.0.0.1]) by blvuug.org (OpenSMTPD) with ESMTP id c1ec492f for ; Fri, 5 Apr 2024 08:29:37 +0000 (UTC) Received: from resdmta-h2p-565048.sys.comcast.net (resdmta-h2p-565048.sys.comcast.net [2001:558:fd02:2446::c]) by hurricane.the-brannons.com (OpenSMTPD) with ESMTPS id a9898d57 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Fri, 5 Apr 2024 08:29:28 +0000 (UTC) Received: from resomta-h2p-555029.sys.comcast.net ([96.102.179.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resdmta-h2p-565048.sys.comcast.net with ESMTPS id sevdr06FGQps2sewwruhsb; Fri, 05 Apr 2024 08:29:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1712305766; bh=xPryJ+89jsNZGmcZXQJgFp3ZgDiUBu1IzGHSWFd7Jvk=; h=Received:Received:To:From:Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type:Xfinity-Spam-Result; b=sWcax3b1dHkwgC0Jh7dx/fR9uZOjnaTcbdD2CO9ZLHIzl5Q45uQ0KYNj4hTm9H8OD hxVnfXn8vQLmTu/MUejiiqqcMXtr6MK27ZGRjrCbOeUSHvaG5xOZBAU5Fs7Q+ol270 BpdF3lU9l/2/iPTn7UMdcb06dsdSFB4EkYK7Uw5xQUwIDb8RAu0vGox8+4LNwy+1Pm NoBJ8RsfP4wpJlGadl+NOzOEyP6GalR50nUVP9FM2QOC2p0Yjql4PD1EUxjrcSjAau J9e87um1tPY0noBEwS/ioYu1Xuh0VRZW+OQZPODZIRJT0mtW5LCd7SvCo6KzXMZpfu /crmx43FnUkKQ== Received: from unknown ([IPv6:2601:408:c580:7bd0::5277]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-h2p-555029.sys.comcast.net with ESMTPSA id sewXrWk2ns23isewYrVy5l; Fri, 05 Apr 2024 08:29:03 +0000 To: edbrowse-dev@edbrowse.org From: Karl Dahlke Reply-To: Karl Dahlke Subject: uninitialized globals Date: Fri, 05 Apr 2024 04:29:01 -0400 Message-ID: <20240305042901.eklhad@comcast.net> X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List MIME-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=no Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfGx8/gvBMNbKKSJKcR/j65J2VQ2YjMUO6JoUVZoBsBduLhMstS1/sOx/O85h07NpAV2WTC5hfjSQxZZ3BDJwMKetAim1+veImJFp02WLJ2Q9WmLBbjSI BYOD46l34Fbxy0BO0cK4zw0lbZ521Z76S4Z5e/Tltr253K+wbQXZiTId2shbePBlVTtDNlRXOhGhr8pUiysMsh0tIxuM48yvhok= Perhaps someone can shed some light on this. I received this from a friend of mine, who does some packaging for debian. ------------------------------ I have been running a self-compiled version of the latest edbrowse 3.8.9 on Debian, compiled with GCC 12.2. It segfaults on startup, and the backtrace suggests it is in main.c:1926, where it nzFree's sslCerts. This is likely caused by some hardning options of the Debian packaging infrastructure. It cause sslCerts to be not NULL-initialised. I couldn't track down exactly which option it is, but the simple fix is to NULL out the static pointer sslCerts. I could hand in a patch, if you like (or a pull request). At the moment, this makes Edbrowse unusable on Debian. ------------------------------ I am rather stunned by this. I have been using C since 1980. Ever since the original K&R, global uninitialized variables are 0. I don't understand how sslCerts could be not zero. The "simple fix" I'm guessing is to set it to 0, but that's not simple because there are dozens of global variables, and some static variables too, that are not initialized, that I count on being zero. If we got past sslCerts we would just run into another one. We'd have to scan through the entire body of code, some 50 thousand lines, to find them all and set them all to 0, or, we could try to understand how and why sslCerts is not null, because I would have said that was impossible. I just did an internet search, and site after site after site confirms that all such uninitialized variables are 0. Karl Dahlke