Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-19 Thread Jonas Maebe


On 19 Dec 2008, at 09:48, Werner Bochtler wrote:


Andrew Brunner schrieb:
Thanks for that tip!  So running under GDB I get the following  
info...


This GDB was configured as "x86_64-linux-gnu"... (gdb) run


shared library problem and linux 64 bit -> maybe this problem is  
related

to FPC bug reports 11931 / 12265 (jump table problem).


In that case, using the fixes branch or the previous release is  
probably a better idea.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-19 Thread Werner Bochtler
Andrew Brunner schrieb:
> Thanks for that tip!  So running under GDB I get the following info...
> 
> This GDB was configured as "x86_64-linux-gnu"... (gdb) run

shared library problem and linux 64 bit -> maybe this problem is related
to FPC bug reports 11931 / 12265 (jump table problem).

Werner


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-18 Thread Andrew Brunner
On Thu, Dec 18, 2008 at 2:04 AM, Michael Van Canneyt
 wrote:

> Are you using threads ?
>
> Michael.


Hi Michael,

Not in the library project.  Although I do plan on having threads in
the Main Application.  Many pooled threads will be running in the main
application.

Just the "application" thread will be running in the "Matrix Modules" Libraries.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-18 Thread Michael Van Canneyt


On Wed, 17 Dec 2008, Andrew Brunner wrote:

> Thanks for that tip!  So running under GDB I get the following info...
> 
> This GDB was configured as "x86_64-linux-gnu"...
> (gdb) run
> 
> Starting program: /mnt/Raid/Developer/Source/Lazarus/Test/TestApplication
> [Thread debugging using libthread_db enabled]
> [New Thread 0x7f9e79102770 (LWP 7388)]
> [WARNING] Out of OEM specific VK codes, changing to unassigned
> [WARNING] Out of unassigned VK codes, assigning $FF
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7f9e79102770 (LWP 7388)]
> 0x7f9e71a38d68 in fpc_finalize ()
>from 
> /home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so

Are you using threads ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-17 Thread Andrew Brunner
Thanks for that tip!  So running under GDB I get the following info...

This GDB was configured as "x86_64-linux-gnu"...
(gdb) run

Starting program: /mnt/Raid/Developer/Source/Lazarus/Test/TestApplication
[Thread debugging using libthread_db enabled]
[New Thread 0x7f9e79102770 (LWP 7388)]
[WARNING] Out of OEM specific VK codes, changing to unassigned
[WARNING] Out of unassigned VK codes, assigning $FF

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7f9e79102770 (LWP 7388)]
0x7f9e71a38d68 in fpc_finalize ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
(gdb)


#1  0x7f9e719f6170 in ?? ()
#2  0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#3  0x7fff8092e038 in ?? ()
#4  0x7f9e719f6170 in ?? ()
#5  0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#6  0x7fff8092e050 in ?? ()
#7  0x7f9e719f6170 in ?? ()
#8  0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#9  0x7fff8092e068 in ?? ()
#10 0x7f9e719f6170 in ?? ()
#11 0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#12 0x7fff8092e080 in ?? ()
#13 0x7f9e719f6170 in ?? ()
#14 0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#15 0x7fff8092e098 in ?? ()
#16 0x7f9e719f6170 in ?? ()
#17 0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#18 0x7fff8092e0b0 in ?? ()
#19 0x7f9e719f6170 in ?? ()
#20 0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#21 0x7fff8092e0c8 in ?? ()
#22 0x7f9e719f6170 in ?? ()
#23 0x7f9e71c40060 in _$CLASSES$_Ld233 ()
   from 
/home/atbrunner/Source/Lazarus/Libraries/MatrixMemory/MatrixMemoryManager.so
#24 0x7fff8092e0e0 in ?? ()
#25 0x7f9e719f6170 in ?? ()
#26 0x7f9e71c40060 in _$CLASSES$_Ld233 ()




It appears that something is wrong with the classes unit or something.
 Keep in mind, the compiled library is nothing more than 2 functions
declared as exported booleans that don't have any parameters.



On Wed, Dec 17, 2008 at 8:03 AM, Felipe Monteiro de Carvalho
 wrote:
