[fpc-pascal] Situation with CMEM

Andrey Kubyshev email at vtc.ru
Mon Dec 11 14:49:06 CET 2000

Hello Jonas,

Jonas> FPC's heap manager and IO functions (writeln/readln) are *not* thread
Jonas> safe. That's probably what's causing the crashes. Add the cmem unit (from 
Jonas> the "packages" units) as the first unit in your "uses" clause, then 
Jonas> you're at least safe on the memory management side. You can't use heaptrc 
Jonas> with it though.

Hi, with using CMEM, i found that it must come AFTER pthread unit ,
otherwise progs dont start at all. Seems like it cannot init clib or
something. strace output with that below.
Also, when i put it after, that simple prog with i postet previously crashes before exit. all thread
finished already, but i got RTE 216. Strace have nothing about that .
Thank you for your attention to my problem.

here is strace output :

stat("/usr/lib/zoneinfo/localtime", {st_mode=S_IFREG|0644, st_size=755, ...}) = 0
open("/usr/lib/zoneinfo/localtime", O_RDONLY) = 4
read(4, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0"..., 44) = 44
brk(0)                                  = 0x80b8850
brk(0x80b8880)                          = 0x80b8880
brk(0x80b9000)                          = 0x80b9000
read(4, 0, 536)                         = -1 EFAULT (Bad address)
read(4, 0, 134)                         = -1 EFAULT (Bad address)
--- SIGSEGV (Segmentation fault) ---

Best regards,
Kubyshev Andrey                            mailto:email at vtc.ru

More information about the fpc-pascal mailing list