I have encountered a situation that causes a segfault in sfcb's internal
provider. I am writing an indication provider, and using a fairly
simple python script that sets up a filter, a handler, and a
subscription to monitor my indication. This works fine. The problem
occurs when I try to unsubscribe. My indication is deactivated, but as
this is happening I see the segfault. I found this problem while
running 1.2.4, so I tested with the current cvs head and got identical
results.
Here is the stdout from sfcbd, run with no arguments.
root@halga /usr/include/cmpi # sfcbd
--- sfcbd V1.3preview started - 29864
--- Using /usr/local/etc/sfcb/sfcb.cfg
--- SSL not configured
--- User authentication disabled
--- Max provider procs: 32
--- initSocketPairs: 64
--- Max Http procs: 8
--- sfcbd HTTP Daemon V1.3preview started - 29866 - port 5988
--- Keep-alive timeout: 1 seconds
--- Maximum requests per connection: 10
--- localConnectServer started
--- Caching ClassProvider for
/usr/local/var/lib/sfcb/registration/repository/root/virt/classSchemas
(1.0-3) using 3584 bytes
--- Caching ClassProvider for
/usr/local/var/lib/sfcb/registration/repository/root/interop/classSchemas
(1.0-3) using 1092 bytes
Virt_ComputerSystemModifiedIndication.c(213): ActivateFilter
Virt_ComputerSystemModifiedIndication.c(213): ActivateFilter
Virt_ComputerSystemModifiedIndication.c(244):
ComputerSystemModifiedIndication enabled
Virt_ComputerSystemModifiedIndication.c(186): entering event loop
Virt_ComputerSystemModifiedIndication.c(256):
ComputerSystemModifiedIndication disabled
-#- InternalProvider - 29876 provider exiting due to a SIGSEGV signal
Virt_ComputerSystemModifiedIndication.c(201): exiting event loop
All of the "Virt_ComputerSystemModifiedIndication.c(foo): ..." lines are
debug lines from my provider. It seems to be receiving the deactivation
correctly from sfcb, but the segfault causes the subscription, handler,
and filter to not be removed correctly. Generally, I have to run
"killall -9 sfcbd && sfcbrepos" to get things back to a working state.
The indication provider itself is not doing anything complicated. It
just sets up a simple event loop that doesn't do much of anything other
than wait to be deactivated.
Now for the XML that our python script uses to set up and tear down the
filter, handler, and subscription. My apologies for the length. I
grouped the creates with their respective deletes for ease of
comparison; the order we actually run them in is CreateFilter,
CreateHandler, CreateSubscription, then DeleteSubscription,
DeleteHandler, DeleteFilter.
CreateFilter:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationFilter">
<PROPERTY NAME="SystemCreationClassName"
TYPE="string">
<VALUE>CIM_ComputerSystem</VALUE>
</PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="CreationClassName"
TYPE="string">
<VALUE>CIM_IndicationFilter</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>TestFilter</VALUE>
</PROPERTY>
<PROPERTY NAME="Query" TYPE="string">
<VALUE> SELECT * FROM CIM_InstModification
</VALUE>
</PROPERTY>
<PROPERTY NAME="QueryLanguage" TYPE="string">
<VALUE>WQL</VALUE>
</PROPERTY>
<PROPERTY NAME="SourceNamespace" TYPE="string">
<VALUE>root/virt</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteFilter:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationFilterCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE>CIM_IndicationFilterCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>TestFilter</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
CreateHandler:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationHandlerCIMXML">
<PROPERTY NAME="SystemCreationClassName"
TYPE="string">
<VALUE>CIM_ComputerSystem</VALUE>
</PROPERTY>
<PROPERTY NAME="SystemName" TYPE="string">
<VALUE>localhost.localdomain</VALUE>
</PROPERTY>
<PROPERTY NAME="CreationClassName"
TYPE="string">
<VALUE>CIM_IndicationHandlerCIMXML</VALUE>
</PROPERTY>
<PROPERTY NAME="Name" TYPE="string">
<VALUE>TestHandler</VALUE>
</PROPERTY>
<PROPERTY NAME="Destination" TYPE="string">
<VALUE>localhost:8000</VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteHandler:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE>CIM_ComputerSystem</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE>localhost.localdomain</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE>CIM_IndicationHandlerCIMXML</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE>TestHandler</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
CreateSubscription:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="CreateInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="NewInstance">
<INSTANCE CLASSNAME="CIM_IndicationSubscription">
<PROPERTY.REFERENCE NAME="Filter"
REFERENCECLASS="CIM_IndicationFilter">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationFilter">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationFilter
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestFilter
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</PROPERTY.REFERENCE>
<PROPERTY.REFERENCE NAME="Handler"
REFERENCECLASS="CIM_IndicationHandler">
<VALUE.REFERENCE>
<INSTANCENAME
CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationHandlerCIMXML
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestHandler
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</PROPERTY.REFERENCE>
<PROPERTY NAME="SubscriptionState"
TYPE="uint16">
<VALUE> 2 </VALUE>
</PROPERTY>
</INSTANCE>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>
DeleteSubscription:
<?xml version="1.0" encoding="utf-8"?>
<CIM CIMVERSION="2.0" DTDVERSION="2.0">
<MESSAGE ID="4711" PROTOCOLVERSION="1.0">
<SIMPLEREQ>
<IMETHODCALL NAME="DeleteInstance">
<LOCALNAMESPACEPATH>
<NAMESPACE NAME="root"/>
<NAMESPACE NAME="PG_InterOp"/>
</LOCALNAMESPACEPATH>
<IPARAMVALUE NAME="InstanceName">
<INSTANCENAME CLASSNAME="CIM_IndicationSubscription">
<KEYBINDING NAME="Filter">
<VALUE.REFERENCE>
<INSTANCENAME CLASSNAME="CIM_IndicationFilter">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationFilter
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestFilter
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</KEYBINDING>
<KEYBINDING NAME="Handler">
<VALUE.REFERENCE>
<INSTANCENAME
CLASSNAME="CIM_IndicationHandlerCIMXML">
<KEYBINDING NAME="SystemCreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_ComputerSystem
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="SystemName">
<KEYVALUE VALUETYPE="string">
localhost.localdomain
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="CreationClassName">
<KEYVALUE VALUETYPE="string">
CIM_IndicationHandlerCIMXML
</KEYVALUE>
</KEYBINDING>
<KEYBINDING NAME="Name">
<KEYVALUE VALUETYPE="string">
TestHandler
</KEYVALUE>
</KEYBINDING>
</INSTANCENAME>
</VALUE.REFERENCE>
</KEYBINDING>
</INSTANCENAME>
</IPARAMVALUE>
</IMETHODCALL>
</SIMPLEREQ>
</MESSAGE>
</CIM>;
Thanks!
--
-Jay