Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-26 Thread Vincent Snijders
2011/2/25 Juha Manninen : > Hi > > I fixed a nasty memory corruption issue in r29667. > It happens when TRegExpr is passed an empty source file. > SearchFrm.pas has: >     RE.InputString:=Src; > > Then GetMem reserves only 1 byte of memory. > Then FreeMem causes a crash and Lazarus dies (in my mach

[Lazarus] ListView questions

2011-02-26 Thread Hans-Peter Diettrich
After a research of the current ListView code I suggest a few changes, that unify the use of an ListView in general. 1) "AllocBy" is a stupid Delphi invention, that better should become "Capacity". The Capacity property can have a more specific meaning, not restricted to virtual (OwnerData) li

Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-26 Thread Juha Manninen
Vincent Snijders kirjoitti lauantai 26 helmikuu 2011 10:27:19: > It probably is some buffer overrun, at least that is more likely than > a bug in the heap manager. > > WIthout sample source that can be compiled and run it is hard to draw > any conclusion form the heaptrc and I doubt that anybody c

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Luca Olivetti
Al 24/02/11 08:22, En/na Graeme Geldenhuys ha escrit: > Op 2011-02-23 18:56, Luca Olivetti het geskryf: >> BTW: in which unit are clock_gettime and related constants defined? > > libc (FPC wrapper to the libc library) > > ...more specifically... > > packages/libc/src/timeh.inc Two things: 1)

Re: [Lazarus] Memory corruption when allocating and freeing 1 byte memory

2011-02-26 Thread Juha Manninen
Vincent Snijders kirjoitti lauantai 26 helmikuu 2011 10:27:19: > It probably is some buffer overrun, at least that is more likely than > a bug in the heap manager. Replacing: GetMem (fInputString, (Len + 1) * SizeOf (REChar)); with: GetMem (fInputString, (Len + 2) * SizeOf (REChar)); in TRegE

[Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Bo Berglund
I have a question regarding the way Lazarus/Fpc programs are running on windows: A few days ago I was testing GPS communications to retrieve accurate time. I had written a small program that connected to the GPS using the SdpoSerial component. All was working OK. Then I decided to check how the t

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Michael Van Canneyt
On Sat, 26 Feb 2011, Bo Berglund wrote: My question here though is: How can a user level program do this? I would have expected an access violation that would have thrown out the program but not a repeatable bluescreen. Why not ? It can invoke a hardware driver function, and that can cause

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Bo Berglund
On Sat, 26 Feb 2011 15:42:06 +0100 (CET), Michael Van Canneyt wrote: >The program itself is probably not the cause, but the hardware driver. >By their very nature, they are less "checked" by windows. > >> >> In all of my programming with Delphi I have never managed to make a >> programming error

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Sergei Gorelkin
Bo Berglund wrote: So it could be the Prolific USB-to-Serial driver then maybe? For example if the port is opened at one baudrate bu the source sends a lot of data at a much lower baudrate? It is hard to guess, but the blue screen itself typically provides the information about the nature of

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Bo Berglund
On Sat, 26 Feb 2011 18:26:33 +0300, Sergei Gorelkin wrote: >Bo Berglund wrote: > >> So it could be the Prolific USB-to-Serial driver then maybe? >> For example if the port is opened at one baudrate bu the source sends >> a lot of data at a much lower baudrate? >> >It is hard to guess, but the bl

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Sergei Gorelkin
Bo Berglund пишет: On Sat, 26 Feb 2011 18:26:33 +0300, Sergei Gorelkin wrote: Bo Berglund wrote: So it could be the Prolific USB-to-Serial driver then maybe? For example if the port is opened at one baudrate bu the source sends a lot of data at a much lower baudrate? It is hard to guess, b

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Marco van de Voort
On Sat, Feb 26, 2011 at 12:46:07PM +0100, Luca Olivetti wrote: > >> BTW: in which unit are clock_gettime and related constants defined? The answer should be : in no portable unit. Unit libc doesn't count since it is only for certain legacy reasons, and Lazarus should NOT use it. -- _

Re: [Lazarus] Android and QT ?

2011-02-26 Thread Razvan Adrian Bogdan
On Thu, Feb 24, 2011 at 9:03 AM, zeljko wrote: > Yes, C wrapper is needed, Qt is C++ lib. > Could Lazarus use the same C wrapper it now uses on Linux since Android is mostly a Linux distro with different GUI ? Razvan -- ___ Lazarus mailing list Lazaru

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Luca Olivetti
Al 26/02/11 17:58, En/na Marco van de Voort ha escrit: > On Sat, Feb 26, 2011 at 12:46:07PM +0100, Luca Olivetti wrote: BTW: in which unit are clock_gettime and related constants defined? > > The answer should be : in no portable unit. > > Unit libc doesn't count since it is only for certain

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Marco van de Voort
On Sat, Feb 26, 2011 at 07:19:52PM +0100, Luca Olivetti wrote: > > > > Unit libc doesn't count since it is only for certain legacy reasons, and > > Lazarus should NOT use it. > > I know that, I know the reasons, and I agree. > But those are posix functions, so they could be defined somewhere else

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Hans-Peter Diettrich
Bo Berglund schrieb: So it could be the Prolific USB-to-Serial driver then maybe? Very likely :-( BTW, is that a MS-certified driver? For example if the port is opened at one baudrate bu the source sends a lot of data at a much lower baudrate? Most probably the driver has not been tested

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread Bo Berglund
On Sat, 26 Feb 2011 19:29:48 +0100, Hans-Peter Diettrich wrote: >Bo Berglund schrieb: > >> So it could be the Prolific USB-to-Serial driver then maybe? > >Very likely :-( > >BTW, is that a MS-certified driver? I think so, in fact Windows Update found a Prolific driver by itself. But it turned out

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Luca Olivetti
Al 26/02/11 19:43, En/na Marco van de Voort ha escrit: > > (1) this discussion is about a gettickcount implementation, but I'm not > entirely sure why this is needed so badly. I use it extensively to keep track of time and I can currently live with the workaround DWord(Trunc(Now * 24 * 60 * 60 *

Re: [Lazarus] Portable way to get accurate timestamps?

2011-02-26 Thread Paulo Costa
On 26/02/2011 18:43, Marco van de Voort wrote: (1) this discussion is about a gettickcount implementation, but I'm not entirely sure why this is needed so badly. When you are doing something soft real time it is a must. Things like: - Is my image processing algorithms under the 40ms allowed t

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread waldo kitty
On 2/26/2011 10:35, Bo Berglund wrote: At the time the bluescreen text said it created a dump and log, I think. But I have no idea where such would be located... mickey mous^H^H^H^H^H^H^H^H^H^Hicrosoft has pages for the software needed to diagnose the dumps and logs... i've been using them for

Re: [Lazarus] Causing bluescreen on windows by move() procedure

2011-02-26 Thread waldo kitty
On 2/26/2011 14:24, Bo Berglund wrote: On Sat, 26 Feb 2011 19:29:48 +0100, Hans-Peter Diettrich wrote: Bo Berglund schrieb: So it could be the Prolific USB-to-Serial driver then maybe? Very likely :-( BTW, is that a MS-certified driver? I think so, in fact Windows Update found a Prolifi

[Lazarus] http://wiki.lazarus.freepascal.org/DELPHI_FORM_TO_HTML_CONVERTER

2011-02-26 Thread Peter Williams
Hi All, http://wiki.lazarus.freepascal.org/DELPHI_FORM_TO_HTML_CONVERTER This is the new component for Lazarus "Delphi Form to HTML Converter" (originally for Delphi 3). Needs some work... please contact PEW... It should work fine with Delphi 3 forms... Help is requested to make it work for Laza