apk add --root segfaults when it has an invalid root directory
(gdb) set args add --root non-existsing (gdb) run Starting program: /home/ncopa/apk-tools/src/apk add --root non-existsing warning: Cannot call inferior functions, Linux kernel PaX protection forbids return to non-executable pages! ERROR: Unable to open root: No such file or directory
Program received signal SIGSEGV, Segmentation fault.
0x080626ba in apk_hash_free (h=h@entry=0xfad963b4) at src/hash.c:26
26 apk_hash_foreach(h, (apk_hash_enumerator_f) h->ops->delete_item, NULL);
(gdb) bt
#0 0x080626ba in apk_hash_free (h=h@entry=0xfad963b4) at src/hash.c:26
#1 0x080602cb in apk_id_cache_free (idc=idc@entry=0xfad963ac) at src/io.c:903
#2 0x08055ec0 in apk_db_close (db=0xfad95dac) at src/database.c:1743
#3 0x08057a80 in apk_db_open (db=<optimized out>, db@entry=0xfad95dac,
dbopts=<optimized out>) at src/database.c:1661
#4 0x0804ace8 in main (argc=0, argv=<optimized out>) at src/apk.c:459
(gdb)
(from redmine: issue id 2134, created on 2013-07-16, closed on 2013-10-02)
- Changesets:
- Revision ec3b11dc1bec500609eebdd951720b3836e68d8c by Natanael Copa on 2013-07-16T10:25:28Z:
main/apk-tools: fix to not hang when splitting -libs packages
also fix segault when --root dir is invalid and rename lua-apk to
lua5.2-apk.
ref #2134
ref #2135
- Revision 21d4e924 by Natanael Copa on 2013-07-17T07:30:53Z:
db: fix segfault when --root points to invalid dir
fixes #2134