Re: [Lazarus] New feature: SQLDB Rest bridge

2019-02-24 Thread Michael Van Canneyt via lazarus



On Mon, 25 Feb 2019, Sven Barth via lazarus wrote:


Michael Van Canneyt via lazarus  schrieb am
So., 24. Feb. 2019, 17:46:



Hello,

We received some feedback about Pas2JS - our effort to bring Pascal to the
browser - that easy database connectivity is an issue, hampering easy
development.

To alleviate the problem I have created the SQLDB Rest bridge.

This is a set of components that allow you to expose any database supported
by FPC's SQLDB as a REST service. It is designed to be simple to use, yet
extensible.



Cool! Great work!
Now I only need to get the parts for implementing an Interface using RTTI
working and I'd be all but set :D


You mean for an RPC mechanism ?

Isn't Invoke() working already ? I have a JSON RPC implemention on my list,
and thought to use Invoke() for that.



HTTP:

* Authentication is handled using the HTTP protocol.

* Basic authentication is included by default, but is completely pluggable.

* Basic authentication can look up valid users in a database (by default
the database being exposed)



How would one check whether the user is allowed to execute an action?


There is an OnAllowResource event, after the authentication. One of the
parameters is the operation: GET, PUT etc.
If you set the 'allow' to false, you'll get a 403, 'Forbidden'. 
It's not yet committed, because I wanted that together with the business processor component, 
which will make implementing all kinds of events simpler. 
There are stilll several improvements waiting to be tested and committed.


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] New feature: SQLDB Rest bridge

2019-02-24 Thread Sven Barth via lazarus
Michael Van Canneyt via lazarus  schrieb am
So., 24. Feb. 2019, 17:46:

>
> Hello,
>
> We received some feedback about Pas2JS - our effort to bring Pascal to the
> browser - that easy database connectivity is an issue, hampering easy
> development.
>
> To alleviate the problem I have created the SQLDB Rest bridge.
>
> This is a set of components that allow you to expose any database supported
> by FPC's SQLDB as a REST service. It is designed to be simple to use, yet
> extensible.
>

Cool! Great work!
Now I only need to get the parts for implementing an Interface using RTTI
working and I'd be all but set :D

HTTP:
> * Authentication is handled using the HTTP protocol.
>
> * Basic authentication is included by default, but is completely pluggable.
>
> * Basic authentication can look up valid users in a database (by default
> the database being exposed)
>

How would one check whether the user is allowed to execute an action?

Regards,
Sven

>
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Martin Frb via lazarus

On 24/02/2019 22:07, Werner Pamler via lazarus wrote:

Am 24.02.2019 um 12:00 schrieb Michael Van Canneyt via lazarus:


Start lazarus
Open package
Compile package
Switch to form editor of start project
Close (window manager or menu file - exit)
-> hang



Just to confirm: I can observe the same on Windows and have to kill 
the IDE with the task manager. Sometimes the IDE does not close any 
more even after compiling a simple project. After uninstalling OPM the 
issue is gone.



Same question, any change of finding where it hangs?
- attach
- view stack
- set breakpoints further up the stack
- see what's the furthest out breakpoint is that gets reached?
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Werner Pamler via lazarus

Am 24.02.2019 um 12:00 schrieb Michael Van Canneyt via lazarus:

I find that the IDE has become very unstable lately. I didn't install any
new packages, didn't update FPC (still on FPC 3.0.4). Just updated 
lazarus

from SVN.

4 out of 5 attempts to close the IDE using the window manager button 
fails:

lazarus hangs and I must kill it using
killall -KILL lazarus
from a terminal.

It's very reproducible.

Start lazarus
Open package
Compile package
Switch to form editor of start project
Close (window manager or menu file - exit)
-> hang



Just to confirm: I can observe the same on Windows and have to kill the 
IDE with the task manager. Sometimes the IDE does not close any more 
even after compiling a simple project. After uninstalling OPM the issue 
is gone.


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] New feature: SQLDB Rest bridge

2019-02-24 Thread Michael Van Canneyt via lazarus


