Bug 217189 - Solid crashes if HAL is not running
Summary: Solid crashes if HAL is not running
Status: RESOLVED UNMAINTAINED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: libsolid-hal (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Alberto Villa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-03 12:59 UTC by Artem Anisimov
Modified: 2018-09-04 15:49 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Artem Anisimov 2009-12-03 12:59:30 UTC
Version:            (using KDE 4.3.4)
Compiler:          GCC 4.4.2 
OS:                Linux
Installed from:    Compiled From Sources

Solid expects that every linux system has HAL installed and running, which is not true.

Components of Solid found in kdelibs look for SOLID_FAKEHW environment variable and do not use HAL if one is found. Other components (found in kdebase-workspace) can not be told not to use HAL (maybe I found no tuning knob in the source?).

Making RPC calls to a nonexistent service is a bad idea especially when Qt 4.6 is used, which crashes when a RPC call is issued to an unavailable service.
Comment 1 Magnus Kessler 2009-12-05 16:37:05 UTC
A concrete example of this is solid 4.3.4 crashing when running with hal-0.5.14. See gentoo bug 295600 (http://bugs.gentoo.org/show_bug.cgi?id=295600).

The fixes from svn commits 1035622 (http://websvn.kde.org/?view=revision&revision=1035622) and 1057980 (http://websvn.kde.org/?view=revision&revision=1057980) should be back-ported to the 4.3 branch.
Comment 2 Vikram Dhillon 2010-01-22 06:29:06 UTC
The Gentoo bug seems to have been fixed, the patch might be applicable here, will put this up for core-devel and see what they have to say on this topic. Thanks.
Comment 3 Artem Anisimov 2010-01-22 06:41:39 UTC
(In reply to comment #2)
> The Gentoo bug seems to have been fixed

In KDE 4.3.95 this bug is not fully fixed -- on systems running without HAL it's necessary to set SOLID_FAKEHW environment variable _before_ launching KDE.

I believe that absence of HAL should be detected automatically.

Does the Gentoo patch address this issue?
Comment 4 Vikram Dhillon 2010-01-22 06:52:51 UTC
@ Artem Anisimov:
Nope, just checked the patch, it only deals with some brightness issues, not setting up the environmental variable, I know for a fact that Lucid (ubuntu next release) is not going to have HAL and that could be a huge problem for the users. Any advice on how to fix this?
Comment 5 Artem Anisimov 2010-01-22 07:27:41 UTC
(In reply to comment #4)

Now (as of KDE 4.3.90) Solid::ManagerBasePrivate::loadBackend (kdelibs/solid/solid/managerbase.cpp:44) simply looks for existence of SOLID_FAKEHW environment variable and uses Solid::Backends::Fake::FakeManager if one is found.

I believe that the necessary modification is quite straightforward -- issue some simple HAL request (something like HAL version query) and see if fails with QDBusError::ServiceUnknown or not.

I think this check should not be made in managerbase, but rather managers need to have method isAvailable() added. In this case loadBackend() can simply iterate over all registered backends and select one which is appropriate for the host system.

A modification of the same sort is necessary to kdebase-workspace which, as I have previously reported, does not even try to adapt itself to the configuration of the host system.
Comment 6 Andrew Crouthamel 2018-09-04 15:49:11 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug. Please try again with the latest version and submit a new bug to frameworks-solid if your issue persists. Thank you!