Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Bruce Tulloch
Confirmed fixed in r13195 as tested with the application in which this was originally discovered, thanks Jonas. Bruce Tulloch wrote: > I've reported this as an FPC bug: > > http://bugs.freepascal.org/view.php?id=13820 > > Cheers, Bruce. > ___ fpc-pa

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Frank, I think the crux of the matter here is how to make the distinction between a pointer with 'no value' and one that is initialized or set to the 'lowest possible value in the range'. The quote I mentioned comes directly from Borland's Object Pascal Langage Manual You can check on this, but

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Frank Peelo
Prince Riley wrote: Hello, I had a chance to go to a reference and check on what the reserved word 'nil' , a special constant, seems to mean. According to the Object Pascal manual (Borland) ... "The reserved word nil is a special constant that can be assigned to any pointer. When nil is ass

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread John Coppens
On Mon, 25 May 2009 21:09:44 + Prince Riley wrote: > Type checking for valid > pointer arithmetic and the difference between a 'null' or empty pointer > and one that has the lowest value of it's type. Maybe the use of 'nil' in an expression should not be allowed at all (except comparisons).

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Jonas Thank you Jonas, for clearing that up. I agree. You have more courage than I my friend to say that, for down that path lies monsters. For while I must agree with your point, in theory it raises a bigger concern. The 'nil' for a pointer constant is problematic in two ways. Fixing this 'bug

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 22:39, Prince Riley wrote: That's a very interesting answer. So am I understanding you to say that the expression of the form var := constant + numeric literal ; is an invalid expression (syntax) in Object Pascal? No, I meant that there was a bug (error) in the compiler

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Jonas, Thanks for the reply. That's a very interesting answer. So am I understanding you to say that the expression of the form var := constant + numeric literal ; is an invalid expression (syntax) in Object Pascal? Why would the expression adding a numeric literal and a numeric constant creat

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Hello, I had a chance to go to a reference and check on what the reserved word 'nil' , a special constant, seems to mean. According to the Object Pascal manual (Borland) ... "The reserved word nil is a special constant that can be assigned to any pointer. When nil is assigned to a pointer, the po

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 19:48, Prince Riley wrote: There seems to be a bigger issue on this... but perhaps someone else confirm that the following programs, similar to the failing one, work. That's because the error was in the constant evaluation (nil and 1 are both constants). Jonas __

[fpc-pascal] Internal error 200502052

2009-05-25 Thread Coco Pascal
I get an internal error 200502052 when building a library on fc10 with lazarus 0.9.26.2/fpc 2.2.2 and a recent nightly build with fpc 2.2.4. It is raised by the following procedure from aasmtai.pas: procedure tai_cpu_abstract.loadref(opidx:longint;const r:treference); begin alloca

Re: [fpc-pascal] IE 200307043

2009-05-25 Thread Prince Riley
Hello, There seems to be a bigger issue on this... but perhaps someone else confirm that the following programs, similar to the failing one, work. program test1; var p: Pointer; begin p := nil; p := p + 1; end. Does work and the following program program test2; var

Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Bruce Tulloch
I've reported this as an FPC bug: http://bugs.freepascal.org/view.php?id=13820 Cheers, Bruce. Bruce Tulloch wrote: > I think I've nailed and example of the problem; when Copy() is called > with the result of another Copy() the reference count for the returned > array is not managed correctly w

Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Bruce Tulloch
I think I've nailed and example of the problem; when Copy() is called with the result of another Copy() the reference count for the returned array is not managed correctly when compiled with -MDelphi. A trivial example program, copytest.pas: program copytest; var S, D : array of Inte

Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 10:30, Bruce Tulloch wrote: PS: does the attribute "compilerproc" mean the function is defined to be called by the compiler implicitly? We have rebuilt the FPC RTL with debug enabled to further diagnose what's happening here (which is why we came across it). It means t

Re: [fpc-pascal] fpc & mysql 5.0 in mac osx 10.5 intel

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 07:04, César Espinoza wrote: how can I use mysql 5.0 in mac OS X 10.5 Intel? I did it in OSX 10.4 ppc, but not in 10.5 Intel I get the message ld: library not found for -llmysqlclient Install the MySQL libraries. They are not installed by default on either Mac OS X 10.4

Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Bruce Tulloch
Ok, I don't think that caveat does not applies in this case, we neither call halt nor share these particular variables between threads (we do have threads in this application however). What we do see when freeing (ie, assigning to nil) some of these variables is a jump from recount = 1 (as we expec

Re: [fpc-pascal] Memory leaks in FPC 2.3.1 SVN 13188

2009-05-25 Thread Jonas Maebe
On 25 May 2009, at 07:38, Bruce Tulloch wrote: Are we correct to assume that as soon as no variable in our program, be it global, static, object field or property, refers to a dynamic array, the dynamic array will be released. Are we also correct to assume that the reassignment of any varia