Sign in Join

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

Mailing lists / lazarus / 2011-04

UniqueInstance issue

8 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Giuliano Colla

In an application I'm currently developing, meant to run under RHEL5, I needed to ensure that no multiple instances were running, so I installed the UniqueInstance component:
http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/

Under RHEL5, the only usable combination is:
Lazarus 9.26.2
FPC 2.2.2
i386-linux-gtk2

In this environment, using the TUniqueInstance component leads to this situation: the first instance runs properly, the second terminates with an EAccess error in Form Create, which isn't very nice. If the Component is not enabled at design time, even the first instance aborts the same way.
Is that something to be expected because of version too new/too old, wrong fpc version, gtk2 vs gtk, etc.?

I'd like to understand if the matter is worth further investigation or it's simpler to give up.

BTW UniqueInstanceRaw works perfectly, but I'd prefer a visual component on the design form, to make life easier to maintainers, provided this can be achieved with a reasonable effort.

Could someone point me in the right direction?

Thanks,

Giuliano

Reply by email

Luiz Americo Pereira Camara
to Giuliano Colla
Giuliano Colla wrote 5 lines
In an application I'm currently developing, meant to run under RHEL5, I needed to ensure that no multiple instances were running, so I installed the UniqueInstance component: http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/

please publish a sample project and a stacktrace

Luiz

Show quoted text 35 lines
Under RHEL5, the only usable combination is: Lazarus 9.26.2 FPC 2.2.2 i386-linux-gtk2 In this environment, using the TUniqueInstance component leads to this situation: the first instance runs properly, the second terminates with an EAccess error in Form Create, which isn't very nice. If the Component is not enabled at design time, even the first instance aborts the same way. Is that something to be expected because of version too new/too old, wrong fpc version, gtk2 vs gtk, etc.? I'd like to understand if the matter is worth further investigation or it's simpler to give up. BTW UniqueInstanceRaw works perfectly, but I'd prefer a visual component on the design form, to make life easier to maintainers, provided this can be achieved with a reasonable effort. Could someone point me in the right direction? Thanks, Giuliano -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Giuliano Colla
to Luiz Americo Pereira Camara

Luiz Americo Pereira Camara ha scritto:

Show quoted text 9 lines
On 2/4/2011 15:18, Giuliano Colla wrote: > In an application I'm currently developing, meant to run under RHEL5, I > needed to ensure that no multiple instances were running, so I installed > the UniqueInstance component: > http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/ > please publish a sample project and a stacktrace

To avoid attachment length problems, my zipped sandbox folder is available at:

http://www.copeca.it/colla/Sandbox.zip

where you can find project1 and project2, to help sort out the problems, together with Trace1.txt and Trace2.txt, which are the stack traces for project1 and project2.

Project1 is nothing but a form with only a TUniqueInstance component. If the component is enabled at design time, it works perfectly. If the component is not enabled at design time, see Trace1.txt. (stack trace of the first and only instance running)

In Project2 I tried to put in one by one all the components of my real application. Apparently the problem arises with the TMemo component, whose presence, together with TUniqueInstance, triggers the access violation (see Trace2.txt, which is the trace of the second instance running). A TMemo issue or a TUiniqueInstance issue?

Kind regards,

Giuliano

Reply by email

Giuliano Colla
to Giuliano Colla

Giuliano Colla ha scritto:

Show quoted text 11 lines
Luiz Americo Pereira Camara ha scritto: > On 2/4/2011 15:18, Giuliano Colla wrote: >> In an application I'm currently developing, meant to run under RHEL5, I >> needed to ensure that no multiple instances were running, so I >> installed >> the UniqueInstance component: >> http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/ >> > > please publish a sample project and a stacktrace >

For sake of completeness, I tested with gtk1 in a different platform (but with same Lazarus and fpc versions). No difference.

Giuliano

Reply by email

Luiz Americo Pereira Camara
to Giuliano Colla: Luiz Americo Pereira Camara ha scritto: To avoid attachment length problems, my zipped…
Giuliano Colla wrote 30 lines
Luiz Americo Pereira Camara ha scritto: > On 2/4/2011 15:18, Giuliano Colla wrote: >> In an application I'm currently developing, meant to run under RHEL5, I >> needed to ensure that no multiple instances were running, so I >> installed >> the UniqueInstance component: >> http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/ >> > > please publish a sample project and a stacktrace > To avoid attachment length problems, my zipped sandbox folder is available at: http://www.copeca.it/colla/Sandbox.zip where you can find project1 and project2, to help sort out the problems, together with Trace1.txt and Trace2.txt, which are the stack traces for project1 and project2. Project1 is nothing but a form with only a TUniqueInstance component. If the component is enabled at design time, it works perfectly. If the component is not enabled at design time, see Trace1.txt. (stack trace of the first and only instance running) In Project2 I tried to put in one by one all the components of my real application. Apparently the problem arises with the TMemo component, whose presence, together with TUniqueInstance, triggers the access violation (see Trace2.txt, which is the trace of the second instance running). A TMemo issue or a TUiniqueInstance issue?