> Read this to create a backtrace:
>
> http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB
>
> --
> Felipe Monteiro de Carvalho
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-17 Thread Jonas Maebe


On 17 Dec 2008, at 02:55, Andrew Brunner wrote:

On Tue, Dec 16, 2008 at 3:29 PM, Jonas Maebe > wrote:


In what code does it crash? Inside unloadlibrary, or (shortly)  
afterwards?

What is the backtrace at the point of the crash?


It blows out right during the DynLibs.UnloadLibrary(FLibHandle)

There is only a read access violation that is raised.  Presumably by
the MM of the SO.


Please create a self-contained test case that demonstrates the problem  
and submit a bug report.



I have smart linking options enabled or else the Compiler can't link
the project during build.



What is the error?


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-17 Thread Felipe Monteiro de Carvalho
Read this to create a backtrace:

http://wiki.lazarus.freepascal.org/Creating_a_Backtrace_with_GDB

-- 
Felipe Monteiro de Carvalho
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-16 Thread Andrew Brunner
On Tue, Dec 16, 2008 at 3:29 PM, Jonas Maebe  wrote:

> In what code does it crash? Inside unloadlibrary, or (shortly) afterwards?
> What is the backtrace at the point of the crash?

It blows out right during the DynLibs.UnloadLibrary(FLibHandle)

There is only a read access violation that is raised.  Presumably by
the MM of the SO.

>> Are there a few tricks involved in getting FPC to compile these SOs
>> properly?  The minute I include Classes in my project's uses I can't
>> Unload the library.
>
> Even if you don't call any routines from that unit?
>

Yes,  If I compile with no uses clause the Lib loads and unloads as I
want.  As many times as I want with no issues.  But if I re-build the
SAME Library project with the uses Classes; The Main Application
crashes on the UnloadLibrary call.  I repeat, all I have to do to
reproduce this bug is to use Classes; unit inside a Library under
Ubuntu.

I have smart linking options enabled or else the Compiler can't link
the project during build.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-16 Thread Jonas Maebe


On 16 Dec 2008, at 13:58, Andrew Brunner wrote:


I've been experiencing problems with SOs under Linux and am trying to
develop a "Plugin" system for my Server I'm porting to Lazarus.  I'm
confident can get these Plug-ins to Load and Operate just fine at
least in (Ubuntu).

I can't however, Unload them.  I want to be able to use the
DynLibs.UnloadLibrary to unload a library.  I can't because I keep
getting a Segmentation Fault and the Application Crashes just by
calling the Unload Library.


In what code does it crash? Inside unloadlibrary, or (shortly)  
afterwards? What is the backtrace at the point of the crash?



Are there a few tricks involved in getting FPC to compile these SOs
properly?  The minute I include Classes in my project's uses I can't
Unload the library.


Even if you don't call any routines from that unit?


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Problems with Dynlibs.UnloadLibrary on Linux

2008-12-16 Thread Andrew Brunner
I've been experiencing problems with SOs under Linux and am trying to
develop a "Plugin" system for my Server I'm porting to Lazarus.  I'm
confident can get these Plug-ins to Load and Operate just fine at
least in (Ubuntu).

I can't however, Unload them.  I want to be able to use the
DynLibs.UnloadLibrary to unload a library.  I can't because I keep
getting a Segmentation Fault and the Application Crashes just by
calling the Unload Library.

This problem makes using SOs/DLLs pointless because if one plugin is
unloaded and the main service application closes due to a crash, all
plugins running under that process will go down with it.

Here's my extensive thread so far.  I'm hoping to find a good solution
shortly as this is slowing me down.

http://www.lazarus.freepascal.org/index.php?name=PNphpBB2&file=viewtopic&t=6033&start=0&postdays=0&postorder=asc&highlight=

Are there a few tricks involved in getting FPC to compile these SOs
properly?  The minute I include Classes in my project's uses I can't
Unload the library.  If I just have straight forewared simple data
types with no other uses I can get these to unload.  Do you have any
ideas?

I'm using all the latest and greatest FPC and Lazarus sources from
subversion as of 2008.12.15.

Thanks for you input, if any,  Andy.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal