Pcbnew does not start - MakeShape symbol not found

Hi
I have a very strange problem, and I’m completely out of ideas.

I updated kicad from version 7 to version 8, (on Ubuntu 22.04, from ppa:kicad/kicad-8.0-releases)

When I start pcbnew, I get:
Failed to load shared library '/usr/bin/_pcbnew.kiface': /lib/x86_64-linux-gnu/libTKBO.so.7: undefined symbol: _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

But
nm -D /lib/x86_64-linux-gnu/libTKBO.so.7 | grep -i _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
finds the symbol.

As if that was be not strange enough - when I install KiCad from the same sources on a new virtualBox machine (Ubuntu), it works just fine. But both
/lib/x86_64-linux-gnu/libTKBO.so.7.6.3 (to which … .so.7 is a symlink to) and
/usr/bin/_pcbnew.kiface
have the same cksums on my failing native installation and the one that works.

So, bottom line:

  • Library A claims that it misses a symbol in library B.
  • Library B has that symbol
  • On another system, the SAME library A (same checksum) finds the symbol on the SAME library B (same checksum).

Of course I checked ownership and permissions - they are the same. I also renamed the library, and as expected, there was another error: No such file.

Ah, and needless to say - removing and re-installing I tried also - without luck. Also, going back to version 7 did not work (even though it was working before, but that’s a couple of months ago). Down to 6 from ubuntu repo works fine, but unfortunately I have a project made with 7, and this cannot be opened by 6)

As said - I am completely out of ideas. Does anyone out there have another idea?

Sorry it is baffling and I don’t have any solutions, but if you are thinking that /lib/x86_64-linux-gnu/libTKBO.so.7 is library A and /lib/x86_64-linux-gnu/libTKBO.so.7.6.3 is library B, no, they are the same library as A is a symlink to B.

Try this:

rpm -qf /lib/x86_64-linux-gnu/libTKBO.so.7 /lib/x86_64-linux-gnu/libTKBO.so.7.6.3

Edit: Sorry, I forgot Obongo is a DEB system, I think the equivalent command is, but check:

dpkg -S /lib/x86_64-linux-gnu/libTKBO.so.7 /lib/x86_64-linux-gnu/libTKBO.so.7.6.3

which will probably return the name of the opencascade package. Reinstall that package, forcing it if necessary.

Also check if there are any other stray opencascade versions installed.

Hi Retired Feline :slight_smile:

Thanks for answering! Sorry to be confusing! What I meant was
A ->_pcbnew.kiface, and
B->libTKBO (as symlink to the real binary)

So, cksum(_bcbnew.kiface(notWorking))=cksum(_bcbnew.kiface(working))
and
cksum(libTKBO(notWorking))=cksum(libTKBO(working)).

But _pcbnew.kiface(notWorking) does not find the symbol in libTKBO(notWorking)
but _pcbnew.kiface(Working) finds the symbol in libTKBO(Working)

This alone is veeery confusing, and the only thing I could imagine is that for some reason, _bcbnew.kiface only uses this very symbol (in runtime) in the installation, which is not working, for whatever reason. In the working installation, the symbol would also not be found, but as it is not needed, it doesn’t try, and everything works fine. That was my thought.

But then… yes, the symbol DOES exist! On both installations, the working the one that doesn’t work.

dpkg -S - now it gets even more interesting (I did try that also): For both files I get “no path found matching pattern…” - for both the working and and broken installation. And for the working installation, I installed ubuntu on a VM and Kicad is the only package that I installed on the virgin vanilla Ubuntu.
So it wants to tell me that these files didn’t even come with a debian installation??

I start thinking that someone somewhere is watching me with a bag full of popcorn and thinks: “let’s see how far I can push his confusion until he gets crazy” :crazy_face:

Other versions of OpenCascade… I do have FreeCAD, which also needs OpenCascade (I think it is even developed by the FreeCAD Guys). But I’m using AppImages there. But Maybe I can find something there… Thanks for the hint!

_pcbnew.kiface is not a library, it’s an executable.

$ file /usr/bin/_pcbnew.kiface
/usr/bin/_pcbnew.kiface: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=cc7f30d7ab5b66cb438712ee2e8fc0c8362586fc, not stripped

Do a:

ldd /usr/bin/_pcbnew.kiface | grep libTKBO

On my system it comes from:

rpm -qf /usr/lib64/libTKBO.so.7.7
libopencascade-modelingalgorithms7_7-7.7.0-bp155.1.20.x86_64

I’d still check to see if there are any stray versions of libopencascade* on your system, using dpkg commands of course.

Also I would not call Obongo Debian. They have diverged significantly. They share the same package formats though.

Oh, sorry, you already responded, while I was editing b/c I forgot to mention the opencascade installations.

Ah, ok, sorry, yes, _pcbnew.kiface is an executable indeed…

ldd /usr/bin/_pcbnew.kiface | grep libTKBO
libTKBO.so.7 => /lib/x86_64-linux-gnu/libTKBO.so.7 (0x00007c09f6e23000)
and
ls -l /lib/x86_64-linux-gnu/libTKBO.so.7
lrwxrwxrwx 1 root root 16 Feb 8 14:41 /lib/x86_64-linux-gnu/libTKBO.so.7 → libTKBO.so.7.6.3

This is the one of which I compared the chksums on both innstallations

Hmmmm… in your case it’s 7.7… interesting…

dpkg -l | grep -i libocct gives me the exact same on the VM installation which works as in the host installation that doesn’t :frowning:

I think what’s happening is you have another opencascade library which happens to be the same version but was built slightly differently, and it’s pulled in by another CAD program. I seem to remember that FreeCAD and KiCad have problems co-existing. Even though you may be using an Appimage for FreeCAD, do you have any leftover traces of an attempted native install? Or some other CAD program that uses opencascade?

I think you are right. But I still don’t get it, how two pairs of binary files (executable->library) can be exactly the same on two installations, and still on one installation the executable claims that it cannot find a symbol.

I don’t like what you say about FreeCad<->Kicad coexistence problems. That would be a bummer! I never had issues as so far. But ok - I think I have to get rid of all that occt stuff. I have to admit that I have about half a dozen different appimages of Freecad, both vanilla and Link Branch on my system. And I may also have installed FreeCAD in ancient times… Thanks for the hint!

If installing KiCad from PPA, you also have to install FreeCAD from PPA, because they both use the same OpenCascade version which is newer than is provided by upstream Ubuntu.

This issue seems like an old version of OpenCascade is left on your system for some reason.

Ok, I’ll try that.

Oh. BTW, about the files not coming from a debian package in the above post - ok, at least this mystery is solved :slight_smile:

/lib is a symlink to /usr/lib on ubuntu. So if I do a dpkg -L on /lib/… it doesn’t find a match, but it does for /usr/lib/…
The file comes from libocct-modeling-algorithms-7.6:amd64

So let’s see if I have some strange leftovers from a FreeCAD somewhere. Thank you very much for your hints!

find /lib/x86_64-linux-gnu/ -name "libTK*.so" -print -exec sh -c "readelf -W -s {} | grep _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange" \;

That symbol should be defined in /lib/x86_64-linux-gnu/libTKTopAlgo.so

/lib/x86_64-linux-gnu/libTKRWMesh.so
/lib/x86_64-linux-gnu/libTKXMesh.so
/lib/x86_64-linux-gnu/libTKIGES.so
/lib/x86_64-linux-gnu/libTKMath.so
/lib/x86_64-linux-gnu/libTKMesh.so
   283: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDEDRAW.so
/lib/x86_64-linux-gnu/libTKBinTObj.so
/lib/x86_64-linux-gnu/libTKShHealing.so
   821: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKQADraw.so
  1621: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXCAF.so
/lib/x86_64-linux-gnu/libTKDraw.so
/lib/x86_64-linux-gnu/libTKXmlXCAF.so
/lib/x86_64-linux-gnu/libTKXmlL.so
/lib/x86_64-linux-gnu/libTKG3d.so
/lib/x86_64-linux-gnu/libTKStdL.so
/lib/x86_64-linux-gnu/libTKTopTest.so
  1922: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKG2d.so
/lib/x86_64-linux-gnu/libTKCAF.so
   327: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKDCAF.so
   913: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKMeshVS.so
/lib/x86_64-linux-gnu/libTKStd.so
/lib/x86_64-linux-gnu/libTKHLR.so
/lib/x86_64-linux-gnu/libTKSTEP209.so
/lib/x86_64-linux-gnu/libTKGeomBase.so
/lib/x86_64-linux-gnu/libTKTObj.so
/lib/x86_64-linux-gnu/libTKFillet.so
   841: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKLCAF.so
/lib/x86_64-linux-gnu/libTKBin.so
/lib/x86_64-linux-gnu/libTKVRML.so
/lib/x86_64-linux-gnu/libTKSTEPBase.so
/lib/x86_64-linux-gnu/libTKXml.so
/lib/x86_64-linux-gnu/libTKTObjDRAW.so
/lib/x86_64-linux-gnu/libTKBinL.so
/lib/x86_64-linux-gnu/libTKXSDRAW.so
/lib/x86_64-linux-gnu/libTKOpenGlTest.so
/lib/x86_64-linux-gnu/libTKBRep.so
/lib/x86_64-linux-gnu/libTKFeat.so
   561: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKSTEP.so
  5041: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKCDF.so
/lib/x86_64-linux-gnu/libTKOffset.so
   968: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKernel.so
/lib/x86_64-linux-gnu/libTKOpenGl.so
/lib/x86_64-linux-gnu/libTKXmlTObj.so
/lib/x86_64-linux-gnu/libTKSTL.so
    50: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKV3d.so
   857: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKVCAF.so
/lib/x86_64-linux-gnu/libTKPrim.so
    84: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDESTEP.so
/lib/x86_64-linux-gnu/libTKBool.so
  1089: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKXDEIGES.so
/lib/x86_64-linux-gnu/libTKTopAlgo.so
  1214: 0000000000180f10     5 FUNC    GLOBAL DEFAULT   14 _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange
/lib/x86_64-linux-gnu/libTKBinXCAF.so
/lib/x86_64-linux-gnu/libTKGeomAlgo.so
/lib/x86_64-linux-gnu/libTKSTEPAttr.so
/lib/x86_64-linux-gnu/libTKService.so
/lib/x86_64-linux-gnu/libTKXSBase.so
/lib/x86_64-linux-gnu/libTKViewerTest.so
/lib/x86_64-linux-gnu/libTKBO.so
   686: 0000000000000000     0 FUNC    GLOBAL DEFAULT  UND _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

Yes, I have that:

/lib/x86_64-linux-gnu/libTKSTEPAttr.so.7.6.3
/lib/x86_64-linux-gnu/libTKXDEDRAW.so.7.6.3
/lib/x86_64-linux-gnu/libTKTopAlgo.so
  1214: 0000000000180f10     5 FUNC    GLOBAL DEFAULT   14 _ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange

Meanwhile I have apt removed libocct*, (which wiped kicad, too), did an autoremove, installed again - same.
Apt policy on all libocct* packages gives me exactly the same on the host installation and the VM installation, including versions and ppa (all from KiCad-8.0). And still, one works, the other not :frowning:

Try:
sudo apt install libtree
libtree -p /usr/bin/_pcbnew.kiface

Is /lib/x86_64-linux-gnu/libTKTopAlgo.so.7 in the tree?

Also what does this say?

ls -la /lib/x86_64-linux-gnu/libTKTopAlgo.so* /lib/x86_64-linux-gnu/libTKBO.so* /lib/x86_64-linux-gnu/libTKPrim.so*

Yes, I have it, mentioned 15 times. But not in that particular chain seen on your screen-shot.
If I interpret the output correctly, I don’t see libTKPrim.so being dependent on libTKTopAlgo.so

ls -la /lib/x86_64-linux-gnu/libTKTopAlgo.so* /lib/x86_64-linux-gnu/libTKBO.so* /lib/x86_64-linux-gnu/libTKPrim.so*

lrwxrwxrwx 1 root root      16 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKBO.so.7 -> libTKBO.so.7.6.3
-rw-r--r-- 1 root root 1927520 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKBO.so.7.6.3
lrwxrwxrwx 1 root root      18 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKPrim.so.7 -> libTKPrim.so.7.6.3
-rw-r--r-- 1 root root  358744 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKPrim.so.7.6.3
lrwxrwxrwx 1 root root      17 Mai 20 17:39 /lib/x86_64-linux-gnu/libTKTopAlgo.so -> libTKTopAlgo.so.7
lrwxrwxrwx 1 root root      21 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKTopAlgo.so.7 -> libTKTopAlgo.so.7.6.3
-rw-r--r-- 1 root root 2472288 Feb  8 14:41 /lib/x86_64-linux-gnu/libTKTopAlgo.so.7.6.3

At least I now know a new tool :smiley:

Can you share the whole output?

libtree -p /usr/bin/_pcbnew.kiface > tree.txt

I cannot upload files (new user). But here’s a google drive link to it:

You have a mix of /usr/local and system libs


tree.txt (39.8 KB)

ldd /usr/bin/_pcbnew.kiface | grep TK
would’ve also revealed this.

uh - ouch! And yes, finally I see something DIFFERENT between the working installation and the one that doesn’t work! Ok… I have to settle that and then try to clean that up :slight_smile: THANKS A LOT!

1 Like

IT WORKS!

Thanks A LOT guys! :smiley:

After cleaning up my mess in the ld.conf files I still was not yet there. But then, thanks to libtree, chsum, dpkg -S and apt policy, it was easy to follow all the discrepancies. Some wxWidget libs were also coming from wrong ppa’s.

But, just for the record:


`Failed to load shared library '/usr/bin/_pcbnew.kiface': 
/lib/x86_64-linux-gnu/libTKBO.so.7: undefined symbol: 
_ZN24BRepBuilderAPI_MakeShape5BuildERK21Message_ProgressRange`

This was just lying! Somehow it took the lib from /usr/local, but still claimed that it did not find the symbol in the system lib. Or even: Could it be that when there is a problem downstream a library call, the error message is just “undefined symbol”?

Again: THANKS A LOT for all your help!

/usr/bin/_pcbnew.kiface needs libTKBO.so.7 (you can see it in readelf -d)

/lib/x86_64-linux-gnu/libTKBO.so.7 (system) was loaded because apparently there was no /usr/local/lib/libTKBO.so.7

/lib/x86_64-linux-gnu/libTKBO.so.7 needs libTKTopAlgo.so.7

Since /usr/local/lib path is before others in /etc/ld.so.conf*,
/usr/local/lib/libTKTopAlgo.so.7 was loaded, which apparently doesn’t have the correct symbol.

So the error message makes sense.