Thanks.

I fixed the issue on svn.

There's one issue pending that i'm working on it. See comments of http://lazarusroad.blogspot.com/2006/12/only-one-instance.html

Luiz

Reply by email

Giuliano Colla
to Luiz Americo Pereira Camara

Luiz Americo Pereira Camara ha scritto:

Show quoted text 39 lines
On 3/4/2011 08:17, Giuliano Colla wrote: > Luiz Americo Pereira Camara ha scritto: >> On 2/4/2011 15:18, Giuliano Colla wrote: >>> In an application I'm currently developing, meant to run under RHEL5, I >>> needed to ensure that no multiple instances were running, so I >>> installed >>> the UniqueInstance component: >>> http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/ >>> >> >> please publish a sample project and a stacktrace >> > To avoid attachment length problems, my zipped sandbox folder is > available at: > > http://www.copeca.it/colla/Sandbox.zip > > where you can find project1 and project2, to help sort out the > problems, together with Trace1.txt and Trace2.txt, which are the stack > traces for project1 and project2. > > Project1 is nothing but a form with only a TUniqueInstance component. > If the component is enabled at design time, it works perfectly. If the > component is not enabled at design time, see Trace1.txt. (stack trace > of the first and only instance running) > > In Project2 I tried to put in one by one all the components of my real > application. Apparently the problem arises with the TMemo component, > whose presence, together with TUniqueInstance, triggers the access > violation (see Trace2.txt, which is the trace of the second instance > running). A TMemo issue or a TUiniqueInstance issue? Thanks. I fixed the issue on svn. There's one issue pending that i'm working on it. See comments of http://lazarusroad.blogspot.com/2006/12/only-one-instance.html

Thanks, I'll get the svn and try to backport the fix to my Lazarus version. If I come out with a good idea, I'll submit it for the pending issue. If not, I'll patiently wait for someone brighter than me to find the solution...

Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde)

Reply by email

Giuliano Colla
to Luiz Americo Pereira Camara: Thanks. I fixed the issue on svn. There's one issue pending that i'm working on it. See…

Luiz Americo Pereira Camara ha scritto:

Show quoted text 39 lines
On 3/4/2011 08:17, Giuliano Colla wrote: > Luiz Americo Pereira Camara ha scritto: >> On 2/4/2011 15:18, Giuliano Colla wrote: >>> In an application I'm currently developing, meant to run under RHEL5, I >>> needed to ensure that no multiple instances were running, so I >>> installed >>> the UniqueInstance component: >>> http://sourceforge.net/projects/lazarus-ccr/files/Unique%20Instance/Unique%20Instance%200.2/ >>> >> >> please publish a sample project and a stacktrace >> > To avoid attachment length problems, my zipped sandbox folder is > available at: > > http://www.copeca.it/colla/Sandbox.zip > > where you can find project1 and project2, to help sort out the > problems, together with Trace1.txt and Trace2.txt, which are the stack > traces for project1 and project2. > > Project1 is nothing but a form with only a TUniqueInstance component. > If the component is enabled at design time, it works perfectly. If the > component is not enabled at design time, see Trace1.txt. (stack trace > of the first and only instance running) > > In Project2 I tried to put in one by one all the components of my real > application. Apparently the problem arises with the TMemo component, > whose presence, together with TUniqueInstance, triggers the access > violation (see Trace2.txt, which is the trace of the second instance > running). A TMemo issue or a TUiniqueInstance issue? Thanks. I fixed the issue on svn. There's one issue pending that i'm working on it. See comments of http://lazarusroad.blogspot.com/2006/12/only-one-instance.html

For your information, the link to svn in the wiki page is broken. After failing, I got the good one from blogspot. Now I'll test ASAP.

Giuliano Colla Whenever people agree with me, I always feel I must be wrong (O. Wilde)

Reply by email

Luiz Americo Pereira Camara
to Giuliano Colla: Luiz Americo Pereira Camara ha scritto: Thanks, I'll get the svn and try to backport the…
Giuliano Colla wrote 11 lines
Luiz Americo Pereira Camara ha scritto: > > There's one issue pending that i'm working on it. See comments of > http://lazarusroad.blogspot.com/2006/12/only-one-instance.html > Thanks, I'll get the svn and try to backport the fix to my Lazarus version. If I come out with a good idea, I'll submit it for the pending issue. If not, I'll patiently wait for someone brighter than me to find the solution...

I already fixed the issue in svn. Now there's no know issue with it.

I'll fix the wiki after i do a release

Luiz

Reply by email