lundman wrote:Everything in lib/ is userland
Well in that case, it means I can run it without installing first, if only I can figure out how. My attempt (lldb cmd/zpool/.libs/zpool) yielded a complaint from lldb:
- Code: Select all
error: libzfs.2.dylib debug map object file '/usr/local/src/o3x/zfs/lib/libzfs/.libs/libzfs_pool.o' has changed (actual time is 2018-07-18 21:25:00.000000000, debug map time is 2018-07-17 20:00:54.000000000) since this executable was linked, file will be ignored
I assume that's because I'm not setting the macOS equivalents of LD_* properly, as the libtool wrapper (cmd/zpool/zpool) will, but I can't use the wrapper with lldb short of editing the lldb command into it, which means it breaks on every build, so I'm stuck.
Installing gets me past that and results in the same thing as in the prior try:
- Code: Select all
Process 71821 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
frame #0: 0x000000010041f608 libzfs.2.dylib`zpool_vdev_name [inlined] devid_to_path at libzfs_pool.c:3656 [opt]
3653 /*
3654 * In a case the strdup() fails, we will just return NULL below.
3655 */
-> 3656 path = strdup(list[0].devname);
3657
3658 devid_free_nmlist(list);
3659
Target 0: (zpool) stopped.
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
* frame #0: 0x000000010041f608 libzfs.2.dylib`zpool_vdev_name [inlined] devid_to_path at libzfs_pool.c:3656 [opt]
frame #1: 0x000000010041f608 libzfs.2.dylib`zpool_vdev_name(hdl=0x0000000101800000, zhp=0x0000000102002130, nv=0x0000000102005fd0, name_flags=8) at libzfs_pool.c:3810 [opt]
frame #2: 0x0000000100003169 zpool`max_width(zhp=0x0000000102002130, nv=0x0000000102005fd0, depth=4, max=10, name_flags=0) at zpool_main.c:1523 [opt]
frame #3: 0x000000010000329b zpool`max_width(zhp=0x0000000102002130, nv=0x00000001020041d8, depth=2, max=<unavailable>, name_flags=0) at zpool_main.c:1548 [opt]
frame #4: 0x000000010000329b zpool`max_width(zhp=0x0000000102002130, nv=0x0000000102002520, depth=0, max=<unavailable>, name_flags=0) at zpool_main.c:1548 [opt]
frame #5: 0x0000000100004688 zpool`status_callback(zhp=0x0000000102002130, data=<unavailable>) at zpool_main.c:6631 [opt]
frame #6: 0x00000001000014a6 zpool`pool_list_iter(zlp=0x00000001007006f0, unavail=1, func=(zpool`status_callback at zpool_main.c:6332), data=0x00007ffeefbfe610) at zpool_iter.c:172 [opt]
frame #7: 0x000000010000160c zpool`for_each_pool(argc=<unavailable>, argv=<unavailable>, unavail=1, proplist=<unavailable>, func=(zpool`status_callback at zpool_main.c:6332), data=0x00007ffeefbfe610) at zpool_iter.c:246 [opt]
frame #8: 0x0000000100008447 zpool`zpool_do_status(argc=0, argv=0x00007ffeefbff8b0) at zpool_main.c:6766 [opt]
frame #9: 0x0000000100005a0a zpool`main(argc=<unavailable>, argv=0x00007ffeefbff8a0) at zpool_main.c:8108 [opt]
frame #10: 0x00007fff688ff015 libdyld.dylib`start + 1
Just to be clear, I removed the "if" line at the top of path_to_devid(), leaving only the "return (NULL)" to run unconditionally now. That's what you wanted me to test, right?
I've attached the patch so far, since pasting it in last time gave me errors on trying to reapply it, presumably because phpBB is munging the whitespace somehow.