edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* uninitialized globals
@ 2024-04-05  8:29 Karl Dahlke
  2024-04-05 10:43 ` Sebastian Humenda
  0 siblings, 1 reply; 14+ messages in thread
From: Karl Dahlke @ 2024-04-05  8:29 UTC (permalink / raw)
  To: edbrowse-dev

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-04-05 19:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05  8:29 uninitialized globals Karl Dahlke
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

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).