Sign in Join

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

Mailing lists / lazarus / 2010-05

component installation failure

11 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Marc Santhoff

Hi,

having not made any visual components since Delphi2 I have to ask:

1.
When I want to install a visual component to lazarus, does it need to have a package file (.lpk) or is the classic way of installing from the components source file(s) still available?

2.
When I make a package file for an ancient Delphi component to port to lazarus and it compiles and installs but doesnt show up in the IDE although it is found in the package list, what has gone wrong there?

The long story for question 2:

I made a package for the component, converted the dfm to lfm, fixed some code and commented things for later until it compiles okay. ? A resource file is included directly without converting to .lrs because I read in the wiki this is possible and I don't know how to extract what is in the .res-file.

Then I klicked "install" at the package management window. When asked if I want lazarus to be built now I clicked yes and compilation ran through until lazarus ended.

When trying to start the freshly compiled ide his error happens:

$ lazarus
Fatal error 'Spinlock called when not threaded.' at line 78 in file /usr/src7/src/lib/libthr/thread/thr_spinlock.c (errno = 2) Abbruch(core dumped)

Aftwerwards I did a "gmake bigide" in lazarus source dir to get a working thingy again, which worked and ran fine.
With one exception: the new package does not show up, it's state is still set to "install on next start", but nothing happens when started over.

All that occured with:

Lazarus svn 25285 and 25631
fpc 2.4.0
FreeBSD 7.2

Marc Santhoff

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 8 lines
Hi, having not made any visual components since Delphi2 I have to ask: 1. When I want to install a visual component to lazarus, does it need to have a package file (.lpk) or is the classic way of installing from the components source file(s) still available?

You need a lpk file.

2. When I make a package file for an ancient Delphi component to port to lazarus and it compiles and installs but doesnt show up in the IDE although it is found in the package list, what has gone wrong there?

Possible reasons:
- The register procedure was not called, because you didn't check the 'Has Register procedure' for this unit in the package editor.
- You didn't start the new IDE, but the old. Start the IDE in the terminal. You will see where the new lazarus executable is created.

Hint: When you select the unit in the package editor you can see the registered components of this unit.

Show quoted text 7 lines
The long story for question 2: I made a package for the component, converted the dfm to lfm, fixed some code and commented things for later until it compiles okay. ? A resource file is included directly without converting to .lrs because I read in the wiki this is possible and I don't know how to extract what is in the .res-file.

Yes, you can use res files. I don't know if all formats work the same as under Delphi.

Show quoted text 10 lines
Then I klicked "install" at the package management window. When asked if I want lazarus to be built now I clicked yes and compilation ran through until lazarus ended. When trying to start the freshly compiled ide his error happens: $ lazarus Fatal error 'Spinlock called when not threaded.' at line 78 in file /usr/src7/src/lib/libthr/thread/thr_spinlock.c (errno = 2) Abbruch(core dumped)

Maybe your package needs threading support.
See here
http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial#Multithreading_in_packages

Show quoted text 5 lines
Aftwerwards I did a "gmake bigide" in lazarus source dir to get a working thingy again, which worked and ran fine. With one exception: the new package does not show up, it's state is still set to "install on next start", but nothing happens when started over.

make bigide compiles an IDE with a standard set of packages. You can use the command line tool lazbuild to compile an IDE with your packages:

http://wiki.lazarus.freepascal.org/lazbuild

Show quoted text 5 lines
All that occured with: Lazarus svn 25285 and 25631 fpc 2.4.0 FreeBSD 7.2

Mattias

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote 13 lines
On Tue, 25 May 2010 05:40:40 +0200 Marc Santhoff wrote: > Hi, > > having not made any visual components since Delphi2 I have to ask: > > 1. > When I want to install a visual component to lazarus, does it need to > have a package file (.lpk) or is the classic way of installing from the > components source file(s) still available? You need a lpk file.

OK.

Show quoted text 8 lines
> 2. > When I make a package file for an ancient Delphi component to port to > lazarus and it compiles and installs but doesnt show up in the IDE > although it is found in the package list, what has gone wrong there? Possible reasons: - The register procedure was not called, because you didn't check the 'Has Register procedure' for this unit in the package editor.

Do you mean the checkbox "Register Unit" in the lower third of the package management window? Well, that one is actually checked.

- You didn't start the new IDE, but the old. Start the IDE in the terminal. You will see where the new lazarus executable is created.

