Am 04.02.2013 12:47, schrieb Graeme Geldenhuys:
Hi,

I found another problem with Semaphores between FreeBSD and Linux.

Attached is my test project. Again, it is similar code used in tiOPF.

For some reason under FreeBSD, it *always* zeros the variable that holds
the Max Pool Size value passed in to sem_init()'s third parameter. This
means that if I try and us that variable anywhere after the sem_init()
call, like when I want to destroy the semaphore, I can't because the
variable now holds the value 0.

[snip]
Any idea why FreeBSD does this? A bug in FPC+FreeBSD?

I have an idea. But for this I'd need some confirmation: Can you please put in your example program the FSemaphore into a record and add also a field of type "array[0..1] of LongInt" to that record and try that again? (of course you'll need to adjust the call to sem_init to use the field in the record). Additionally it would be nice if you write some "well defined garbage" into the added array (e.g. $12345678 and $87654321) and then output the content of the two values after the sem_init call? [and yes, I'm thinking in the context of memory corruption here]

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to