[DragonFlyBSD - Bug #3221] (Resolved) Assertions hit in the mtmagazine.

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Sun Feb 9 18:47:37 PST 2020


Issue #3221 has been updated by yellowrabbit2010.

Status changed from New to Resolved

My bad, speaking of a ``clean'' system, I did not take into account the changes in the conf files, but only the absence of any additional packages.
I managed to bring my system to normal.

TL;DR Some contents of the /etc/make.conf file may lead to ``incorrect'' contents of the /lib/libc.so.8 library.

*** I will use the terms correct and incorrect in the sense of whether overlap of the ``last'' and ``thread_mags'' variables occurs in my system, and not in the sense of the libc.so.8 library being correct as a shared object file.

Branch master, commit 5be1fc4638827e5ad8f6f4a3a85c4466f559d760

Here's what the correct relocations in the library look like:
=========
fly# readelf -r /usr/obj/usr/src/world_x86_64/usr/src/lib/libc/libc.so.8 | fgrep mags
0000001376a0  000500000012 R_X86_64_TPOFF64  0000000000000020 thread_mags + 0

fly# readelf -r /usr/obj/usr/src/world_x86_64/usr/src/lib/libc/libc.so.8 | fgrep last
000000137520  000100000012 R_X86_64_TPOFF64  0000000000000000 last.2332 + 0
000000138418  080200000007 R_X86_64_JUMP_SLO 0000000000054750 updlastlogx@@DF404.0 + 0

fly# objdump -d /usr/obj/usr/src/world_x86_64/lib/libc.so.8 | grep -A 7 '<strtok[^t]*>:'
00000000000384d2 <strtok>:
   384d2:       48 83 ec 08             sub    $0x8,%rsp
   384d6:       48 8b 15 43 f0 0f 00    mov    0xff043(%rip),%rdx        # 137520 <_DYNAMIC+0x238>
   384dd:       64 48 03 14 25 00 00    add    %fs:0x0,%rdx
   384e4:       00 00
   384e6:       e8 d5 b3 ff ff          callq  338c0 <__strtok_r at plt>
   384eb:       48 83 c4 08             add    $0x8,%rsp
   384ef:       c3                      retq
=========
As you can see, the ``last'' variable corresponds to one relocation record, it has the correct type (R_X86_64_TPOFF64) and the offset (137520) contains exactly the command that needs to be adjusted at load time (inside the strtok function, ``mov    0xff043(%rip),%rdx'').

Incorrect relocations:
=========
rabbit at fly ~% readelf -r /usr/obj/usr/src/world_x86_64/lib/libc.so.8|fgrep mags
0000001979e8  000500000012 R_X86_64_TPOFF64  0000000000000020 thread_mags + 0

rabbit at fly ~% readelf -r /usr/obj/usr/src/world_x86_64/lib/libc.so.8|fgrep last
000000197a70  000100000010 R_X86_64_DTPMOD64 0000000000000000 last.2332 + 0
000000197d00  000100000010 R_X86_64_DTPMOD64 0000000000000000 last.2332 + 0
000000198770  080300000007 R_X86_64_JUMP_SLO 0000000000063022 updlastlogx@@DF404.0 + 0

rabbit at fly ~% objdump -d /usr/obj/usr/src/world_x86_64/lib/libc.so.8|grep -A 16 '<strtok[^t]*>:'
0000000000039497 <strtok>:
   39497:       55                      push   %rbp
   39498:       48 89 e5                mov    %rsp,%rbp
   3949b:       48 83 ec 10             sub    $0x10,%rsp
   3949f:       48 89 7d f8             mov    %rdi,-0x8(%rbp)
   394a3:       48 89 75 f0             mov    %rsi,-0x10(%rbp)
   394a7:       64 48 8b 14 25 00 00    mov    %fs:0x0,%rdx
   394ae:       00 00
   394b0:       48 8b 05 e9 e3 15 00    mov    0x15e3e9(%rip),%rax        # 1978a0 <_DYNAMIC+0x238>
   394b7:       48 01 c2                add    %rax,%rdx
   394ba:       48 8b 4d f0             mov    -0x10(%rbp),%rcx
   394be:       48 8b 45 f8             mov    -0x8(%rbp),%rax
   394c2:       48 89 ce                mov    %rcx,%rsi
   394c5:       48 89 c7                mov    %rax,%rdi
   394c8:       e8 13 a8 ff ff          callq  33ce0 <__strtok_r at plt>
   394cd:       c9                      leaveq
   394ce:       c3                      retq
=========
Here we have for some reason two relocation entries that are of the wrong type (R_X86_64_DTPMOD64) and point (197a70) to a function ``__lpmap_map'' that has nothing to do with the ``last'' variable from the strtok function.
=========
0000000000096e65 <__lpmap_map>:
   96e65:       55                      push   %rbp
   96e66:       48 89 e5                mov    %rsp,%rbp
   96e69:       48 83 ec 30             sub    $0x30,%rsp
   96e6d:       48 89 7d e8             mov    %rdi,-0x18(%rbp)
   96e71:       48 89 75 e0             mov    %rsi,-0x20(%rbp)
   96e75:       89 d0                   mov    %edx,%eax
   96e77:       66 89 45 dc             mov    %ax,-0x24(%rbp)
   96e7b:       66 48 8d 3d ed 0b 10    data16 lea 0x100bed(%rip),%rdi        # 197a70 <_DYNAMIC+0x408>
   96e82:       00
   96e83:       66 66 48 e8 65 cd f9    data16 data16 callq 33bf0 <__tls_get_addr at plt>
   96e8a:       ff
   96e8b:       8b 00                   mov    (%rax),%eax
   96e8d:       85 c0                   test   %eax,%eax
   96e8f:       0f 8f 08 01 00 00       jg     96f9d <__lpmap_map+0x138>
   96e95:       66 48 8d 3d d3 0b 10    data16 lea 0x100bd3(%rip),%rdi        # 197a70 <_DYNAMIC+0x408>
   96e9c:       00
   96e9d:       66 66 48 e8 4b cd f9    data16 data16 callq 33bf0 <__tls_get_addr at pl
   ...
=========

Now a small table that shows the results of make build_all, depending on the /etc/make.conf file.
+----------------------+----------------+
| /etc/make.conf       | /lib/libc.so.8 |
+----------------------+----------------+
| is absent            | correct        |
+----------------------+----------------+
| is empty             | correct        |
+----------------------+----------------+
| CFLAGS=-Werror       | incorrect      |
+----------------------+----------------+



----------------------------------------
Bug #3221: Assertions hit in the mtmagazine. 
http://bugs.dragonflybsd.org/issues/3221#change-13855

* Author: yellowrabbit2010
* Status: Resolved
* Priority: Normal
* Assignee: 
* Category: Other
* Target version: 
----------------------------------------


Hello,
Sorry that I can’t figure out the exact sequence when this happens, the process looks random. And I can work in the same gimp for half a day and not encounter this error, and sometimes I can’t even start it.
I can compile the package, in this case textproc/groff:
================
/bin/mkdir -p ./tmac
sed -e "s;[@]PNMTOPS_NOSETPAGE[@];pnmtops;g" \
  ./tmac/www.tmac.in > ./tmac/www.tmac
/bin/mkdir -p `dirname doc/webpage.ps` \
&& LANG=C LC_ALL=C sed -e "s;[@]VERSION[@];1.22.4;" doc/webpage.ms | GROFF_COMMAND_PREFIX= GROFF_BIN_PATH="/usr/obj/dports/textproc/groff/groff-1.22.4" /usr/obj/dports/textproc/groff/groff-1.22.4/groff -I/usr/obj/dports/textproc/groff/groff-1.22.4 -M /usr/obj/dports/textproc/groff/groff-1.22.4/doc -M/usr/obj/dports/textproc/groff/groff-1.22.4/tmac -M/usr/obj/dports/textproc/groff/groff-1.22.4/tmac -F/usr/obj/dports/textproc/groff/groff-1.22.4/font -F/usr/obj/dports/textproc/groff/groff-1.22.4/font -Upet -ww  -Tps -ms -mwww >doc/webpage.ps
assertion: mp->rounds != 0 in mtmagazine_alloc
gmake[2]: *** [Makefile:11742: doc/webpage.ps] Error 1
gmake[2]: Leaving directory '/usr/obj/dports/textproc/groff/groff-1.22.4'
gmake[1]: *** [Makefile:5600: all] Error 2
gmake[1]: Leaving directory '/usr/obj/dports/textproc/groff/groff-1.22.4'
*** Error code 1

Stop.
make: stopped in /usr/dports/textproc/groff
fly#
================

or i can just try to run gimp
================
rabbit at fly /usr/src% gimp
assertion: MAGAZINE_NOTFULL(mp) in mtmagazine_free
gimp: terminated: Terminated
================

I'm at the master branch, commit d0e99d5ddb6a001850be2dff41813e1cad00b5af.



---Files--------------------------------
IMG_20200203_090633_HDR-min.jpg (1.06 MB)
IMG_20200204_191847_HDR.jpg (3.79 MB)


-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list