?I think it is the right one. lazarus at my site is a symlink in my home dirs bin directory, this symlink is pointing to the file named lazarus in the source dir, the right file should be used whether I start from a terminal (which I do normally) or via the 'run ...' menu of the window manager. There is no global installation. But I'll test startlazarus.

No, no change. The package is listed and in the package tree is flagged as "install on next start".

Hint: When you select the unit in the package editor you can see the registered components of this unit.

I don't see anything like that, maybe I have to flip another switch? I dared to attach another screen shot ...

Show quoted text 10 lines
> The long story for question 2: > > I made a package for the component, converted the dfm to lfm, fixed some > code and commented things for later until it compiles okay. ? A resource > file is included directly without converting to .lrs because I read in > the wiki this is possible and I don't know how to extract what is in > the .res-file. Yes, you can use res files. I don't know if all formats work the same as under Delphi.

I wish I already were there ... ;)

Show quoted text 16 lines
> Then I klicked "install" at the package management window. When asked if > I want lazarus to be built now I clicked yes and compilation ran through > until lazarus ended. > > When trying to start the freshly compiled ide his error happens: > > $ lazarus > Fatal error 'Spinlock called when not threaded.' at line 78 in > file /usr/src7/src/lib/libthr/thread/thr_spinlock.c (errno = 2) > Abbruch(core dumped) Maybe your package needs threading support. See here http://wiki.lazarus.freepascal.org/Multithreaded_Application_Tutorial#Multithreading_in_packages From looking through the sources it doesn't, there is no TThread or

similar used.

But I fear this may be a FreeBSD issue, there has been some switching in threading libraries - IIRC there are at least two or three of them. I'll try to fix this by talking to FreeBSD experts ...

Show quoted text 11 lines
> Aftwerwards I did a "gmake bigide" in lazarus source dir to get a > working thingy again, which worked and ran fine. > With one exception: the new package does not show up, it's state is > still set to "install on next start", but nothing happens when started > over. make bigide compiles an IDE with a standard set of packages. You can use the command line tool lazbuild to compile an IDE with your packages: http://wiki.lazarus.freepascal.org/lazbuild

Pretty cool, I asked myself lately how I can build projects from the command line or from a script. :)

But I have used "make bigide" because I needed to recompile lazarus itself after the threading error which was thrown repeatedly and lazarus didn't learned on this mailing list that by using this target all packages installed manually are pulled in - which works very nice.

Show quoted text 5 lines
> All that occured with: > > Lazarus svn 25285 and 25631 > fpc 2.4.0 > FreeBSD 7.2
Marc Santhoff -------------- next part -------------- A non-text attachment was scrubbed... Name: LazPackMan.png Type: image/png Size: 23014 bytes Desc: not available URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100525/9ccdfbe5/attachment-0001.png>

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 12 lines
[...] > > 2. > > When I make a package file for an ancient Delphi component to port to > > lazarus and it compiles and installs but doesnt show up in the IDE > > although it is found in the package list, what has gone wrong there? > > Possible reasons: > - The register procedure was not called, because you didn't check the > 'Has Register procedure' for this unit in the package editor. Do you mean the checkbox "Register Unit" in the lower third of the package management window? Well, that one is actually checked.

Good.

Show quoted text 11 lines
> - You didn't start the new IDE, but the old. Start the IDE in the > terminal. You will see where the new lazarus executable is created. ?I think it is the right one. lazarus at my site is a symlink in my home dirs bin directory, this symlink is pointing to the file named lazarus in the source dir, the right file should be used whether I start from a terminal (which I do normally) or via the 'run ...' menu of the window manager. There is no global installation. But I'll test startlazarus. No, no change. The package is listed and in the package tree is flagged as "install on next start".

Then it is not compiled into the executable you started.

[...] But I have used "make bigide" because I needed to recompile lazarus itself after the threading error which was thrown repeatedly and lazarus didn't keep a good lazarus executable as backup.
I learned on this mailing list that by using this target all packages installed manually are pulled in - which works very nice.

