freeipmi-devel
[Top][All Lists]
Advanced

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

[Freeipmi-devel] Good news, NULLP BUG solved permanently!


From: Anand Babu
Subject: [Freeipmi-devel] Good news, NULLP BUG solved permanently!
Date: Mon, 26 Apr 2004 18:41:56 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Al,
You are absolutely correct. 

Closing "[bugs #8674] sensors at fish command prompt fails" also
solves NULLP bug :)))

This bug got introduced when getopt-long (GNU style command line
arguments to fish scripts) feature was added to fish scheme
environment. 

Here is the explanation:
------------------------
Sensors main procedure was originally called "sensors". This was
renamed to sensors-main to support getopt-long new feature. But
fi-register-command primitive in sensors.scm was still referring to
old "sensors" symbol. Because registering fish commands was handled in 
C and doesn't differentiate between symbols and strings, this BUG
escaped unnoticed. When ever Garbage Collector (GC) was invoked, this
undefined symbol (but registered)  "sensors" triggered NULLP
exception.

How this bug got solved:
------------------------
Al reported BUG#8674 "sensors command doesn't work inside fish". This
was because, "sensors" symbol is not defined. (got renamed to
sensors-main). While I fixed this bug by writing a new binding
procedure called "sensors", NULLP bug also got closed.

Relevant code:
--------------
(fi-register-command!
 '("sensors"
   "sensors --version --usage --help --verbose --sdr-info
 --flush-cache --list-groups --group=GROUP-NAME --sensors
 \"SENSORS-LIST\"\n\tDisplay IPMI Sensors.\n")) 

void
register_command (SCM command)
{
  if (gh_list_p (dynamic_commands) != 1)
    {// not a list
      dynamic_commands = gh_list (command, SCM_UNDEFINED);
      gh_define (EX_DYNAMIC_COMMANDS, dynamic_commands);
    }
  else
    {
      dynamic_commands =
        gh_append2 (dynamic_commands,
                    gh_list (command, SCM_UNDEFINED));
      gh_define (EX_DYNAMIC_COMMANDS, dynamic_commands);
    }
}

Thanks Al.
-- 
Anand Babu
Free as in Freedom <www.gnu.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]