[fpc-pascal] fp libraries do not like cmem ?

Tomas Hajny XHajT03 at hajny.biz
Thu Feb 13 17:27:31 CET 2014


On Thu, February 13, 2014 17:13, Sven Barth wrote:
> Am 13.02.2014 17:04, schrieb Fred van Stappen:
 .
 .
>> I resume: if i use cmem in uses section of uos library (without debug
>> on) it compile but i get that error when a program call the library
>> (at thread.terminate):
>>
>> Program received signal SIGSEGV, Segmentation fault.
>> [Switching to Thread 0x7fffe859c700 (LWP 3289)]
>> 0x00007fffefe08944 in ?? ()
>>    from /home/fred/uoslib/examples/lib/Linux/64bit/libuos-64.so
 .
 .
>> Here the uses section :
>> uses
>>  {$IFDEF UNIX}
>>  cthreads,
>>  cwstring, {$ENDIF}
>>   cmem,  // => debugger focus here, saying "Error: Duplicate
>> identifier "cmem" ??
> compiler, not debugger
>>   ctypes, uos;
>
> Put cmem at the first location of the library's uses clause (before the
> ifdef).

In addition, if that doesn't help, start your application with GDB ('gdb
yourprogram'), 'run' it from there. After you get the SIGSEGV, request the
backtrace (GDB command 'bt') to see the sequence leading to this
situation. Observing the parameters may help in understanding what goes
wrong (e.g. pointers containing a nil value where not expected or other
senseless values not expected for real pointers, string parameters showing
garbage, etc.).

Tomas





More information about the fpc-pascal mailing list