Hello,

We received some feedback about Pas2JS - our effort to bring Pascal to the
browser - that easy database connectivity is an issue, hampering easy 
development.

To alleviate the problem I have created the SQLDB Rest bridge.

This is a set of components that allow you to expose any database supported
by FPC's SQLDB as a REST service. It is designed to be simple to use, yet 
extensible.

A database can be exposed using a single line of code:
 
FDisp.ExposeDatabase('PostGreSQL','localhost','expensetracker','me','secret',Nil,[foFilter,foInInsert,foInUpdate,foOrderByDesc]);

But no code is needed, the whole can be configured in the IDE if so desired.

This is not meant as a general REST service framework, (you can look for
instance at the Brook framework for this) but is meant to easily expose
SQL databases using a REST protocol.

Not-so-Short summary of possibilities:

SQL/REST:

* Every REST resource is defined by up to 4 SQL statements, corresponding to 
the 4 CRUD operations.
  But statements can be auto-generated.

* The CRUD Statements can be auto generated on the fly, based on a table name 
and field definitions.

* For every field, an alias can be provided.

* The following client-side types are available, automatically mapped from the 
native database type:

 String, 32/64-bit integer, float, Boolean, Date, Time, DateTime, Blob

* Support for a sequence to generate IDs is built-in.

* Full control over which operations (GET,POST,PUT,DELETE) are allowed.

* Resources are collected in a schema.

* Multiple schemas can be attached to the service.

* Multiple databases (connections) can be defined.

* A schema can be tied to a single connection, or connections can share a 
schemas (use case: a different connection per client).

* Business processor components can be hooked to a resource, to make it easier 
to implement business logic. (not yet committed)

* SQL Statements can contain parameters, values for the parameters will be 
picked up from the request URL.

* Support to get custom datasets.

* Support for client-side provided SQL SELECT statements (optional, disabled by 
default)

* Full support for configuration through an .ini file out of the 
box.


HTTP:
* Authentication is handled using the HTTP protocol.

* Basic authentication is included by default, but is completely pluggable.

* Basic authentication can look up valid users in a database (by default the 
database being exposed)

* Output format can be fixed or detected per request (?fmt=format). Detection 
based on content-type is also available.

* list of fields to include in output can be specified in the URL: 
?fl=field1,field2

* Field list of fields to exclude from output can be specified in the URL: 
?fe=field1,field2

* Various input/output formats are available out of the box

  JSON (the default),XML,CSV, CDS (Format used by Delphi Datasnap)

* A factory pattern is used, new formats can be added at will.

* Simple URL schemes. 2 basic schemes are available:
   BASEURL/Resource[/ID]
   BASEURL/Connection/Resource[/ID]

* Support for introspection/discovery or metadata.

* limit,offset URL parameters for paging of results: ?limit=10=50

* A maximum limit can be enforced.

  When the SQL statements support it, the limit and offset are translated to 
SQL fetch/offset clauses.

* Sort order can be specified in the request URL, if the resource definition 
allows it, using?sort=fieldname
  ( The ability to sort can be specified on a field basis)

* Filtering can be specified on a field basis in the request URL, and the 
filter operation is translated to SQL Where:
   ?MyField=10
   ?MyField_null=1 ?MyField_null=0
   ?MyField_lt=10 ?MyField_lte=10
   ?MyField_gt=10 ?MyField_gte=10

* The ability to filter on a field can be specified in the schema for each 
field.

* The request can specify whether metadata should be included in the response: 
?metadata=1

* The request can specify whether the result should be human-readable (nicely 
formatted) or not: ?humanreadable=1

A more complete explanation is in the WIKI

http://wiki.freepascal.org/SQLDBRestBridge

2 demo programs exist, more are planned (there is even a Delphi demo showing
how to read the data with Delphi's TClientDataset)

Lazarus integration is also available, the components are compilable with FPC 
3.0.4.

This is an initial version (fully functional), several extensions are planned:
- Zero-config API
  (a single generic binary can be shipped, no config files should be needed)
- ADO packages
- Integrate in lazarus Database desktop for easy development
- Integrate in pas2JS compile server for easy development.

Remarks, comments, suggestions welcome. 
(to a lesser extent: bugreports ;) )


Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Martin Frb via lazarus

