symbol lookup error

Received “symbol lookup error” from dot after upgrading to Ubuntu 22.04. The message is “/snap/core20/current/lib/x86_64-linux-gnu/ undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE”. It appears that dot is looking for the file but some snap application has usurped it. Is there a way to have dot look in the right directory? An environment variable perhaps?

We’ll probably need some more information about how you installed Graphviz to troubleshoot this one.

Having said that, if you just want to apply some hacky work arounds to unblock your progress, env LD_LIBRARY_PATH=/path/to/dir/with/libc my-program will teach the dynamic linker how to locate extra libraries at runtime. Though Graphviz does not use threads, so I don’t know why it would be looking for libpthread.

Installed it with “sudo apt install graphviz”. Worked fine till I upgraded to Ubuntu 22.04 LTS. Now I get the error message whenever I run doxygen, since it uses dot to generate diagrams for the code, and, of course, when I run dot from the command line.

Modifying LD_LIBRARY_PATH with various directories off the “/usr/lib” root did not help. The complete error message I get is “dot: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/ undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE”. When I run doxygen, this same error message appears and afterward, the following error message appears, which may give a bit more information:
error: Problems running dot: exit code=127, command=‘dot’, arguments=’"/home/cherry/cherry/AFSS/Software/Development/OR3/Documentation/html/" -Tpng -o “/home/cherry/cherry/AFSS/Software/Development/OR3/Documentation/html/struct_a_f_a_1_1_i_n_s___health___parameters__coll__graph.png”’
Does the exit code provide any help?

Mysterious. All I can suggest is reinstalling Graphviz. I don’t know why it would be trying to link against Snap libraries. Isn’t Graphviz a regular (non-Snap) package in the Ubuntu ecosystem?

I’ve removed and reinstalled graphviz and get the same result. Does dot link with any libraries during run-time? If so, what library files is it looking for? What does the exit code of 127 mean?

Yes, it links against numerous libraries, but I was not aware any of them used multithreading. If you have ldd, you can run something like ldd $(which dot) to inspect this.

Exit status 127 is usually some kind of file-not-found issue, which would be consistent with the message.

You might have to ask the Debian maintainer of this package, Laszlo Boszormenyi, as maybe it’s compiled in some unusual way, Debian -- Details of package graphviz in sid. Though given this is something Ubuntu auto-packages from upstream Debian and Ubuntu 22.04 was only just released, I wouldn’t be surprised if this was some unintended misbehavior or interaction in Ubuntu’s packaging work flow.

Found it. When upgrading Ubuntu to 22.04, Alacritty was installed as a Snaps application and this is the application that was causing a conflict to dot. Removing Alacritty resolved the issue and dot runs without error now.