Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-02

fpc198 and old bugs

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bartek

hi,

i've just downloaded fpc198 and tried the following out. (there was a bug
with the stack in fpc)
//--------------------------------------------------------------------------
program bug2;
uses sysutils;
type
        tmmxint      =array[0..3] of smallint;
const
        x0 :tmmxint=(0,0,0,0);
var
        a,b,r :tmmxint;

function paddw(a,b :tmmxint):tmmxint;assembler;inline; asm
movq mm0, a
paddw mm0, b
movq @result, mm0
end;

begin
a:=x0;b:=x0;r:=x0;
a[0]:=1;b[0]:=1;
r:=paddw(a,b);
writeln(r[0]);
end.
//--------------------------------------------------------------------------
compilations aborts with:
//--------------------------------------------------------------------------
 Assembling bug2
 bug2.pas(8,13) Error: Error while assembling exitcode 1
 bug2.pas(8,13) Fatal: There were 2 errors compiling module, stopping
//--------------------------------------------------------------------------

other programs also using assembler compiled well.

i've also tried this one out:
//--------------------------------------------------------------------------
program bug;
uses heaptrc,sysutils;
begin
markheap;
end.
//--------------------------------------------------------------------------

output:
//-------------------------------------------------------------------------- ? Free Pascal IDE Version 1.0.2 [2005/02/21]
? Compiler Version 1.9.8
? GBD Version GDB 6.2.1
? Cygwin "E:\fpc198\bin\i386-win32\cygwin1.dll" version 1005.12.0.0 Running "e:\fpc198\work\bug.exe /P"
Marked memory at $00083514 invalid
Wrong signature $AAAAAAAA instead of 8736A0C5
$004072DB
$00404E74
$0040C6D6
$004096B4
$0040C473
$0040C1C9
$004082C6
$00408088
$004022C7
//--------------------------------------------------------------------------

thanks for help in advance
bartek

Reply by email

chromdildo
to Bartek

Hello guys.

I don't want to annoy you again..
...but what's up with TThread ?

TThread.Synchronize(@myfunction);
//simply doesn't call myfunction

I can call it directly but not via synchronize.
If not synchronized, gtk+ blows.

What am I doing wrong :(

best regards and thanks for help
./chrom
----------------------------------------
linux-2.4, fpc 1.9.8, lazarus cvs

Reply by email

Florian Klaempfl
to chromdildo
chromdildo wrote 11 lines
Hello guys. I don't want to annoy you again.. ...but what's up with TThread ? TThread.Synchronize(@myfunction); //simply doesn't call myfunction I can call it directly but not via synchronize. If not synchronized, gtk+ blows. What am I doing wrong :(

You need to call CheckSynchronize in your main loop. However, Sychronize is broken in the 1.9.8 release.

Show quoted text 10 lines
best regards and thanks for help ./chrom ---------------------------------------- linux-2.4, fpc 1.9.8, lazarus cvs _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email

chromdildo
to Florian Klaempfl

Hallo and thanks for the quick reply.

TThread.Synchronize(@myfunction); //simply doesn't call myfunction
Florian Klaempfl wrote
> You need to call CheckSynchronize in your main loop. However,

Sychronize is broken in the 1.9.8 release.

Will this get fixed until 2.0.0 ?
And what about Lazarus LCL, is it calling checksynchronize automatically? Does anybody know?

Found this in the Delphi docs:

*function* CheckSynchronize: Boolean;
It is not necessary to call CheckSynchronize in a GUI application. The call to CheckSynchronize is made automatically by the application object. In a non-GUI application, you must call CheckSynchronize if you use the Synchronize method of TThread. To do this, set the WakeMainThread variable to a procedure that calls CheckSynchronize. CheckSynchronize allows background threads to synchronize their execution with the main thread, so that it is safe to make method calls in the background thread.
CheckSynchronize returns True if a method was synchronized, False if it does nothing.

thanks again and best regards

./chrom

Reply by email

Florian Klaempfl
to chromdildo
chromdildo wrote 10 lines
Hallo and thanks for the quick reply. > TThread.Synchronize(@myfunction); //simply doesn't call myfunction Florian Klaempfl wrote: >> You need to call CheckSynchronize in your main loop. However, Sychronize is broken in the 1.9.8 release. Will this get fixed until 2.0.0 ?

It's already fixed in cvs.

And what about Lazarus LCL, is it calling checksynchronize automatically? Does anybody know?

Yes, it does.

Reply by email