On 24/02/2019 15:55, Michael Van Canneyt via lazarus wrote:



On Sun, 24 Feb 2019, Martin Frb via lazarus wrote:


So it hangs in openssl.


I think that is a premature conclusion :)

I should have said:

"In this specific case, it was in openssl"
Which then is an observation.

But you could, next time, set a breakpoint at the line/address where it 
returns to opm (or pascal code).


#8  0x0192033f in RECV (this=0x7fa2f2139280, BUFFER=0, 
COUNT=4096) at fcl-net/src/sslsockets.pp:436
#9  0x019175c4 in READ (this=0x7fa2f214b6e0, BUFFER=0, 
COUNT=4096) at fcl-net/src/ssockets.pp:449
#10 0x0199bcdd in FILLBUFFER (parentfp=0x7fa2fc603230) at 
fpcmod/opkman_httpclient.pas:708
#11 0x0199ba31 in READSTRING (this=0x7fa3058e08e0, S=0x0) at 
fpcmod/opkman_httpclient.pas:730
#12 0x0199c165 in READRESPONSEHEADERS (this=0x7fa3058e08e0) at 
fpcmod/opkman_httpclient.pas:835


|select-frame 10
b +0

 select the frame, set a breakpoint

then
r
^^ run

That should tell, if the socket call returns. (and then allow to find 
where in the pascal code it loops (how many further frames back will it go?)


|



Which means the http request can not be aborted. (gracefully)

How up to date is your openssl?


System installed version, so 1.0.x. I recently updated my packages.
From the discussions on the git buck, it appears (I may be wrong) the 
issue was fixed about one week back. (and then it depends when that made 
it into your distro).


So if you recently updated, you may have updated to include the issue 
(depends on the outcome of the above)

Anyway that is only one possibility.

Above gdb steps should get as closer to the issue (either if it is ssl, 
or where in the pascal code to look for it).



As usual, the issue is that it does not (has not yet) happened to me 
(Windows/Fedora 28).
Also I am not the maintainer of httpclient, nor of opm. So I can only 
offer limited help. (I did have a look at opm in the past, so that's why 
I jumped in)




-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Michael Van Canneyt via lazarus



On Sun, 24 Feb 2019, Martin Frb via lazarus wrote:


So it hangs in openssl.


I think that is a premature conclusion :)


Which means the http request can not be aborted. (gracefully)

How up to date is your openssl?


System installed version, so 1.0.x. I recently updated my packages.
Assuming linux mint includes upstream fixes it should be reasonably OK.



I recently had an issue with git on windows, due to an openssl bug 
https://github.com/git-for-windows/git/issues/1993


The openssl bug seems older, but some activity referring to a fix is 
very recent.

So just maybe...?


... ?

Maybe switch to GnuTLS as the default driver for HTTPS ;)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Martin Frb via lazarus

So it hangs in openssl.
Which means the http request can not be aborted. (gracefully)

How up to date is your openssl?

I recently had an issue with git on windows, due to an openssl bug 
https://github.com/git-for-windows/git/issues/1993


The openssl bug seems older, but some activity referring to a fix is 
very recent.

So just maybe...?


It might be possible to limit the IDE wait time though. Since this is on 
shutdown, the IDE can wait with the thread still running. That would 
report a memory leak (but not a problem, since it is a one off / 
will not accumulate)


That is assuming the OS manages to kill the thread then.
On windows it was not possible to kill any app hanging in that openssl 
bug (A system restart was required)



On 24/02/2019 15:11, Michael Van Canneyt via lazarus wrote:


(gdb) t 4

#1  0x7fa2f1d47c3c in ?? () from 
/usr/lib/x86_64-linux-gnu/libcrypto.so
#2  0x7fa2f1d45bdc in BIO_read () from 
/usr/lib/x86_64-linux-gnu/libcrypto.so

