`program_invocation_name' bug =?=> `gnomelib_init' API change



Hi,

I was experiencing a lot of SIGSEGVs recently.  While trying to figure
this out I came across one bug that could be causing some. 

On non-glibc systems, the variable `program_invocation_name' is not set
until `gnomelib_parse_args' is called.  By this time `gnome_client_init'
is already called.  `gnome_client_init' hence initializes
`master_client->program' to a NULL value, which when used unwarily (as
in passing to printf or strrchr), can cause a SIGSEGV.

One hacky way to solve this is in `gnome_master_client' to verify if
`master_client->program' is NULL, and re-initialize it there.  

A better way, IMHO, is to pass just argv[0] to `gnomelib_init'.  This
however involves changing the `gnomelib_init' API.  AFAI can make out,
this is a low impact change, since I could find only 10 direct calls to
`gnomelib_init', 5 of which were in the test-suite.

Comments, alternative?

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]