Mattias

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote 40 lines
On Tue, 25 May 2010 19:52:57 +0200 Marc Santhoff wrote: >[...] > > > 2. > > > When I make a package file for an ancient Delphi component to port to > > > lazarus and it compiles and installs but doesnt show up in the IDE > > > although it is found in the package list, what has gone wrong there? > > > > Possible reasons: > > - The register procedure was not called, because you didn't check the > > 'Has Register procedure' for this unit in the package editor. > > Do you mean the checkbox "Register Unit" in the lower third of the > package management window? Well, that one is actually checked. Good. > > - You didn't start the new IDE, but the old. Start the IDE in the > > terminal. You will see where the new lazarus executable is created. > > ?I think it is the right one. lazarus at my site is a symlink in my home > dirs bin directory, this symlink is pointing to the file named lazarus > in the source dir, the right file should be used whether I start from a > terminal (which I do normally) or via the 'run ...' menu of the window > manager. There is no global installation. But I'll test startlazarus. > > No, no change. The package is listed and in the package tree is flagged > as "install on next start". Then it is not compiled into the executable you started. >[...] > But I have used "make bigide" because I needed to recompile lazarus > itself after the threading error which was thrown repeatedly and lazarus > didn't start at all. Always keep a good lazarus executable as backup.

Some news on this topic:

It looks like this is an error inside the self compiling mechanism of lazarus. Anytime I allow a running lazarus to compile itself the nasty spinlock error is I only use lazarus to configure packages, like removing the unfinished and thus questionable one I'm working on, exit afterwards and do "gmake bigide" anything works well. The registration and deregistration of packages does actually work, too. This makes me assume the 2.4.0 compiler is okay.

Why my working package doesn't do seems to be a second question.

Has there been any changes regarding threading in the self building code of lazarus? Going the step back to the last svn version I've used doesn't change the error, so that would have be done befor rev. 25285.

Marc Santhoff

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 26 lines
Am Dienstag, den 25.05.2010, 21:07 +0200 schrieb Mattias Gaertner: [...] > >[...] > > But I have used "make bigide" because I needed to recompile lazarus > > itself after the threading error which was thrown repeatedly and lazarus > > didn't start at all. > > Always keep a good lazarus executable as backup. Some news on this topic: It looks like this is an error inside the self compiling mechanism of lazarus. Anytime I allow a running lazarus to compile itself the nasty spinlock error is thrown at startup. If I only use lazarus to configure packages, like removing the unfinished and thus questionable one I'm working on, exit afterwards and do "gmake bigide" anything works well. The registration and deregistration of packages does actually work, too. This makes me assume the 2.4.0 compiler is okay. Why my working package doesn't do seems to be a second question. Has there been any changes regarding threading in the self building code of lazarus? Going the step back to the last svn version I've used doesn't change the error, so that would have be done befor rev. 25285.

The base IDE does not use threading.
Maybe some package does.
The IDE uses TProcess, which uses fork. Under OS X it sometimes returns an exitcode0 for no apparent reason. Maybe there is a similar bug under BSD.

Mattias

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote 35 lines
On Wed, 26 May 2010 08:48:23 +0200 Marc Santhoff wrote: > Am Dienstag, den 25.05.2010, 21:07 +0200 schrieb Mattias Gaertner: >[...] > > >[...] > > > But I have used "make bigide" because I needed to recompile lazarus > > > itself after the threading error which was thrown repeatedly and lazarus > > > didn't start at all. > > > > Always keep a good lazarus executable as backup. > > Some news on this topic: > > It looks like this is an error inside the self compiling mechanism of > lazarus. Anytime I allow a running lazarus to compile itself the nasty > spinlock error is thrown at startup. > > If I only use lazarus to configure packages, like removing the > unfinished and thus questionable one I'm working on, exit afterwards and > do "gmake bigide" anything works well. The registration and > deregistration of packages does actually work, too. This makes me assume > the 2.4.0 compiler is okay. > > Why my working package doesn't do seems to be a second question. > > Has there been any changes regarding threading in the self building code > of lazarus? Going the step back to the last svn version I've used > doesn't change the error, so that would have be done befor rev. 25285. The base IDE does not use threading. Maybe some package does. The IDE uses TProcess, which uses fork. Under OS X it sometimes returns an exitcode0 for no apparent reason. Maybe there is a similar bug under BSD.

Sound possible. But the only offer I can make reagarding debugging such things is to hand out a log of truss or ktrace to someone willing and able to read the result and project that on the inner workings of lazarus. I took a look but it doesn't tell me much, because I cannot relate it to lazarus' startup procedure.

Thanks so far,

Marc Santhoff

Reply by email

Mattias Gaertner
to Marc Santhoff
Show quoted text 8 lines
[] > > If I only use lazarus to configure packages, like removing the > > unfinished and thus questionable one I'm working on, exit afterwards and > > do "gmake bigide" anything works well. The registration and > > deregistration of packages does actually work, too. This makes me assume > > the 2.4.0 compiler is okay. > > > > Why my working package doesn't do seems to be a second question.