#3  0x7fa2f19f180a in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so
#4  0x7fa2f19f30ad in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so
#5  0x7fa2f19efc64 in ?? () from /usr/lib/x86_64-linux-gnu/libssl.so
#6  0x0192107c in SSLREAD (SSL=0x7fa2e403ac30, 
BUF=0x7fa2fc104dc8, NUM=4096) at openssl/src/openssl.pas:2156
#7  0x01929618 in READ (this=0x7fa2f2332e20, 
BUF=0x7fa2fc104dc8, NUM=4096) at openssl/src/fpopenssl.pp:475
#8  0x0192033f in RECV (this=0x7fa2f2139280, BUFFER=0, 
COUNT=4096) at fcl-net/src/sslsockets.pp:436
#9  0x019175c4 in READ (this=0x7fa2f214b6e0, BUFFER=0, 
COUNT=4096) at fcl-net/src/ssockets.pp:449
#10 0x0199bcdd in FILLBUFFER (parentfp=0x7fa2fc603230) at 
fpcmod/opkman_httpclient.pas:708
#11 0x0199ba31 in READSTRING (this=0x7fa3058e08e0, S=0x0) at 
fpcmod/opkman_httpclient.pas:730
#12 0x0199c165 in READRESPONSEHEADERS (this=0x7fa3058e08e0) at 
fpcmod/opkman_httpclient.pas:835
#13 0x0199cb9f in READRESPONSE (this=0x7fa3058e08e0, 
STREAM=0x7fa2f22efbc0, ALLOWEDRESPONSECODES=..., 
highALLOWEDRESPONSECODES=-1, HEADERSONLY=false) at 
fpcmod/opkman_httpclient.pas:1110
#14 0x0199d7e8 in DONORMALREQUEST (this=0x7fa3058e08e0, 
AURI=..., AMETHOD=0x1d62410 'GET', ASTREAM=0x7fa2f22efbc0, 
AALLOWEDRESPONSECODES=..., highAALLOWEDRESPONSECODES=-1, 
AHEADERSONLY=false,

    AISHTTPS=true) at fpcmod/opkman_httpclient.pas:1205
#15 0x0199dc6e in DOMETHOD (this=0x7fa3058e08e0, 
AMETHOD=0x1d62410 'GET', AURL=0x7fa2f215a6d8 
'https://excellmedia.dl.sourceforge.net/project/lazarus-ccr/ColorPalette/OPM/update_ColorPalette.json',
    STREAM=0x7fa2f22efbc0, ALLOWEDRESPONSECODES=..., 
highALLOWEDRESPONSECODES=-1) at fpcmod/opkman_httpclient.pas:1263


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Michael Van Canneyt via lazarus



On Sun, 24 Feb 2019, Martin Frb via lazarus wrote:


On 24/02/2019 14:06, Michael Van Canneyt via lazarus wrote:



Can you attach a list of all threads, and traces of other threads 
please?


How am I supposed to do that ?


once attached

info threads

and for each thread
t 1
bt

t 2
bt


Threads 1 and 4 are interesting:

One is Main thread. 
4 is package manager thread.


Seems that the thread is waiting for result of an HTTPS request

Michael.



t 1
bt

