[fpc-pascal] Incorrect Process startup

2016-11-06 Thread Steve Gatenby
Intermittantly (but consistantly), my app will run the wrong process 
using either TAsyncProcess or RunCommand.


I understand it will be my bug, just looking for a clue :)

The 'Run' function is within a fpc library.

A loop calls the 'Run' function each second to run a system process (eg 
ls or wmctrl etc) - have tried multiple processes, all do the same.


Symptoms are:

run wmctrl (or other) from the TProcess / RunCommand code
the TProcess instance returns the PID for the new process
read the relevant file under /proc/PID/status - it will intermittently 
show the new process is actually a copy of the caller app.
(meaning: the orig app is called Test1, I try to run wmctrl, I end up 
with 2 copies of Test1 running)


I have found through experimenting:

a pause of 100ms after running the process will fix 80% of cases.

for the other failures, I kill the newly created process, and try again 
(this usually works)


As I said, just looking for ideas (and any such are much appreciated)

i7 8G ram 1T ssd - development only, no heavy background processes

Linux Lubuntu x86 32bit
Lazarus 1.7 r53034:53273M FPC 3.0.0 i386-linux-gtk 2

Thanks - SteveG
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] JSON Test Suite

2016-11-06 Thread Benito van der Zander

Hi,

it is better to use TJSONParser than GetJSON.

GetJSON is defined as:

procedure DefJSONParserHandler(AStream: TStream; const AUseUTF8: 
Boolean; out

  Data: TJSONData);

Var
  P : TJSONParser;

begin
  Data:=Nil;
  P:=TJSONParser.Create(AStream,[joUTF8]);
  try
Data:=P.Parse;
  finally
P.Free;
  end;
end;

with

procedure DefJSONParserHandler(AStream: TStream; const AUseUTF8: 
Boolean; out

  Data: TJSONData);

Var
  P : TJSONParser;

begin
  Data:=Nil;
  P:=TJSONParser.Create(AStream,[*joStrict,*joUTF8]);
  try
Data:=P.Parse;
  finally
P.Free;
  end;
end;

it should pass more


Best,

Benito



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] googleapiconv raises ERESTAPI error

2016-11-06 Thread Michael Van Canneyt



On Sun, 6 Nov 2016, Andreas Frieß wrote:


Hello,

i will try to use the googleapiconverter from the gooleapi examples 
directory. I got some excepions, so i reduced the problem to a generic one.
I use the trunc of FPC and compile the googleapiconv without a problem 
(inside lazarus). If i run it direct from commandline with -A -k ig ot 
the following infos. The stored json file look wellformed and ok.



> C:\Data\development\fpctrunk\fpc\packages\googleapi\examples\generator
> >googleapiconv.exe -A -k Exception at 0043DF98: ERESTAPI:
> Unknown class : "¼F ÿ¼F ý¼F »F °│F T┤FTTypeDef      ê█E
> TTypeDefä`F ÉF   googlediscoverytopas   TRestMethodParam
> ê█E ÿ   ê█E á TRestMethodParams   É".

Any hint 4 me ?


There has been a change in the RTTI, which has not yet been corrected in the
restbase unit. This needs to be done still, it is on my TODO list.

Michael.___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] googleapiconv raises ERESTAPI error

2016-11-06 Thread Andreas Frieß

Hello,

i will try to use the googleapiconverter from the gooleapi examples 
directory. I got some excepions, so i reduced the problem to a generic one.
I use the trunc of FPC and compile the googleapiconv without a problem 
(inside lazarus). If i run it direct from commandline with -A -k ig ot 
the following infos. The stored json file look wellformed and ok.



> C:\Data\development\fpctrunk\fpc\packages\googleapi\examples\generator
> >googleapiconv.exe -A -k Exception at 0043DF98: ERESTAPI:
> Unknown class : "¼F ÿ¼F ý¼F »F °│F T┤FTTypeDef      ê█E
> TTypeDefä`F ÉF   googlediscoverytopas   TRestMethodParam
> ê█E ÿ   ê█E á TRestMethodParams   É".

Any hint 4 me ?

Andreas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal