celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bjoern Petri <bjoern.pe...@sundevil.de>
Subject Re: Crashes due to logHelper in RemoteServiceAdmin
Date Mon, 22 Dec 2014 16:24:54 GMT

When adding the logHelper I tried to prevent changing the API - that's 
why I did it like this (and the RSA it is not the only bundle that uses 
more than one logHelper). But looking at your explanation, I think 
having one logHelper and therefore having an according API change is the 
preferable solution.


On 2014-12-22 16:55, Alexander Broekhuis wrote:
> I've found the problem.
> 
> What happens: The LogService uses a ServiceFactory. Following the spec, 
> a
> ServiceFactory will only create an actual service the first time a 
> bundle
> calls "getService". This service is cached, and reused each time a 
> bundle
> does a getService on the factory.
> So for the logger, this means that each bundle has an own instance of 
> the
> logger.
> 
> In the case of the RSA, the RSA does a getService, which creates the
> initial log service. Then during an import a new loghelper is created
> (still within the RSA bundle). If for that specific import no proxy 
> bundle
> is available, the import will be destroyed.
> Along with destroying the import, the loghelper is also destroyed. 
> Since
> one bundle only has one log_service, that log_service is nog "unget"ed.
> Which results in the segfault.
> 
> A possible solution would be to pass the log_helper via the API to all
> parts of the RSA bundle. Instead of retrieving it again for every 
> object.
> 
> Wdyt?
> 
> 
> 2014-12-22 16:04 GMT+01:00 Bjoern Petri <bjoern.petri@sundevil.de>:
> 
>> 
>> Hi Alexander,
>> 
>> I see the same, but only with the latest commit. So I assume some of 
>> your
>> (correct) changes in the last commit is triggering this now. I'll 
>> check
>> whether I can figure out what's going on here ...
>> 
>> Regards,
>>   Bjoern
>> 
>> 
>> 
>> On 2014-12-22 15:01, Alexander Broekhuis wrote:
>> 
>>> Hi,
>>> 
>>> I'm working on the current remote_proxy_factory to make it more 
>>> generic,
>>> so
>>> that it is easier to use.
>>> 
>>> During testing I ran into a crash when an endpoint is published for 
>>> which
>>> no proxy bundle is available. This crash is due to a call to the
>>> logHelper_log function. I tried to trace the problem but don't see
>>> anything
>>> whats going on. At some point an internal pointer of the log_service
>>> becomes invalid...
>>> 
>>> @Bjoern: I see you pushed the changes to the RSA with the LogHelper, 
>>> have
>>> you seen this before? I can reproduce it by simply running the 
>>> calculator
>>> example of the current master.
>>> 
>> 

Mime
View raw message