Reading in symbols for lazarus.pp...const value length mismatch for 
'REVISIONSTR', got 6, expected 256...done.
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at 
../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
#1  0x0044f306 in INTRTLEVENTWAITFORTIMEOUT (AEVENT=0x7fa3160ea040, 
TIMEOUT=100) at ../unix/cthreads.pp:973
#2  0x0043f66f in RTLEVENTWAITFOR (STATE=0x7fa3160ea040, TIMEOUT=100) 
at ../inc/thread.inc:325
#3  0x0052fc3c in CHECKSYNCHRONIZE (TIMEOUT=100) at 
../objpas/classes/classes.inc:395
#4  0x01995f6a in DOONIDECLOSE (this=0x7fa307742a80, 
SENDER=0x7fa30a0fc630) at opkman_intf.pas:125
#5  0x006a30c7 in CALLNOTIFYEVENTS (this=0x7fa2fc650100, 
SENDER=0x7fa30a0fc630) at lazmethodlist.pas:315
#6  0x009749f5 in DOCALLNOTIFYHANDLER (this=0x7fa30a0fc630, 
HANDLERTYPE=LIHTIDECLOSE) at lazideintf.pas:659
#7  0x004ad026 in MAINIDEFORMCLOSE (this=0x7fa30a0fc630, 
SENDER=0x7fa3064e6df0, CLOSEACTION=CAFREE) at main.pp:2058
#8  0x00487698 in DOCLOSE (this=0x7fa3064e6df0, CLOSEACTION=CAFREE) at 
include/customform.inc:959
#9  0x0048af81 in CLOSE (this=0x7fa3064e6df0) at 
include/customform.inc:2196
#10 0x0048b1ed in WMCLOSEQUERY (this=0x7fa3064e6df0, MESSAGE=...) at 
include/customform.inc:2276
#11 0x00436812 in DISPATCH (this=0x7fa3064e6df0, MESSAGE=0) at 
../inc/objpas.inc:602
#12 0x005bfe9d in WNDPROC (this=0x7fa3064e6df0, THEMESSAGE=...) at 
include/control.inc:2242
#13 0x005b2a2c in WNDPROC (this=0x7fa3064e6df0, MESSAGE=...) at 
include/wincontrol.inc:5419
#14 0x00488bde in WNDPROC (this=0x7fa3064e6df0, THEMESSAGE=...) at 
include/customform.inc:1477
#15 0x00c8ea41 in WNDPROC (this=0x7fa3064e6df0, MESSAGE=...) at 
mainbar.pas:551
#16 0x0078bf6c in DELIVERMESSAGE (TARGET=0x7fa3064e6df0, AMESSAGE=0) at 
lclmessageglue.pas:112
#17 0x0067f271 in DELIVERMESSAGE (TARGET=0x7fa3064e6df0, AMESSAGE=0) at 
gtk2/gtk2proc.inc:3780
#18 0x0068c604 in GTKDELETECB (WIDGET=0x4b87380, EVENT=0x5413590, 
DATA=0x7fa3064e6df0) at gtk2/gtk2callback.inc:1230
#19 0x7fa314e05aec in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#20 0x7fa314a8ffa5 in g_closure_invoke () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#21 0x7fa314aa1fc1 in ?? () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#22 0x7fa314aaa7f9 in g_signal_emit_valist () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#23 0x7fa314aab08f in g_signal_emit () from 
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x7fa314f1d93c in ?? () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#25 0x7fa314e0484d in gtk_main_do_event () from 
/usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#26 0x7fa3158d4c8c in ?? () from 
/usr/lib/x86_64-linux-gnu/libgdk-x11-2.0.so.0
#27 0x7fa3147b9197 in g_main_context_dispatch () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#28 0x7fa3147b93f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#29 0x7fa3147b949c in g_main_context_iteration () from 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#30 0x004fbf81 in APPWAITMESSAGE (this=0x7fa3160f3230) at 
gtk2/gtk2widgetset.inc:2431
#31 0x00492a0a in IDLE (this=0x7fa3160f2bf0, WAIT=true) at 
include/application.inc:414
#32 0x00494d38 in HANDLEMESSAGE (this=0x7fa3160f2bf0) at 
include/application.inc:1283
#33 0x0049526c in RUNLOOP (this=0x7fa3160f2bf0) at 
include/application.inc:1419
#34 0x0066a826 in APPRUN (this=0x7fa3160f3230, ALOOP=...) at 
include/interfacebase.inc:54
#35 0x00495210 in RUN (this=0x7fa3160f2bf0) at 
include/application.inc:1407
#36 0x004203d3 in main () at lazarus.pp:153