Is this correct: A base IDE works, but an IDE compiled with your package does not?
Can you send the package?

Show quoted text 15 lines
> > Has there been any changes regarding threading in the self building code > > of lazarus? Going the step back to the last svn version I've used > > doesn't change the error, so that would have be done befor rev. 25285. > > The base IDE does not use threading. > Maybe some package does. > The IDE uses TProcess, which uses fork. Under OS X it sometimes > returns an exitcode0 for no apparent reason. Maybe there is a similar > bug under BSD. Sound possible. But the only offer I can make reagarding debugging such things is to hand out a log of truss or ktrace to someone willing and able to read the result and project that on the inner workings of lazarus. I took a look but it doesn't tell me much, because I cannot relate it to lazarus' startup procedure.

You can send it to me.

Mattias

Reply by email

Marc Santhoff
to Mattias Gaertner
Mattias Gaertner wrote 14 lines
On Wed, 26 May 2010 20:07:12 +0200 Marc Santhoff wrote: >[] > > > If I only use lazarus to configure packages, like removing the > > > unfinished and thus questionable one I'm working on, exit afterwards and > > > do "gmake bigide" anything works well. The registration and > > > deregistration of packages does actually work, too. This makes me assume > > > the 2.4.0 compiler is okay. > > > > > > Why my working package doesn't do seems to be a second question. Is this correct: A base IDE works, but an IDE compiled with your package does not?

No.

With or without the package the IDE is

- not working when the recomplation process is started from within the IDE, e.g. using the menus "Tools -> Build Lazarus" or when issuing the build command from package configuration.

- working when compiled from a terminal (xterm or rxvt) using the command "gmake bigide" which respects user packages

I tried several times and the problem is reproducable.

Can you send the package?

I can, but it isn't the cause for the error.

Show quoted text 17 lines
> > > Has there been any changes regarding threading in the self building code > > > of lazarus? Going the step back to the last svn version I've used > > > doesn't change the error, so that would have be done befor rev. 25285. > > > > The base IDE does not use threading. > > Maybe some package does. > > The IDE uses TProcess, which uses fork. Under OS X it sometimes > > returns an exitcode0 for no apparent reason. Maybe there is a similar > > bug under BSD. > > Sound possible. But the only offer I can make reagarding debugging such > things is to hand out a log of truss or ktrace to someone willing and > able to read the result and project that on the inner workings of > lazarus. I took a look but it doesn't tell me much, because I cannot > relate it to lazarus' startup procedure. You can send it to me.

Will do, thanks. :)

Marc Santhoff

Reply by email

Marc Santhoff
to Marc Santhoff

Good evening,

Mattias Gaertner pushed me to looking at FreeBSD as a cause first and he was right. It actually is a special problem of the OS, not Lazarus.

There has to be a file /etc/libmap.conf mapping all possible threading libraries to only one, if not different libraries are used and threading breaks.

For the records:

Mine looks like this currently on FreeBSD 7.2

$ cat /etc/libmap.conf
# /etc/libmap.conf
#
# candidate mapping
#
libpthread.so.2 libthr.so.3
libpthread.so libthr.so

libc_r.so.5 libthr.so.3
libc_r.so libthr.so

libc_r.so.6 libthr.so.3

libthr.so.3 libthr.so.3
liothr.so libthr.so

and solves the problem for me, although I'm not absolutely sure about each entry.

One last remark:

Since using make to compile lazaurs from the command line worked all the time there must be a difference between the way lazarus feeds the libraries to link against to the compile process than it is done inside the make file. Maybe it is only a trivial change in library names.

Thanks for help and attention. Lazarus is so cool (as long as it is running normally ;).

Marc Santhoff

Reply by email

Marc Santhoff
to Marc Santhoff

Am Mittwoch, den 26.05.2010, 23:09 +0200 schrieb Marc Santhoff:

To keep you from potentially having to recompile anything else using threads add one line:

Show quoted text 7 lines
Mine looks like this currently on FreeBSD 7.2 $ cat /etc/libmap.conf # /etc/libmap.conf # # candidate mapping #

[/where/you/installed/lazarus/]

Show quoted text 10 lines
libpthread.so.2 libthr.so.3 libpthread.so libthr.so libc_r.so.5 libthr.so.3 libc_r.so libthr.so libc_r.so.6 libthr.so.3 libthr.so.3 libthr.so.3 liothr.so libthr.so

The line makes the remapping only effective for all binaries below the given path.

Have fun,

Marc Santhoff

Reply by email