amiga.org
     
iconAll times are GMT -6. The time now is 12:37 AM. | Welcome to Forum, please register to access all of our features.

» Amiga.org » Amiga computer related discussion » Amiga Software Issues and Discussion » More about why SObjs: isn't a great idea

Amiga Software Issues and Discussion This forum exists for the discussion of the use, issues with, and fun brought about by classic and next generation Amiga software.

Reply
 
Thread Tools Display Modes
Old 10-31-2010, 05:55 PM   #1
Matt_H
VIP / Donor
Points: 22,410, Level: 93 Points: 22,410, Level: 93 Points: 22,410, Level: 93
Activity: 40% Activity: 40% Activity: 40%
 
Matt_H's Avatar
 
Join Date: Mar 2003
Location: Boston, MA, United States
Posts: 5,017
Default More about why SObjs: isn't a great idea

I've just finished solving the OS4 equivalent of an episode of DLL hell. An issue in either DOpus 4.18.22 or elf.library 53.12 attempts to open libbz2.so.1.0, which doesn't exist on a 4.1u2 installation with the latest SDK (there's libbz2.so.1.0.4 instead), resulting in 2 highly uninformative error requesters. I was finally able to track down the culprits with the help of a Snoopy log file. xadmaster.library might be involved as well.

This is what happens when version strings are embedded in filenames and then hardcoded into programs. Too many files to keep track of, and they're easily lost during minor upgrades.

Has anyone else experienced this? Or, has anyone ever experienced anything like this with the traditional .library system?
Matt_H is offline   Reply With Quote
Old 10-31-2010, 05:57 PM   #2
SamuraiCrow
Premium Member
Points: 13,317, Level: 75 Points: 13,317, Level: 75 Points: 13,317, Level: 75
Activity: 2% Activity: 2% Activity: 2%
 
SamuraiCrow's Avatar
 
Join Date: Feb 2002
Location: South Dakota, USA
Posts: 2,019
Blog Entries: 2
Send a message via Yahoo to SamuraiCrow Send a message via Skype™ to SamuraiCrow
Default Re: More about why SObjs: isn't a great idea

It's up to the app to make meaningful error messages if LoadLibrary returns NULL. If it just exits with no error message, you're back to using snoopy to find which library failed.
SamuraiCrow is offline   Reply With Quote
Old 10-31-2010, 06:05 PM   #3
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: More about why SObjs: isn't a great idea

You didn't even run into the fun scenario: Two incompatible SObjs with the exact same name, but different ABI (this has happened at least once already). There hasn't been proper documentation about SObj creation and this has lead into all sort of trouble.

They're worse than amiga shared libraries anyway: SObjs aren't even shared, each opener gets their own copy in memory.

As far as I can tell the only reason they exist is that apparently OS4 coders are incapable of creating amiga shared libraries with per caller library base (and the static data in the library base possize). Or they're just too lazy to do it properly, and decided to take the shortcut by introducing the non-shared libraries.

A grave mistake if you ask me.
Piru is offline   Reply With Quote
Old 10-31-2010, 06:45 PM   #4
wawrzon
Defender of the Faith
Points: 7,046, Level: 55 Points: 7,046, Level: 55 Points: 7,046, Level: 55
Activity: 20% Activity: 20% Activity: 20%
 
Join Date: Nov 2007
Posts: 1,234
Default Re: More about why SObjs: isn't a great idea

incorporating version numbers into lib names seems to be a bad habit taken over from the systems incapable to provide version information ín another way.
wawrzon is offline   Reply With Quote
Old 10-31-2010, 10:06 PM   #5
Matt_H
VIP / Donor
Points: 22,410, Level: 93 Points: 22,410, Level: 93 Points: 22,410, Level: 93
Activity: 40% Activity: 40% Activity: 40%
 
Matt_H's Avatar
 
Join Date: Mar 2003
Location: Boston, MA, United States
Posts: 5,017
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Piru
As far as I can tell the only reason they exist is that apparently OS4 coders are incapable of creating amiga shared libraries with per caller library base (and the static data in the library base possize). Or they're just too lazy to do it properly, and decided to take the shortcut by introducing the non-shared libraries.
I think the rationale was for easy quick-n-dirty porting (which I'm also not fond of), but I'm thoroughly baffled as to why these well-established native programs are affected. OS4 xadmaster dates from December 2006, which I thought was before SObjs: was introduced. And I can't see why DOpus would need libbz2.so on its own.

Quote:
Originally Posted by wawrzon View Post
incorporating version numbers into lib names seems to be a bad habit taken over from the systems incapable to provide version information ín another way.
Absolutely agreed. That's not a practice we should be emulating.

Compiling these ported libraries into programs statically would be a cleaner solution.
Matt_H is offline   Reply With Quote
Old 11-01-2010, 03:58 AM   #6
Karlos
Sockologist
Points: 48,752, Level: 100 Points: 48,752, Level: 100 Points: 48,752, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
Karlos's Avatar
 
Join Date: Nov 2002
Location: I solve practical problems...
Posts: 16,606
Blog Entries: 18
Default Re: More about why SObjs: isn't a great idea

To my mind, the biggest problem with shared objects is that they suffer from NIH. However, since we all decided ELF was a good idea, it's not entirely unreasonable for someone to consider the linkable part of the specification.

Quote:
Originally Posted by Piru View Post
You didn't even run into the fun scenario: Two incompatible SObjs with the exact same name, but different ABI (this has happened at least once already). There hasn't been proper documentation about SObj creation and this has lead into all sort of trouble.
Yeah, it was a pain back when most people were migrating from gcc 2.95, the ABI changed a great deal. However, one of the reasons it changed so much was to avoid having to do it again for a long, long time. Don't expect to see changes of that magnitude any time soon. Unless C++0x throws a big spanner in the works. Not impossible...

Quote:
They're worse than amiga shared libraries anyway: SObjs aren't even shared, each opener gets their own copy in memory.
Sure, on AmigaOS, but not for OS that support .so files generally.

Quote:
As far as I can tell the only reason they exist is that apparently OS4 coders are incapable of creating amiga shared libraries with per caller library base (and the static data in the library base possize). Or they're just too lazy to do it properly, and decided to take the shortcut by introducing the non-shared libraries.
The only reason? I think that's being deliberately short sighted. My guess would be that one really obvious reason would the fact that traditional amigaos shared libraries offer no way to provide the required linker constructs for C++ and other languages that some people, myself included, like to use. The world is not tied to procedural programming.

If someone wrote an improved .library specification and loader that allowed things like C++ symbol export it would surely have problems too and at least we know what .so's particular problems are.

Quote:
A grave mistake if you ask me.
The only alternative that provides the same support is static linking. Assuming we disregard the increase in disk storage (which is cheap), one disadvantage of static linking is that you don't get any benefits of a new version of a library without re-linking your app. Obviously, any major change to said library, by definition, probably requires a recompile of the application, so no problem there. On the flipside, provided the exported symbol table doesn't change, there shouldn't need to be any such change. Theoretically, I should be able to swap out some generic .so with say an altivec optimised one, for example and all client users of that library get the same benefit.
__________________
OCA
This isn't SCSI... This is SATA!!!
I have CDO. It's like OCD except all the letters are in ascending order. The way they should be.
Core2 Quad Q9450 2.66GHz / X48T / 4GB DDR3 / nVidia GTX275 / Linux x64, AROS, Win64
A1XE 800MHz / 512MB / Radeon 9200 / OS4.1
A1200T BPPC 240MHz / 256MB / Permedia 2 / OS 3.1 - OS3.9, OS4
A1200T Apollo 1240 28MHz / 32MB / Mediator1200 / Voodoo 3000 / OS3.9
A1200D Apollo 1240 25MHz (ejector seat ROM edition) / 32MB

Last edited by Karlos; 11-01-2010 at 04:01 AM..
Karlos is offline   Reply With Quote
Old 11-01-2010, 04:07 AM   #7
Karlos
Sockologist
Points: 48,752, Level: 100 Points: 48,752, Level: 100 Points: 48,752, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
Karlos's Avatar
 
Join Date: Nov 2002
Location: I solve practical problems...
Posts: 16,606
Blog Entries: 18
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Matt_H View Post
I think the rationale was for easy quick-n-dirty porting (which I'm also not fond of), but I'm thoroughly baffled as to why these well-established native programs are affected. OS4 xadmaster dates from December 2006, which I thought was before SObjs: was introduced. And I can't see why DOpus would need libbz2.so on its own.
Agreed, that is pretty weird. A .so having a dependency on a .library is fine, the converse doesn't really seem reasonable when viewed on the "nativeness" scale in which .library is obviously further up the chain than .so.

Quote:
Compiling these ported libraries into programs statically would be a cleaner solution.
Personally, I dislike static linking, but that's just me. It does make it easier for the end user, but then they always complain about the bloat of statically linked executables and the fact that statically linked application X doesn't support feature X that exists in application Y which happens to have been linked against a newer library
__________________
OCA
This isn't SCSI... This is SATA!!!
I have CDO. It's like OCD except all the letters are in ascending order. The way they should be.
Core2 Quad Q9450 2.66GHz / X48T / 4GB DDR3 / nVidia GTX275 / Linux x64, AROS, Win64
A1XE 800MHz / 512MB / Radeon 9200 / OS4.1
A1200T BPPC 240MHz / 256MB / Permedia 2 / OS 3.1 - OS3.9, OS4
A1200T Apollo 1240 28MHz / 32MB / Mediator1200 / Voodoo 3000 / OS3.9
A1200D Apollo 1240 25MHz (ejector seat ROM edition) / 32MB
Karlos is offline   Reply With Quote
Old 11-01-2010, 05:45 AM   #8
Piru
' union select name,pwd--
Points: 30,457, Level: 100 Points: 30,457, Level: 100 Points: 30,457, Level: 100
Activity: 69% Activity: 69% Activity: 69%
 
Piru's Avatar
 
Join Date: Aug 2002
Location: Helsinki, Finland
Posts: 6,946
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Karlos View Post
Yeah, it was a pain back when most people were migrating from gcc 2.95, the ABI changed a great deal. However, one of the reasons it changed so much was to avoid having to do it again for a long, long time. Don't expect to see changes of that magnitude any time soon. Unless C++0x throws a big spanner in the works. Not impossible...
Well actually what I was trying to say that there were two different libraries with different parameters, but the same name. Clearly this didn't end up well.
Quote:
Sure, on AmigaOS, but not for OS that support .so files generally.
Obvously I was only talking about the shoddy SObjs implementation of AmigaOS here.

Quote:
The only reason? I think that's being deliberately short sighted. My guess would be that one really obvious reason would the fact that traditional amigaos shared libraries offer no way to provide the required linker constructs for C++ and other languages that some people, myself included, like to use. The world is not tied to procedural programming.
C++ must die anyway
Piru is offline   Reply With Quote
Old 11-01-2010, 12:11 PM   #9
Matt_H
VIP / Donor
Points: 22,410, Level: 93 Points: 22,410, Level: 93 Points: 22,410, Level: 93
Activity: 40% Activity: 40% Activity: 40%
 
Matt_H's Avatar
 
Join Date: Mar 2003
Location: Boston, MA, United States
Posts: 5,017
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Karlos View Post
Personally, I dislike static linking, but that's just me. It does make it easier for the end user, but then they always complain about the bloat of statically linked executables and the fact that statically linked application X doesn't support feature X that exists in application Y which happens to have been linked against a newer library
Yeah, in the past I have complained about the bloat of static linking, but as I think about it now, maybe it deserves more consideration. Ease of use for the end user used to be of paramount importance on the Amiga. And a static program is a product of the tools available at the time it was compiled. If the tools improve, recompiling the program to take active advantage of those tools might encourage continued developer involvement.
Matt_H is offline   Reply With Quote
Old 11-01-2010, 12:53 PM   #10
Karlos
Sockologist
Points: 48,752, Level: 100 Points: 48,752, Level: 100 Points: 48,752, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
Karlos's Avatar
 
Join Date: Nov 2002
Location: I solve practical problems...
Posts: 16,606
Blog Entries: 18
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Piru View Post
C++ must die anyway
Get away with ye' , y' love it really :-)

Well, I do, and that's all that matters from this direction
__________________
OCA
This isn't SCSI... This is SATA!!!
I have CDO. It's like OCD except all the letters are in ascending order. The way they should be.
Core2 Quad Q9450 2.66GHz / X48T / 4GB DDR3 / nVidia GTX275 / Linux x64, AROS, Win64
A1XE 800MHz / 512MB / Radeon 9200 / OS4.1
A1200T BPPC 240MHz / 256MB / Permedia 2 / OS 3.1 - OS3.9, OS4
A1200T Apollo 1240 28MHz / 32MB / Mediator1200 / Voodoo 3000 / OS3.9
A1200D Apollo 1240 25MHz (ejector seat ROM edition) / 32MB
Karlos is offline   Reply With Quote
Old 11-02-2010, 05:28 PM   #11
Fats
Technoid
Points: 9,301, Level: 64 Points: 9,301, Level: 64 Points: 9,301, Level: 64
Activity: 2% Activity: 2% Activity: 2%
 
Fats's Avatar
 
Join Date: Mar 2002
Location: Belgium
Posts: 500
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Matt_H View Post
And a static program is a product of the tools available at the time it was compiled.
This thus also means that if a security flaw in one of the libs that are linked to a lot of programs, they need to be relinked and redistributed to the user.
I know, mentioning security and Amiga in the same context does currently not make much sense.

greets,
Staf.
__________________
Trust me... I know what I'm doing
Fats is offline   Reply With Quote
Old 11-02-2010, 05:41 PM   #12
Karlos
Sockologist
Points: 48,752, Level: 100 Points: 48,752, Level: 100 Points: 48,752, Level: 100
Activity: 8% Activity: 8% Activity: 8%
 
Karlos's Avatar
 
Join Date: Nov 2002
Location: I solve practical problems...
Posts: 16,606
Blog Entries: 18
Default Re: More about why SObjs: isn't a great idea

Personally, I'd love to see some native implementation supported by a decent compiler that would allow traditional shared libraries to provide the required services that .so files provide as far as languages beyond C are concerned.

However, since nobody has done anything like that (and it would not be a trivial undertaking), supporting the existing ELF shared object at least grants the developer some flexibility. Furthermore, it's not as alien a concept as it seems, seeing as we're using ELF already.

The earlier observation that a pair of identically named .so files implementing different ABIs being a uniquely bad problem seems a little contrived. After all, the existing .library mechanism doesn't prevent this kind of lunacy either. I could create a foo.library that is nothing to do with the existing foo.library and as long as the meta data is acceptable, the OS will happily pass it to clients that wanted the original, only to invoke meaningless vectors and crash.
__________________
OCA
This isn't SCSI... This is SATA!!!
I have CDO. It's like OCD except all the letters are in ascending order. The way they should be.
Core2 Quad Q9450 2.66GHz / X48T / 4GB DDR3 / nVidia GTX275 / Linux x64, AROS, Win64
A1XE 800MHz / 512MB / Radeon 9200 / OS4.1
A1200T BPPC 240MHz / 256MB / Permedia 2 / OS 3.1 - OS3.9, OS4
A1200T Apollo 1240 28MHz / 32MB / Mediator1200 / Voodoo 3000 / OS3.9
A1200D Apollo 1240 25MHz (ejector seat ROM edition) / 32MB
Karlos is offline   Reply With Quote
Old 11-02-2010, 06:54 PM   #13
Matt_H
VIP / Donor
Points: 22,410, Level: 93 Points: 22,410, Level: 93 Points: 22,410, Level: 93
Activity: 40% Activity: 40% Activity: 40%
 
Matt_H's Avatar
 
Join Date: Mar 2003
Location: Boston, MA, United States
Posts: 5,017
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Fats View Post
This thus also means that if a security flaw in one of the libs that are linked to a lot of programs, they need to be relinked and redistributed to the user.
I know, mentioning security and Amiga in the same context does currently not make much sense.

greets,
Staf.
True, there is that risk. But I'll argue that we have a) security through obscurity, and b) that TCP/IP through a single system library offers an additional inherent layer of security. For example, look how much trouble we have getting Samba daemons and other servers working properly on home networks, let alone across the web

And if a developer needs to recompile to fix a security hole, maybe they'll also take the time to squash bugs or add new features.

Quote:
Originally Posted by Karlos View Post
The earlier observation that a pair of identically named .so files implementing different ABIs being a uniquely bad problem seems a little contrived. After all, the existing .library mechanism doesn't prevent this kind of lunacy either. I could create a foo.library that is nothing to do with the existing foo.library and as long as the meta data is acceptable, the OS will happily pass it to clients that wanted the original, only to invoke meaningless vectors and crash.
Also a possibility, but with particularly well-coded programs you can put necessary .library files in PROGDIR: or PROGDIR:Libs instead of SYS:Libs. Granted, that doesn't make it "shared" anymore, but you can have as many different incarnations of foo.library as you have programs that use it. I think MorphOS checks all these places (and more) for every library it attempts to open - Piru can correct me here. This sort of arrangement for .so files would be an improvement.
Matt_H is offline   Reply With Quote
Old 11-03-2010, 12:15 AM   #14
Golem!dk
Technoid
Points: 6,795, Level: 54 Points: 6,795, Level: 54 Points: 6,795, Level: 54
Activity: 14% Activity: 14% Activity: 14%
 
Golem!dk's Avatar
 
Join Date: Dec 2002
Posts: 414
Default Re: More about why SObjs: isn't a great idea

Quote:
Originally Posted by Matt_H View Post
Also a possibility, but with particularly well-coded programs you can put necessary .library files in PROGDIR: or PROGDIR:Libs instead of SYS:Libs. Granted, that doesn't make it "shared" anymore, but you can have as many different incarnations of foo.library as you have programs that use it.
Mhh... well... if you don't do that multitasking thing, sure. And maybe remember to expunge the library once your program is done with it.
__________________
~
Golem!dk is offline   Reply With Quote
Old 11-03-2010, 12:22 AM   #15
xeron
Kindred of Babble-on
Points: 14,959, Level: 79 Points: 14,959, Level: 79 Points: 14,959, Level: 79
Activity: 1% Activity: 1% Activity: 1%
 
xeron's Avatar
 
Join Date: Mar 2002
Posts: 2,533
Blog Entries: 12
Send a message via ICQ to xeron Send a message via MSN to xeron
Default Re: More about why SObjs: isn't a great idea

Quote:
Also a possibility, but with particularly well-coded programs you can put necessary .library files in PROGDIR: or PROGDIR:Libs instead of SYS:Libs.
Sobjs have the same mechanism, IIRC.
__________________
Playstation Network ID: xeron6
xeron is offline   Reply With Quote
Reply

Bookmarks

Tags
great , sobjs , idea

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump