Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Problematic Module Load Ordering #676

Open
CamberLoid opened this issue Oct 8, 2022 · 0 comments · May be fixed by #696
Open

Bug: Problematic Module Load Ordering #676

CamberLoid opened this issue Oct 8, 2022 · 0 comments · May be fixed by #696

Comments

@CamberLoid
Copy link

Description

When launching with no parameters (all modules), modules benchmark.so and computer.so failed to be loaded due to undefined symbols (see log below) which are in devices.so. This leads to an unexpected prompt asking user to load computer.so, along with the missing of benchmark.so-related features.

In hardinfo/utils.c:

hardinfo/hardinfo/util.c

Lines 966 to 971 in 10f9789

while ((filename = (gchar *) g_dir_read_name(dir))) {
if (g_strrstr(filename, "." G_MODULE_SUFFIX) &&
module_in_module_list(filename, module_list) &&
((module = module_load(filename)))) {
modules = g_slist_prepend(modules, module);
}

I think this may be caused by an undefined order returned from g_dir_read_name(). Document (see references) says "The order of entries returned from this function is not defined", and make other modules load before devices.so.

I managed to write a patch as a workaround which may fix the problem, but I am not confident about it and not going to create a pull request about this. The patch makes function modules_load() call module_load((gchar *) "devices.so") before traversing modules directory.

Build with -DHARDINFO_GTK3='ON'

References:

Log

(full: https://gist.github.com/CamberLoid/c597378249c693749f953c90caea90b2)

*** /usr/src/debug/hardinfo-git/hardinfo/hardinfo/util.c:558 (ui_init) *** initializing gtk+ UI
*** /usr/src/debug/hardinfo-git/hardinfo/hardinfo/hardinfo.c:114 (main) *** loading all modules
*** /usr/src/debug/hardinfo-git/hardinfo/shell/iconcache.c:27 (icon_cache_init) *** initializing icon cache
*** /usr/src/debug/hardinfo-git/hardinfo/hardinfo/util.c:744 (module_load) *** gmodule resource for ``/home/camber/aur/hardinfo-git/pkg/hardinfo-git/usr/lib/hardinfo/modules/computer.so'' is (nil) (/home/camber/aur/hardinfo-git/pkg/hardinfo-git/usr/lib/hardinfo/modules/computer.so: undefined symbol: memory_devices_get_system_memory_types_str)
*** /usr/src/debug/hardinfo-git/hardinfo/hardinfo/util.c:811 (module_load) *** cannot g_module_open(``computer.so''). permission problem?
*** /usr/src/debug/hardinfo-git/hardinfo/hardinfo/util.c:813 (module_load) *** loading module computer.so failed: /home/camber/aur/hardinfo-git/pkg/hardinfo-git/usr/lib/hardinfo/modules/computer.so: undefined symbol: memory_devices_get_system_memory_types_str
CamberLoid added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Oct 8, 2022
* Introduced a new patch to fix problematic loading order of modules. See
... upstream issue lpereira/hardinfo#676
* Dropped unneeded prepare file
* Updated dependency list

Signed-off-by: Camber Huang <[email protected]>
CamberLoid added a commit to AOSC-Dev/aosc-os-abbs that referenced this issue Oct 9, 2022
* Introduced a new patch to fix problematic loading order of modules. See
... upstream issue lpereira/hardinfo#676
* Dropped unneeded prepare file
* Updated dependency list

Signed-off-by: Camber Huang <[email protected]>
@direc85 direc85 linked a pull request Jul 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant