pkg consumes too much memory and finally it crashes with signal 6, abort. I have tried too many times without success. I've installed the newest development version with debug symbols from ports tree, it did not change anything.
I have just recently updated to FreeBSD 11.0-RELEASE from 10.3-RELEASE probably because of this same reason.
The line in the file is:
And so, indeed memory runs out. I had to install more swap to overcome this issue, it did not help. The actual cause is the calloc, not the function. Am I right, the pointer if it is returned, is copied? I would replace the return line with &(*ptr) to be sure to point to the allocated memory only even after the segment changes (I should check this). This change did not do anything.
With
Many have found a resolution to fix this issue from gettext and gettext-runtime dependency as in the next links. Many have reported the same error, pkg has stayed in a loop for a long time and finally crashed without notifying the reason (ie. a dependency after reading the newsgroups and debugging).
Other posts:
[ https://forums.freebsd.org/threads/49475/ keywords: wget pkg, gettext, gettext-runtime ]
[ https://forums.freebsd.org/threads/55772/ keywords: pkg abort trap ]
pkg:
[ https://github.com/freebsd/pkg ]
[ https://wiki.freebsd.org/pkgng ]
I had found a bug report as well in an URL not found from above links. Some hints in posts were to remove duplicate rows from the database file with an SQL-editor.
My pkg crashes now almost every time when I'm installing a package. Almost every package (recent was lxde-meta, previous was probably texmaker, almost any smaller ones as well). What is the reason in my case? Do I have to update the database somehow?
How do I find the missing dependencies? It would be nice if the pkg would print lines to debug these issues instead of using all of the memory (2GB + 1,5GB swap here) and crashing.
Any other resolution before listing everything, deleting everything and installing everything again? (if this helps.)
esc
I have just recently updated to FreeBSD 11.0-RELEASE from 10.3-RELEASE probably because of this same reason.
# pkg -v
1.10.99.4
# uname -a
FreeBSD my_hostname 11.0-RELEASE-p1 FreeBSD 11.0-RELEASE-p1 #0: Thu May 18 12:10:33 EEST 2017 my_machine_name_here i386
gdb -c ./pkg.core <path to>/pkg
:
Code:
Loaded symbols for /libexec/ld-elf.so.1
#0 0x28745f63 in thr_kill () from /lib/libc.so.7
[New Thread 28c14000 (LWP 101056/<unknown>)]
(gdb) bt
#0 0x28745f63 in thr_kill () from /lib/libc.so.7
#1 0x28745f48 in raise () from /lib/libc.so.7
#2 0x28745e83 in abort () from /lib/libc.so.7
#3 0x280bb61b in xcalloc (n=1, size=2168) at xmalloc.h:16
#4 0x280c11f9 in pkg_addfile_attr (pkg=0x2ad9aa00, path=0x7fbfd680 "/usr/local/include/boost/chrono/chrono_io.hpp",
sum=0x7ece45a0 "1$5c90efc00d030aca3338af63039aef1c9656b0dfca4050cfc4c175e65d14734e", uname=0x0, gname=0x0, perm=0, fflags=0,
check_duplicates=false) at pkg.c:715
#5 0x280c0efd in pkg_addfile (pkg=0x2ad9aa00, path=0x29f4dc90 "/usr/local/include/boost/chrono/chrono_io.hpp",
sum=0x7ece45a0 "1$5c90efc00d030aca3338af63039aef1c9656b0dfca4050cfc4c175e65d14734e", check_duplicates=false) at pkg.c:688
#6 0x28112ee0 in pkg_obj (pkg=0x2ad9aa00, obj=0x60ffe4d0, attr=4294967293) at pkg_manifest.c:539
#7 0x28115339 in parse_manifest (pkg=0x2ad9aa00, keys=0x6151d920, obj=0x616e3ac0) at pkg_manifest.c:763
#8 0x2810f628 in pkg_parse_manifest_ucl (pkg=0x2ad9aa00, obj=0x616e3ac0, keys=0x6151d920) at pkg_manifest.c:799
#9 0x2810ef70 in pkg_parse_manifest (pkg=0x2ad9aa00,
buf=0x7f60c080 "{\"name\":\"boost-libs\",\"origin\":\"devel/boost-libs\",\"version\":\"1.64.0\",\"comment\":\"Free portable C++ libraries (without
Boost.Python)\",\"maintainer\":\"office@FreeBSD.org\",\"www\":\"http://www.boost.org/\",\"abi\""..., len=1646381, keys=0x6151d920) at pkg_manifest.c:829
#10 0x280c6c84 in pkg_open2 (pkg_p=0x7fbfde90, a=0x7fbfde2c, ae=0x7fbfde28, path=0x7fbfdeac "/var/cache/pkg/boost-libs-1.64.0-16686fd8af.txz",
keys=0x6151d920, flags=4, fd=-1) at pkg.c:1469
#11 0x280c67f7 in pkg_open (pkg_p=0x7fbfde90, path=0x7fbfdeac "/var/cache/pkg/boost-libs-1.64.0-16686fd8af.txz", keys=0x6151d920, flags=4)
at pkg.c:1360
#12 0x282f8d25 in pkg_repo_binary_ensure_loaded (repo=0x28c37070, pkg=0x2a2fa000, flags=36) at query.c:439
#13 0x2814818c in pkgdb_ensure_loaded (db=0x28c249a0, pkg=0x2a2fa000, flags=36) at pkgdb_iterator.c:1245
#14 0x280f171e in pkg_jobs_solve (j=0x28c29430) at pkg_jobs.c:1854
#15 0x0806aecb in exec_upgrade (argc=0, argv=0x7fbfec18) at upgrade.c:402
#16 0x0805f168 in main (argc=2, argv=0x7fbfec10) at main.c:886
(gdb)
Code:
12 static inline void *xcalloc(size_t n, size_t size)
13 {
14 void *ptr = calloc(n, size);
15 if (ptr == NULL)
16 abort();
17 return (ptr);
18 }
With
pkg -v debug upgrade
or pkg -d install
DBG(1)[87878]> Binary> loading /var/cache/pkg/ca_root_nss-3.30.2-c1809a469f.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/ca-gimp-help-html-2.8.2-aca12492a6.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/c64bdf-1.0_3-8f4816e7c7.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/brasero-3.12.1_1-9c583f4747.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/bovo-4.14.3_1-60d910acd8.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/boost-python-libs-1.64.0-2298f21166.txz
DBG(1)[87878]> Binary> loading /var/cache/pkg/boost-libs-1.64.0-16686fd8af.txz
DBG(1)[87898]> pkg initialized
Updating FreeBSD repository catalogue...
DBG(1)[87898]> PkgRepo: verifying update for FreeBSD
DBG(1)[87898]> Pkgrepo, begin update of '/var/db/pkg/repo-FreeBSD.sqlite'
# Abort trap (core dumped)
# signal 6
Many have found a resolution to fix this issue from gettext and gettext-runtime dependency as in the next links. Many have reported the same error, pkg has stayed in a loop for a long time and finally crashed without notifying the reason (ie. a dependency after reading the newsgroups and debugging).
Other posts:
[ https://forums.freebsd.org/threads/49475/ keywords: wget pkg, gettext, gettext-runtime ]
[ https://forums.freebsd.org/threads/55772/ keywords: pkg abort trap ]
pkg:
[ https://github.com/freebsd/pkg ]
[ https://wiki.freebsd.org/pkgng ]
I had found a bug report as well in an URL not found from above links. Some hints in posts were to remove duplicate rows from the database file with an SQL-editor.
My pkg crashes now almost every time when I'm installing a package. Almost every package (recent was lxde-meta, previous was probably texmaker, almost any smaller ones as well). What is the reason in my case? Do I have to update the database somehow?
How do I find the missing dependencies? It would be nice if the pkg would print lines to debug these issues instead of using all of the memory (2GB + 1,5GB swap here) and crashing.
Any other resolution before listing everything, deleting everything and installing everything again? (if this helps.)
esc