(gdb)  t 2
[Switching to thread 2 (Thread 0x7fa30512d700 (LWP 9831))]
incomplete CFI data; unspecified registers (e.g., rax) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rdx) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rcx) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rbx) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rsi) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rdi) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., rbp) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., r8) at 
0x7fa313708760...incomplete CFI data; unspecified registers (e.g., r9) at 
0x7fa313708760...incomplete 

Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Martin Frb via lazarus

On 24/02/2019 14:06, Michael Van Canneyt via lazarus wrote:



Can you attach a list of all threads, and traces of other threads 
please?


How am I supposed to do that ?


once attached

info threads

and for each thread
t 1
bt

t 2
bt

...
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] Adding component to IDE

2019-02-24 Thread Michael Van Canneyt via lazarus


Hi,

How can I add a component instance to a datamodule or form ?

I know these 2:

procedure AddComponent(const NewRegisteredComponent: TRegisteredComponent;
  const NewComponentClass: TComponentClass;
  const NewParent: TComponent;
  const NewLeft,NewTop,NewWidth,NewHeight: Integer); virtual; abstract;
procedure AddComponentCheckParent(var NewParent: TComponent;
  const OriginComponent: TComponent; const OriginWinControl: TWinControl;
  const NewComponentClass: TComponentClass); virtual; abstract;

But they are not suitable for my purpose. The component instance is already 
created
in memory. I just need to be able to "put it on the form".

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Michael Van Canneyt via lazarus



On Sun, 24 Feb 2019, Martin Frb via lazarus wrote:


Laz 2.1 trunk, or 2.0.1 fixes?


Trunk.


Can you attach a list of all threads, and traces of other threads please?


How am I supposed to do that ?

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Martin Frb via lazarus

Laz 2.1 trunk, or 2.0.1 fixes?

Can you attach a list of all threads, and traces of other threads please?

On 24/02/2019 12:00, Michael Van Canneyt via lazarus wrote:


Hello,

I find that the IDE has become very unstable lately. I didn't install any
new packages, didn't update FPC (still on FPC 3.0.4). Just updated 
lazarus

from SVN.

4 out of 5 attempts to close the IDE using the window manager button 
fails:

lazarus hangs and I must kill it using
killall -KILL lazarus
from a terminal.

It's very reproducible.

Start lazarus
Open package
Compile package
Switch to form editor of start project
Close (window manager or menu file - exit)
-> hang

I can attach to it using gdb. Here is the stack trace:

0  pthread_cond_timedwait@@GLIBC_2.3.2 () at 
../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
#1  0x0044f306 in INTRTLEVENTWAITFORTIMEOUT 
(AEVENT=0x7f460e943040, TIMEOUT=100) at ../unix/cthreads.pp:973
#2  0x0043f66f in RTLEVENTWAITFOR (STATE=0x7f460e943040, 
TIMEOUT=100) at ../inc/thread.inc:325
#3  0x0052fc3c in CHECKSYNCHRONIZE (TIMEOUT=100) at 
../objpas/classes/classes.inc:395
#4  0x0199177a in DOONIDECLOSE (this=0x7f45fff9ba80, 
SENDER=0x7f46057bfdb0) at opkman_intf.pas:125
#5  0x006a30c7 in CALLNOTIFYEVENTS (this=0x7f45f4c6d440, 
SENDER=0x7f46057bfdb0) at lazmethodlist.pas:315
#6  0x009749f5 in DOCALLNOTIFYHANDLER (this=0x7f46057bfdb0, 
HANDLERTYPE=LIHTIDECLOSE) at lazideintf.pas:659
#7  0x004ad026 in MAINIDEFORMCLOSE (this=0x7f46057bfdb0, 
SENDER=0x7f45f73f98f0, CLOSEACTION=CAFREE) at main.pp:2058
#8  0x00487698 in DOCLOSE (this=0x7f45f73f98f0, 
CLOSEACTION=CAFREE) at include/customform.inc:959
#9  0x0048af81 in CLOSE (this=0x7f45f73f98f0) at 
include/customform.inc:2196

