Am Tuesday 11 September 2012 19:30:55 schrieb Mark Morgan Lloyd: > Rainer Stratmann wrote: > > Am Tuesday 11 September 2012 18:14:57 schrieb Mark Morgan Lloyd: > >> Martin wrote: > >>> On 11/09/2012 10:28, Rainer Stratmann wrote: > >>>> I found out that there is no line information shown (-gl) if an error > >>>> occurs > >>>> (more or less shortly) after the program loads a dynamic library. > >>>> > >>>> This same behaviour happens with fpc version 2.4.2-0 and 2.6.0. > >>>> > >>>> If no library is loaded line information is shown. > >>>> The error adresses are the same in both cases. > >> > >> How is the library being loaded: using FPC's dynlibs unit? > > > > Yes. > > > >> If using dynlibs, is the problem immediately after loading the library > >> (.so) or is it on a call of an entry point in the library? > > > > Immediately after loading the library. > > In which case I presume that you could comment out the calls to the > entry points in the library and duplicate the problem (have you tried > this?). Does the recently-added GetLoadError() function tell you > anything useful?
The error is produced immediately after loading (not executing) the library (writing to a random memory adress). I did not find information of the GetLoadError() function. > >> Is the DLL successfully called, does it exit predictably, and does the > >> stack recover to the state it was on entry (i.e. without an extra or > >> missing word)? > > > > The program restarts some times and there is no error. > > If it's specifically something that happens at load time then below > probably isn't relevant. > > Stack recovery I don't know. I think it will be ok. How can I see that? > > Inline assembler to dump esp and ebp. ? > > I use loadlibrary and freelibrary. > > There are only 3 functions/procedures calling from the program. > > (init_proc, loop_proc, exit_proc). > > The library calls back a procedure (add a key to a keybuffer) but in this > > procedure there is no error. > > I tried safeloadlibrary but the same thing. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal