Bug 254290

Summary: pthread_setname_np@FBSD_1.6 symbol missing on 12.2 after upgrades (+ a workaround)
Product: Base System Reporter: Christos Margiolis <christos>
Component: threadsAssignee: freebsd-threads (Nobody) <threads>
Status: New ---    
Severity: Affects Many People CC: felix
Priority: ---    
Version: 12.2-RELEASE   
Hardware: Any   
OS: Any   

Description Christos Margiolis 2021-03-14 21:18:56 UTC
I started getting the following error when trying to run programs using `pthread` after I upgraded some packages:

    ld-elf.so.1: /usr/local/lib/libglib-2.0.so.0: Undefined symbol "pthread_setname_np@FBSD_1.6"

It seems that this symbol didn't even exist after checking it with:

    $ objdump -TC /usr/lib/libpthread.so | grep pthread_setname_np

What did fix this error though was rebuilding world. On the IRC channel some said that they too had this error on 12.2. After rebuilding world the symbol appears normally when running an `objdump` on `libpthread.so`

    $ objdump -TC /usr/lib/libpthread.so | grep pthread_setname_np
    000000000000e0d0  w   DF .text  00000000000002a7  FBSD_1.6    pthread_setname_np
Comment 1 Felix Palmen 2021-03-14 22:35:44 UTC
I don't think this is related to threading, but maybe to freebsd-update.

As I've seen incarnations of that very problem multiple times on the forums now, I decided to investigate a bit: Installed a bhyve VM with 12.1-RELEASE, checked symbol is indeed not present in that version, and brought it to 12.2-RELEASE-p4 with freebsd-update. This works as expected, after the procedure, the symbol is there.

So it just leaves me guessing. Maybe this situation is a consequence of user error, like forgetting the second `freebsd-update install` when upgrading to 12.2 and subsequent `freebsd-update fetch` might drop something? Or it only happened when upgrading from a specific 12.1 patchlevel to an earlier patchlevel of 12.2? Unfortunately, I see no way how to try to reproduce this…