pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg_delete crashing due to invalid glob(3) result on macOS 12.1



So, this has been happening on my new macOS system running macOS 12.1 (Monterey).

It would seem as if the system-supplied glob(3) is returning an invalid
result where the gl_pathc field is apparently correct, but gl_pathv is
still NULL.

Has anyone else seen this or anything similar (i.e. esp. on macOS)?

22:40 [1.2194] # lldb ./pkg_delete
Breakpoint 1: no locations (pending).
Breakpoint set in dummy target, will get copied into future targets.
error: invalid target, create a target using the 'target create' command
(lldb) target create "./pkg_delete"
Current executable set to '/private/var/package-obj/root/pkgtools/pkg_install/work/pkg_install-20211115/delete/pkg_delete' (x86_64).
(lldb) run yajl
Process 78463 launched: '/private/var/package-obj/root/pkgtools/pkg_install/work/pkg_install-20211115/delete/pkg_delete' (x86_64)
pkg_delete(78463,0x1000b4600) malloc: adding guard pages for large allocator blocks
pkg_delete(78463,0x1000b4600) malloc: enabling scribbling to detect mods to free blocks
pkg_delete(78463,0x1000b4600) malloc: enabling abort() on bad malloc or free
pkg_delete(78463,0x1000b4600) malloc: checks heap after operation #1 and each 1 operations
pkg_delete(78463,0x1000b4600) malloc: will abort on heap corruption
Process 78463 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x000000010000430b pkg_delete`remove_files(path="/opt/pkg/.pkgdb/yajl-2.1.0nb1", pattern="+*") at file.c:275:14
   272
   273           /* deleting globbed files */
   274           for (j = 0; j < globbed.gl_pathc; j++)
-> 275                   if (unlink(globbed.gl_pathv[j]) < 0)
   276                           warn("can't delete ``%s''", globbed.gl_pathv[j]);
   277
   278           return;
Target 0: (pkg_delete) stopped.
(lldb) v
(const char *) path = 0x0000600002c00000 "/opt/pkg/.pkgdb/yajl-2.1.0nb1"
(const char *) pattern = 0x0000000100019d36 "+*"
(char [1024]) fpath = "/opt/pkg/.pkgdb/yajl-2.1.0nb1/+*"
(glob_t) globbed = {
  gl_pathc = 8
  gl_matchc = 0
  gl_offs = 8
  gl_flags = 1
  gl_pathv = 0x0000000000000000
  gl_errfunc = 0x00007ff700000120 (0x00007ff700000120)
  gl_closedir = 0x0000600002100050 (0x0000600002100050)
  gl_readdir = 0x0000000000000000
  gl_opendir = 0xf68c0000c0001000 (0xf68c0000c0001000)
  gl_lstat = 0x000001ffbfefffff (0x000001ffbfefffff)
  gl_stat = 0x0000000000000080 (0x0000000000000080)
}
(int) i = 0
(size_t) j = 0
(lldb)



$ l /opt/pkg/.pkgdb/yajl-2.1.0nb1/+*
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+BUILD_INFO
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+BUILD_VERSION
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+COMMENT
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+CONTENTS
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+DESC
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+REQUIRED_BY
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+SIZE_ALL
/opt/pkg/.pkgdb/yajl-2.1.0nb1/+SIZE_PKG
$


Hopefully soon I'll get a chance to try glob(3) with a smaller test program.

--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpjlkjJmQGJQ.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index