#6427 closed bug (fixed)
Runtime loader doesn't look for relative add ons in $(PROGDIR)/add-ons/
Reported by: | pulkomandy | Owned by: | phoudoin |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/runtime_loader | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
I downloaded and installed A-Player from http://www.polycode.dk/ Launching it results in a deskbar entry, but the window doesn't show up.
I had a look at the sourcecode, apparently A-Player is trying to load add-ons and Haiku's runtime loader doesn't look in the right folder.
A-Player does something like load_add_on("somefile") while the file is actually located in "$(PROGDIR)/add-ons/somefile". Running A-Player by doing "cd add-ons ; ../APlayer" works fine. I think the runtime loader is not looking in this particular folder.
Attachments (2)
Change History (16)
comment:1 by , 14 years ago
Component: | - General → System/runtime_loader |
---|---|
Description: | modified (diff) |
Summary: | A-player :window does not open → Runtime loader doesn't look for add ons in $(PROGDIR)/add-ons/ |
comment:2 by , 14 years ago
follow-up: 5 comment:4 by , 14 years ago
I attached an strace log. What might be happening is there are subfolders in the add-ons folder and APlayer does something like load_add_on("Clients/MainWindowSystem"). I'm not sure the runtime_loader expect part of the add-on path to be embedded in the name. But I may not have read the code properly :)
comment:5 by , 14 years ago
Replying to pulkomandy:
I attached an strace log. What might be happening is there are subfolders in the add-ons folder and APlayer does something like load_add_on("Clients/MainWindowSystem"). I'm not sure the runtime_loader expect part of the add-on path to be embedded in the name. But I may not have read the code properly :)
The current implementation uses the same search algorithm for add-ons as the one specified for loading libraries via dlopen()
(just with other search paths). When the given name contains a '/' it is directly interpreted as the path to be opened; the search paths are ignored. It seems BeOS's load_add_on() does (also?) try to append the path to the search paths. We should investigate the exact semantics...
comment:6 by , 14 years ago
patch: | 0 → 1 |
---|
follow-up: 8 comment:7 by , 14 years ago
Philippe, have you analyzed the BeOS semantics or just guessed?
comment:8 by , 14 years ago
Replying to bonefish:
Philippe, have you analyzed the BeOS semantics or just guessed?
Just guessed, as I don't have anymore a BeOS machine. And I even fail to test my patch applied, as whatever I do, even rebuilding runtime_loader for the exact revision of my Haiku install, it fail to start any new process and don't boot (rocket icon) anymore.
comment:9 by , 14 years ago
For what it worth, the BeBook says this about load_add_on() pathname argument:
"pathname can be absolute or relative; if it's relative, it's reckoned off the base path specified by the ADDON_PATH environment variable."
by , 14 years ago
Attachment: | add-ons-relative-path.patch added |
---|
Search relative-path add-on image in search paths too.
comment:10 by , 14 years ago
Summary: | Runtime loader doesn't look for add ons in $(PROGDIR)/add-ons/ → Runtime loader doesn't look for relative add ons in $(PROGDIR)/add-ons/ |
---|
follow-up: 14 comment:11 by , 14 years ago
I've rebuild a whole hrev39660 image with just this patch applied to runtime_loader, and use this image since one day long without detecting any regression. Oh, and it does fix this issue too ;-)
Considering that both BeBook and at least one application - which loads with any issue his add-ons under BeOS - makes me think that the semantic for relative add-on pathname is indeed broken currently under Haiku, I've commit that change in hrev39661.
One thing to check is if BeOS try to open CWD's relative addon pathname too (as we do even without this patch) or does it only search in ADDON_PATH. Currently, if both %A/subdir/some-addon and %A/add-ons/subdir/some-addon exists, and the current working directory is %A, load_add_on("subdir/some-addon") will load from the first one. According to BeBook, it should not, but I suspect it does it anyway. If it does not, we need to fix that too.
Could someone with BeOS could check, after moving (not copying) for instance APlayer/add-ons/Clients/MainWindowSystem in a (temporary) APlayer/Clients folder?
comment:12 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:14 by , 14 years ago
Replying to phoudoin:
Could someone with BeOS could check, after moving (not copying) for instance APlayer/add-ons/Clients/MainWindowSystem in a (temporary) APlayer/Clients folder?
If you extend the runtime loader test suite (src/tests/system/runtime_loader/test_suite), I'd be willing to run it on BeOS. :-)
Could you check what's your ADDON_PATH env value? If it's defined, it should have A%/add-ons in the search list, otherwise it's logic the add-on is not found there.
If it's not defined, the default value should search for A%/add-ons: http://dev.haiku-os.org/browser/haiku/trunk/src/system/runtime_loader/runtime_loader.cpp#L27