Problem when loading several libraries, wich use libraries.

Discussing libraries simplifying applications development
  • LibINI uses its own copy of LibIO. Thus, for example, Tinypad has two copies LibIO.

    How do you use LibIO?
  • If what I remember is correct, it has to do with lib_init being called multiple times for the same library.
    I do not think it's a kernel problem.

    BUT.. I havent investigated any of these claims as of yet,
    I was hoping somebody here knows more about the dll loading mechanism then I currently do.. :)

    The program synergyc does not use libio itself.
    BTW: I tought that the dll's are only loaded in memory once ?
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • DLL is loaded into memory only once:
    1) if the path to the file system is the same.
    2) if the library does not change the memory in its own area, where it has its own code.

    LibIO and LibINI violate Rule 2. For this reason, the kernel makes a copy of these libraries for each application.

    lib_init is actually a very harmful thing. And for example in box_lib is imitation - you did it. For this reason, the mechanism of the DLL into the kernel does not duplicate Box_Lib.
  • Mario wrote:DLL is loaded into memory only once:
    1) if the path to the file system is the same.
    2) if the library does not change the memory in its own area, where it has its own code.

    LibIO and LibINI violate Rule 2. For this reason, the kernel makes a copy of these libraries for each application.

    lib_init is actually a very harmful thing. And for example in box_lib is imitation - you did it. For this reason, the mechanism of the DLL into the kernel does not duplicate Box_Lib.
    So every library, wich uses another library suffers the problem (2) ?
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • If the library does not need a call to lib_init, then the question is not relevant.
  • Here is some debugging output I generated.

    The way I see it, libini tries to read proc addresses from libio twice. There is no error checking mechanism and on the second call of dll.link, proc addresses get screwed up ?
    Attachments
    Clipboard01.gif
    Clipboard01.gif (10.07 KiB)
    Viewed 6029 times
    "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein
  • This is very strange behavior. Most recently, I used LibINI for @PANEL (SVN r.2619 and following) and it is no have problem.
    Maybe it makes sense to try a macro SVN_Kolibri\programs\develop\libraries\box_lib\load_lib.mac ?
  • Who is online

    Users browsing this forum: No registered users and 4 guests