edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: edbrowse-dev@edbrowse.org
Subject: uninitialized globals
Date: Fri, 05 Apr 2024 04:29:01 -0400	[thread overview]
Message-ID: <20240305042901.eklhad@comcast.net> (raw)

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


             reply	other threads:[~2024-04-05  8:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05  8:29 Karl Dahlke [this message]
2024-04-05 10:43 ` Sebastian Humenda
2024-04-05 11:14   ` Tyler Spivey
2024-04-05 11:52     ` Sebastian Humenda
2024-04-05 12:20       ` Tyler Spivey
     [not found]         ` <ZhABdF68z0u7NC7g@kraftkrust>
     [not found]           ` <3749fabd-aadf-95da-99da-04d34268a68a@pcdesk.net>
     [not found]             ` <ZhANkf4kZM2UkLka@kraftkrust>
2024-04-05 14:54               ` Tyler Spivey
2024-04-05 15:48                 ` Tyler Spivey
2024-04-05 18:18                   ` Sebastian Humenda
2024-04-05 18:37                     ` Dominique Martinet
2024-04-05 18:47                       ` Sebastian Humenda
2024-04-05 19:07                         ` Dominique Martinet
2024-04-05 14:21   ` Karl Dahlke
2024-04-05 14:42     ` Sebastian Humenda
2024-04-05 15:10       ` Karl Dahlke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240305042901.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=edbrowse-dev@edbrowse.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).