#10 0x004c1afd in QUITIDE (this=0x7f46057bfdb0) at main.pp:6622
#11 0x004b50dd in MNUQUITCLICKED (this=0x7f46057bfdb0, 
SENDER=0x7f45f7e9cfc0) at main.pp:3655
#12 0x0096f40f in MENUITEMCLICK (this=0x7f45f7e9cfc0, 
SENDER=0x7f45fff05d40) at menuintf.pas:544
#13 0x009733b1 in MENUITEMCLICK (this=0x7f45f7e9cfc0, 
SENDER=0x7f45fff05d40) at menuintf.pas:1695


Seems a bug in the online package manager. Who said once that threads 
are evil ? :)


For now I uninstalled the online package manager, but a fix would be 
really appreciated :-)


Michael.


--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] New code tools error dialog ?

2019-02-24 Thread Michael Van Canneyt via lazarus


Hi,

It seems that the code tools now pop up an error dialog when they encounter
an error if you're trying to do something (code completion, add component).

Is there an option to disable this ?
I really don't want to have to close the dialog every time.

If memory serves well, they used to simply not execute the requested action,
and I think sometimes they displayed a message in the message dialog window.

That make far more sense to me.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] IDE unstable - Online Package manager bug

2019-02-24 Thread Michael Van Canneyt via lazarus


Hello,

I find that the IDE has become very unstable lately. I didn't install any
new packages, didn't update FPC (still on FPC 3.0.4). Just updated lazarus
from SVN.

4 out of 5 attempts to close the IDE using the window manager button fails:
lazarus hangs and I must kill it using
killall -KILL lazarus
from a terminal.

It's very reproducible.

Start lazarus
Open package
Compile package
Switch to form editor of start project
Close (window manager or menu file - exit)
-> hang

I can attach to it using gdb. Here is the stack trace:

0  pthread_cond_timedwait@@GLIBC_2.3.2 () at 
../sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:225
#1  0x0044f306 in INTRTLEVENTWAITFORTIMEOUT (AEVENT=0x7f460e943040, 
TIMEOUT=100) at ../unix/cthreads.pp:973
#2  0x0043f66f in RTLEVENTWAITFOR (STATE=0x7f460e943040, TIMEOUT=100) 
at ../inc/thread.inc:325
#3  0x0052fc3c in CHECKSYNCHRONIZE (TIMEOUT=100) at 
../objpas/classes/classes.inc:395
#4  0x0199177a in DOONIDECLOSE (this=0x7f45fff9ba80, 
SENDER=0x7f46057bfdb0) at opkman_intf.pas:125
#5  0x006a30c7 in CALLNOTIFYEVENTS (this=0x7f45f4c6d440, 
SENDER=0x7f46057bfdb0) at lazmethodlist.pas:315
#6  0x009749f5 in DOCALLNOTIFYHANDLER (this=0x7f46057bfdb0, 
HANDLERTYPE=LIHTIDECLOSE) at lazideintf.pas:659
#7  0x004ad026 in MAINIDEFORMCLOSE (this=0x7f46057bfdb0, 
SENDER=0x7f45f73f98f0, CLOSEACTION=CAFREE) at main.pp:2058
#8  0x00487698 in DOCLOSE (this=0x7f45f73f98f0, CLOSEACTION=CAFREE) at 
include/customform.inc:959
#9  0x0048af81 in CLOSE (this=0x7f45f73f98f0) at 
include/customform.inc:2196
#10 0x004c1afd in QUITIDE (this=0x7f46057bfdb0) at main.pp:6622
#11 0x004b50dd in MNUQUITCLICKED (this=0x7f46057bfdb0, 
SENDER=0x7f45f7e9cfc0) at main.pp:3655
#12 0x0096f40f in MENUITEMCLICK (this=0x7f45f7e9cfc0, 
SENDER=0x7f45fff05d40) at menuintf.pas:544
#13 0x009733b1 in MENUITEMCLICK (this=0x7f45f7e9cfc0, 
SENDER=0x7f45fff05d40) at menuintf.pas:1695

Seems a bug in the online package manager. Who said once that threads are evil 
? :)

For now I uninstalled the online package manager, but a fix would be really 
appreciated :-)

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus