My working mail config started failing after an upgrade to OpenBSD 7.2
and a pkg update.

# uname -a
OpenBSD bleh 7.2 GENERIC.MP#0 amd64
# pkg_info postfix
Information for inst:postfix-3.7.2p1-pgsql


postmap fails to do pgsql lookups.  it crashes when attempting.

# postmap -q 'myemailaddress' pgsql:/etc/postfix/pgsql_virtual_mailbox_maps.cf
postmap(98686) in free(): bogus pointer (double free?) 0x80
Abort trap (core dumped)

# postmap -q 'myemailaddress' pgsql:/etc/postfix/pgsql_virtual_mailbox_maps.cf
Segmentation fault (core dumped)

        I'm not sure why these were different.

I ran gdb and lldb on the core file and these were the results,
but I am new to these commands, so let me know if I can do better:

GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-unknown-openbsd7.2"...
Core was generated by `postmap'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libpthread.so.26.2...done.
Loaded symbols for /usr/lib/libpthread.so.26.2
Loaded symbols for /usr/local/sbin/postmap
Reading symbols from /usr/local/lib/libsqlite3.so.37.20...done.
Loaded symbols for /usr/local/lib/libsqlite3.so.37.20
Reading symbols from /usr/local/lib/libpq.so.6.13...done.
Loaded symbols for /usr/local/lib/libpq.so.6.13
Reading symbols from /usr/local/lib/libpcre2-8.so.0.6...done.
Loaded symbols for /usr/local/lib/libpcre2-8.so.0.6
Symbols already loaded for /usr/lib/libpthread.so.26.2
Reading symbols from /usr/lib/libc.so.96.2...done.
Loaded symbols for /usr/lib/libc.so.96.2
Reading symbols from /usr/lib/libz.so.7.0...done.
Loaded symbols for /usr/lib/libz.so.7.0
Reading symbols from /usr/lib/libm.so.10.1...done.
Loaded symbols for /usr/lib/libm.so.10.1
Reading symbols from /usr/lib/libssl.so.53.0...done.
Loaded symbols for /usr/lib/libssl.so.53.0
Reading symbols from /usr/lib/libcrypto.so.50.0...done.
Loaded symbols for /usr/lib/libcrypto.so.50.0
Reading symbols from /usr/libexec/ld.so...Error while reading shared library 
symbols:
Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in 
module /usr/libexec/ld.so]
#0  0x00000ca51b8c8061 in CRYPTO_THREAD_write_lock (lock=0x0) at 
crypto/threads_none.c:43
43      crypto/threads_none.c: No such file or directory.
        in crypto/threads_none.c


(lldb) target create --core /etc/postmap.core --arch x86_64 
/usr/local/sbin/postmap
Core file '/etc/postmap.core' (x86_64) was loaded.
(lldb) thread list
Process 0 stopped
* thread #1: tid = 8589934592, 0x00000ca51b8c8061 
postmap`CRYPTO_THREAD_write_lock(lock=0x0000000000000000) at 
threads_none.c:43:10, stop reason = signal SIGSEGV
(lldb) thread backtrace all
* thread #1, stop reason = signal SIGSEGV
  * frame #0: 0x00000ca51b8c8061 
postmap`CRYPTO_THREAD_write_lock(lock=0x0000000000000000) at 
threads_none.c:43:10
    frame #1: 0x00000ca51b8e020d postmap`ENGINE_finish(e=0x00000ca74c939800) at 
eng_init.c:106:10
    frame #2: 0x00000ca735fcdb8e 
libcrypto.so.50.0`EVP_MD_CTX_cleanup(ctx=0x00000ca74c91dc80) at digest.c:401:2
    frame #3: 0x00000ca735fcdff0 libcrypto.so.50.0`EVP_MD_CTX_destroy [inlined] 
EVP_MD_CTX_free(ctx=0x00000ca74c91dc80) at digest.c:351:2
    frame #4: 0x00000ca735fcdfd0 
libcrypto.so.50.0`EVP_MD_CTX_destroy(ctx=0x00000ca74c91dc80) at digest.c:377:2
    frame #5: 0x00000ca804990894 libpq.so.6.13`pg_cryptohash_free + 36
    frame #6: 0x00000ca80498d177 libpq.so.6.13`scram_H + 119
    frame #7: 0x00000ca80497188b libpq.so.6.13`pg_fe_scram_exchange + 2459
    frame #8: 0x00000ca804988c81 libpq.so.6.13`pg_fe_sendauth + 993
    frame #9: 0x00000ca804975aa9 libpq.so.6.13`PQconnectPoll + 4057
    frame #10: 0x00000ca804972748 libpq.so.6.13`___lldb_unnamed_symbol1182 + 184
    frame #11: 0x00000ca8049749b1 libpq.so.6.13`PQsetdbLogin + 561
    frame #12: 0x00000ca51b8a709d postmap`dict_pgsql_lookup + 1037
    frame #13: 0x00000ca51b89b277 postmap`postmap_query + 87
    frame #14: 0x00000ca51b89abb7 postmap`main + 2151
    frame #15: 0x00000ca51b89a142 postmap`__start + 322

Reply via email to