facebook / sapling

A Scalable, User-Friendly Source Control System.
https://sapling-scm.com
GNU General Public License v2.0
6.16k stars 284 forks source link

Segfault while cloning if built with Python 3.10 on macOS #279

Closed lf- closed 1 year ago

lf- commented 1 year ago

Thanks to sggutier, I've got the ability to edit Python files worked out. I'm investigating why the nixpkgs build of Sapling for macOS is broken, and I think I've found a bug.

Downstream report: https://github.com/NixOS/nixpkgs/pull/202754

When I clone a repository with the oss build of Sapling, it does a segmentation fault. I've traced it down to

https://github.com/facebook/sapling/blob/1be0635ed4072091c1c13a2e6660bd185ee889d8/eden/scm/edenscm/hg.py#L168-L171

which I've added some printf debugging to:

    for name, module in extensions.extensions(ui):
        print('doing', repr(name), repr(module))
        hook = getattr(module, "reposetup", None)
        if hook:
            hook(ui, repo)

With that context, here's it crashing in a debugger:

Running it in lldb ``` $ nix-shell -E 'with import (builtins.fetchTarball "https://github.com/nixos/nixpkgs /archive/872fceeed60ae6b7766cc0a4cd5bf5901b9098ec.tar.gz") {}; mkShell { packages = [ yarn libiconv std env openssl curl pkg-config darwin.apple_sdk.frameworks.CoreFoundation darwin.apple_sdk.frameworks.Secu rity darwin.apple_sdk.frameworks.CoreServices python3 ]; }' [nix-shell:~/dev/sapling2/eden/scm]$ make oss [nix-shell:~/dev/sapling2/eden/scm]$ rm -rf polkadots && CHGDISABLE=1 lldb -- ./sl clone https://github.com/lf-/polkadots (lldb) target create "./sl" Current executable set to '/Users/jade/dev/sapling2/eden/scm/sl' (arm64). (lldb) settings set -- target.run-args "clone" "https://github.com/lf-/polkadots" (lldb) r Process 36765 launched: '/Users/jade/dev/sapling2/eden/scm/sl' (arm64) doing 'tweakdefaults' doing 'absorb' doing 'amend' doing 'automv' doing 'blackbox' doing 'chistedit' doing 'conflictinfo' doing 'copytrace' doing 'debugnetwork' doing 'dialect' doing 'dirsync' doing 'extorder' doing 'fbhistedit' doing 'sparse' doing 'fsmonitor' watchman sockpath is set as /opt/facebook/watchman/var/run/watchman/jade-state/sock Process 36765 stopped * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, addr ess=0x2f7665642f656481) frame #0: 0x00000001039cefc8 libpython3.10.dylib`subtype_dealloc + 876 libpython3.10.dylib`subtype_dealloc: -> 0x1039cefc8 <+876>: ldr x8, [x8, #0x20] 0x1039cefcc <+880>: add x8, x24, x8 0x1039cefd0 <+884>: add x26, x8, #0x10 0x1039cefd4 <+888>: b 0x1039cefe4 ; <+904> Target 0: (sl) stopped. (lldb) bt * thread #1, name = 'main', queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, addr ess=0x2f7665642f656481) * frame #0: 0x00000001039cefc8 libpython3.10.dylib`subtype_dealloc + 876 frame #1: 0x000000010398ebc4 libpython3.10.dylib`frame_dealloc + 168 frame #2: 0x0000000103a4424c libpython3.10.dylib`_PyEval_Vector + 208 frame #3: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #4: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #5: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #6: 0x0000000103972564 libpython3.10.dylib`_PyObject_FastCallDictTstate + 312 frame #7: 0x00000001039730b0 libpython3.10.dylib`_PyObject_Call_Prepend + 148 frame #8: 0x00000001039da90c libpython3.10.dylib`slot_tp_init + 216 frame #9: 0x00000001039cfc68 libpython3.10.dylib`type_call + 352 frame #10: 0x0000000103972774 libpython3.10.dylib`_PyObject_MakeTpCall + 360 frame #11: 0x0000000103a4cbd0 libpython3.10.dylib`call_function + 524 frame #12: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #13: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #14: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #15: 0x0000000103a4a29c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24464 frame #16: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #17: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #18: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #19: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #20: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #21: 0x0000000103a4a37c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24688 frame #22: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #23: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #24: 0x00000001001da35c sl`pytracing::wrapfunc::__call__::hb328591bde70cd83 + 1088 frame #25: 0x00000001002000dc sl`std::panicking::try::h088e29f4495f689b + 124 frame #26: 0x00000001001dabc0 sl`pytracing::wrapfunc::create_instance::TYPE_OBJECT::wrap_call::h42f 6d44cc211d035 + 56 frame #27: 0x0000000103972774 libpython3.10.dylib`_PyObject_MakeTpCall + 360 frame #28: 0x0000000103a4cbd0 libpython3.10.dylib`call_function + 524 frame #29: 0x0000000103a4a37c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24688 frame #30: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #31: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #32: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #33: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #34: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #35: 0x0000000103a4a29c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24464 frame #36: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #37: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #38: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #39: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #40: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #41: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #42: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #43: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #44: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #45: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #46: 0x0000000103ad7d78 libpython3.10.dylib`partial_vectorcall + 264 frame #47: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #48: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #49: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #50: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #51: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #52: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #53: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #54: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #55: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #56: 0x0000000103ad7d78 libpython3.10.dylib`partial_vectorcall + 264 frame #57: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #58: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #59: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #60: 0x0000000103972b7c libpython3.10.dylib`PyVectorcall_Call + 160 frame #61: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #62: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #63: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #64: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #65: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #66: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #67: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #68: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #69: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #70: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #71: 0x0000000103ad7f04 libpython3.10.dylib`partial_vectorcall + 660 frame #72: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #73: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #74: 0x0000000103ad7f04 libpython3.10.dylib`partial_vectorcall + 660 frame #75: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #76: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #77: 0x0000000103ad7f04 libpython3.10.dylib`partial_vectorcall + 660 frame #78: 0x0000000103a4a58c libpython3.10.dylib`_PyEval_EvalFrameDefault + 25216 frame #79: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #80: 0x0000000103ad7d78 libpython3.10.dylib`partial_vectorcall + 264 frame #81: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #82: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #83: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #84: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #85: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #86: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #87: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #88: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #89: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #90: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #91: 0x0000000103a4a29c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24464 frame #92: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #93: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #94: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #95: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #96: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #97: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #98: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #99: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #100: 0x0000000103a4a30c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24576 frame #101: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #102: 0x0000000103a4cb70 libpython3.10.dylib`call_function + 428 frame #103: 0x0000000103a4a29c libpython3.10.dylib`_PyEval_EvalFrameDefault + 24464 frame #104: 0x0000000103a44210 libpython3.10.dylib`_PyEval_Vector + 148 frame #105: 0x00000001000365b0 sl`cpython::objects::module::PyModule::call::h90a1e055d211397c + 200 frame #106: 0x00000001000227cc sl`hgcommands::hgpython::HgPython::run_hg::h707bfb8605d4e3ea + 1032 frame #107: 0x000000010017bf94 sl`hgcommands::run::dispatch_command::h5f062792a193530b + 3552 frame #108: 0x0000000100179f7c sl`hgcommands::run::run_command::h276de7840f763b97 + 5512 frame #109: 0x000000010000733c sl`hgmain::main::h7545a2090cef6562 + 628 frame #110: 0x0000000100004738 sl`std::sys_common::backtrace::__rust_begin_short_backtrace::h1ff369 d9f3dd50c1 + 12 frame #111: 0x0000000100004818 sl`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h9b346f7b160f2 825 + 16 frame #112: 0x0000000101751c80 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] core::o ps::function::impls::_$LT$impl$u20$core..ops..function..FnOnce$LT$A$GT$$u20$for$u20$$RF$F$GT$::call_onc e::h0c60ab225fafdaa1 at function.rs:283:13 [opt] frame #113: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nicking::try::do_call::he83c34dec7ecf156 at panicking.rs:492:40 [opt] frame #114: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nicking::try::hf8a127683312d6e6 at panicking.rs:456:19 [opt] frame #115: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nic::catch_unwind::h6bfb2185c735f4ae at panic.rs:137:14 [opt] frame #116: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::rt ::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::he1235e45f833117a at rt.rs:148:48 [opt] frame #117: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nicking::try::do_call::h600fcfa83f96c092 at panicking.rs:492:40 [opt] frame #118: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nicking::try::h3ab439188ed13993 at panicking.rs:456:19 [opt] frame #119: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 [inlined] std::pa nic::catch_unwind::hb86c613836afcf80 at panic.rs:137:14 [opt] frame #120: 0x0000000101751c78 sl`std::rt::lang_start_internal::h94fa211da9d06d56 at rt.rs:148:20 [ opt] frame #121: 0x0000000100007400 sl`main + 52 frame #122: 0x0000000102edd08c dyld`start + 520 ```

Notes

System details: macOS 12.6.1 on aarch64; packages from Nix.

lf- commented 1 year ago

I've not had any luck getting terribly useful debug symbols for Python unfortunately. It seems that there's something funny going on with Nix's enableDebugging that is not giving source file names in my backtrace. Not sure what the deal is there.

lf- commented 1 year ago

Hi! I've verified that this only happens on 3.10 and does not reproduce on 3.8 so it is (probably) not a nix related bug. On one hand, heck yeah. On the other, this still needs fixing at some point.

quark-zju commented 1 year ago

Thanks for the report. This looks interesting. Could you try patching the fsmonitor logic to make it show traces so we can have some ideas about which Python statement causes the segfault?

diff --git a/eden/scm/edenscm/ext/fsmonitor/__init__.py b/eden/scm/edenscm/ext/fsmonitor/__init__.py
--- a/eden/scm/edenscm/ext/fsmonitor/__init__.py
+++ b/eden/scm/edenscm/ext/fsmonitor/__init__.py
@@ -1208,6 +1208,11 @@

 def reposetup(ui, repo):
+    from trace import Trace
+    t = Trace(count=0, trace=1)
+    t.runfunc(_reposetup, ui, repo)
+
+def _reposetup(ui, repo):
     # We don't work with largefiles or inotify
     exts = extensions.enabled()
     for ext in _incompatible_list:

You might need to delete __pycache__ and run CHGDISABLE=1 sl ... for the change to take effect.

lf- commented 1 year ago
Log spam from the trace thing ``` uiconfig.py(535): pass uiconfig.py(249): for s, n in alternates: uiconfig.py(250): candidate = self._rcfg.get(s, n) uiconfig.py(251): if candidate is not None: uiconfig.py(249): for s, n in alternates: uiconfig.py(258): return value uiconfig.py(314): if v is None: uiconfig.py(316): if v is _unset: uiconfig.py(320): if isinstance(v, bool): uiconfig.py(321): return v color.py(339): if not ui._styler: color.py(340): ui._styler = bindings.io.styler(supportedcolors(ui)) --- modulename: color, funcname: supportedcolors color.py(384): env = encoding.environ color.py(385): if "HGCOLORS" in env: --- modulename: _collections_abc, funcname: __contains__ _collections_abc.py(824): try: _collections_abc.py(825): self[key] --- modulename: os, funcname: __getitem__ os.py(676): try: os.py(677): value = self._data[self.encodekey(key)] --- modulename: os, funcname: encode os.py(756): if not isinstance(value, str): os.py(758): return value.encode(encoding, 'surrogateescape') os.py(678): except KeyError: os.py(680): raise KeyError(key) from None _collections_abc.py(826): except KeyError: _collections_abc.py(827): return False color.py(394): ticolors = 8 color.py(395): if curses: color.py(396): try: color.py(397): curses.setupterm() color.py(398): ticolors = curses.tigetnum("colors") color.py(404): if "ConEmuPID" in env: --- modulename: _collections_abc, funcname: __contains__ _collections_abc.py(824): try: _collections_abc.py(825): self[key] --- modulename: os, funcname: __getitem__ os.py(676): try: os.py(677): value = self._data[self.encodekey(key)] --- modulename: os, funcname: encode os.py(756): if not isinstance(value, str): os.py(758): return value.encode(encoding, 'surrogateescape') os.py(678): except KeyError: os.py(680): raise KeyError(key) from None _collections_abc.py(826): except KeyError: _collections_abc.py(827): return False color.py(407): if env.get("INSIDE_EMACS"): --- modulename: _collections_abc, funcname: get _collections_abc.py(818): try: _collections_abc.py(819): return self[key] --- modulename: os, funcname: __getitem__ os.py(676): try: os.py(677): value = self._data[self.encodekey(key)] --- modulename: os, funcname: encode os.py(756): if not isinstance(value, str): os.py(758): return value.encode(encoding, 'surrogateescape') os.py(678): except KeyError: os.py(680): raise KeyError(key) from None _collections_abc.py(820): except KeyError: _collections_abc.py(821): return default color.py(420): elif env.get("TERM") == "screen" and "TMUX" not in env: --- modulename: _collections_abc, funcname: get _collections_abc.py(818): try: _collections_abc.py(819): return self[key] --- modulename: os, funcname: __getitem__ os.py(676): try: os.py(677): value = self._data[self.encodekey(key)] --- modulename: os, funcname: encode os.py(756): if not isinstance(value, str): os.py(758): return value.encode(encoding, 'surrogateescape') os.py(681): return self.decodevalue(value) --- modulename: os, funcname: decode os.py(760): return value.decode(encoding, 'surrogateescape') color.py(423): elif env.get("COLORTERM") in ("truecolor", "24bit"): --- modulename: _collections_abc, funcname: get _collections_abc.py(818): try: _collections_abc.py(819): return self[key] --- modulename: os, funcname: __getitem__ os.py(676): try: os.py(677): value = self._data[self.encodekey(key)] --- modulename: os, funcname: encode os.py(756): if not isinstance(value, str): os.py(758): return value.encode(encoding, 'surrogateescape') os.py(681): return self.decodevalue(value) --- modulename: os, funcname: decode os.py(760): return value.decode(encoding, 'surrogateescape') color.py(424): realcolors = 16777216 color.py(434): return max([realcolors, ticolors]) color.py(342): style = " ".join(ui._styles.get(l, l) for l in label.split()) --- modulename: color, funcname: color.py(342): style = " ".join(ui._styles.get(l, l) for l in label.split()) --- modulename: color, funcname: color.py(342): style = " ".join(ui._styles.get(l, l) for l in label.split()) color.py(343): if usebytes: color.py(345): styled = ui._styler.renderbytes(style, msg) color.py(346): if not usebytes: color.py(347): styled = styled.decode() color.py(348): return styled ui.py(707): msgs = [self.label(m, label, usebytes=usebytes) for m in msgs] ui.py(708): return msgs ui.py(800): self._write_err(*msgs, **opts) --- modulename: ui, funcname: _write_err ui.py(803): starttime = util.timer() ui.py(804): try: ui.py(805): if not getattr(self.fout, "closed", False): --- modulename: util, funcname: __getattr__ util.py(691): return getattr(self._obj, name) ui.py(806): self.fout.flush() --- modulename: util, funcname: __getattr__ util.py(691): return getattr(self._obj, name) ui.py(809): self.ferr.write(encodeutf8("".join(msgs))) --- modulename: util, funcname: __getattr__ util.py(691): return getattr(self._obj, name) --- modulename: pycompat, funcname: encodeutf8 pycompat.py(112): return s.encode("utf-8", errors=errors) watchman sockpath is set as /opt/facebook/watchman/var/run/watchman/jade-state/sock ui.py(812): if not getattr(self.ferr, "closed", False): --- modulename: util, funcname: __getattr__ util.py(691): return getattr(self._obj, name) ui.py(813): self.ferr.flush() --- modulename: util, funcname: __getattr__ util.py(691): return getattr(self._obj, name) ui.py(819): millis = int((util.timer() - starttime) * 1000) ui.py(820): if millis >= 20: ui.py(822): self._measuredtimes["stdio_blocked"] += millis ui.py(1344): tracing.debug(msg.rstrip("\n"), depth=1) --- modulename: tracing, funcname: event tracing.py(78): if disabletracing: tracing.py(81): frame = sys._getframe(1 + depth) tracing.py(82): ident = (id(frame.f_code), frame.f_lineno) tracing.py(83): callsite = _callsites.get(ident) tracing.py(84): if callsite is None: tracing.py(87): fieldnames = ["message"] tracing.py(88): if meta: tracing.py(90): callsite = _insertcallsite( tracing.py(91): ident, tracing.py(92): _tracing.EventCallsite( tracing.py(93): obj=frame, tracing.py(94): name=name, tracing.py(95): target=target, tracing.py(96): level=level, tracing.py(97): fieldnames=fieldnames, tracing.py(92): _tracing.EventCallsite( tracing.py(90): callsite = _insertcallsite( --- modulename: tracing, funcname: _insertcallsite tracing.py(224): _callsites[key] = callsite tracing.py(225): return callsite tracing.py(101): frame = None # break cycles tracing.py(102): values = [message] tracing.py(103): if meta: tracing.py(106): callsite.event(values) __init__.py(90): if sockpath: __init__.py(91): if os.path.exists(sockpath): --- modulename: genericpath, funcname: exists genericpath.py(18): try: genericpath.py(19): os.stat(path) genericpath.py(20): except (OSError, ValueError): genericpath.py(21): return False __init__.py(94): self._transport = None __init__.py(95): if repo.ui.configbool("fsmonitor", "tcp", False): --- modulename: ui, funcname: configbool ui.py(423): return self._uiconfig.configbool(section, name, default) --- modulename: uiconfig, funcname: configbool uiconfig.py(313): v = self._config(section, name, default) --- modulename: uiconfig, funcname: _config uiconfig.py(211): value = itemdefault = default uiconfig.py(212): item = self._knownconfig.get(section, {}).get(name) --- modulename: configitems, funcname: get configitems.py(76): baseitem = super(itemregister, self).get(key) configitems.py(77): if baseitem is not None and not baseitem.generic: configitems.py(78): return baseitem uiconfig.py(213): alternates = [(section, name)] uiconfig.py(215): if item is not None: uiconfig.py(216): alternates.extend(item.alias) uiconfig.py(217): if callable(item.default): uiconfig.py(220): itemdefault = item.default uiconfig.py(227): if default is _unset: uiconfig.py(238): item is not None uiconfig.py(239): and item.default is not configitems.dynamicdefault uiconfig.py(240): and default != itemdefault uiconfig.py(249): for s, n in alternates: uiconfig.py(250): candidate = self._rcfg.get(s, n) uiconfig.py(251): if candidate is not None: uiconfig.py(249): for s, n in alternates: uiconfig.py(258): return value uiconfig.py(314): if v is None: uiconfig.py(316): if v is _unset: uiconfig.py(320): if isinstance(v, bool): uiconfig.py(321): return v __init__.py(97): self._tcp_host = repo.ui.config("fsmonitor", "tcp-host", "::1") --- modulename: ui, funcname: config ui.py(386): return self._uiconfig.config(section, name, default) --- modulename: uiconfig, funcname: config uiconfig.py(205): value = self._config(section, name, default=default) --- modulename: uiconfig, funcname: _config uiconfig.py(211): value = itemdefault = default uiconfig.py(212): item = self._knownconfig.get(section, {}).get(name) --- modulename: configitems, funcname: get configitems.py(76): baseitem = super(itemregister, self).get(key) configitems.py(77): if baseitem is not None and not baseitem.generic: configitems.py(78): return baseitem uiconfig.py(213): alternates = [(section, name)] uiconfig.py(215): if item is not None: uiconfig.py(216): alternates.extend(item.alias) uiconfig.py(217): if callable(item.default): uiconfig.py(220): itemdefault = item.default uiconfig.py(227): if default is _unset: uiconfig.py(238): item is not None uiconfig.py(239): and item.default is not configitems.dynamicdefault uiconfig.py(240): and default != itemdefault uiconfig.py(249): for s, n in alternates: uiconfig.py(250): candidate = self._rcfg.get(s, n) uiconfig.py(251): if candidate is not None: uiconfig.py(249): for s, n in alternates: uiconfig.py(258): return value uiconfig.py(206): if value is _unset: uiconfig.py(208): return value __init__.py(98): self._tcp_port = repo.ui.configint("fsmonitor", "tcp-port", 12300) --- modulename: ui, funcname: configint ui.py(464): return self._uiconfig.configint(section, name, default) --- modulename: uiconfig, funcname: configint uiconfig.py(380): return self.configwith(int, section, name, default, "integer") --- modulename: uiconfig, funcname: configwith uiconfig.py(350): v = self.config(section, name, default) --- modulename: uiconfig, funcname: config uiconfig.py(205): value = self._config(section, name, default=default) --- modulename: uiconfig, funcname: _config uiconfig.py(211): value = itemdefault = default uiconfig.py(212): item = self._knownconfig.get(section, {}).get(name) --- modulename: configitems, funcname: get configitems.py(76): baseitem = super(itemregister, self).get(key) configitems.py(77): if baseitem is not None and not baseitem.generic: configitems.py(78): return baseitem uiconfig.py(213): alternates = [(section, name)] uiconfig.py(215): if item is not None: uiconfig.py(216): alternates.extend(item.alias) uiconfig.py(217): if callable(item.default): uiconfig.py(220): itemdefault = item.default uiconfig.py(227): if default is _unset: uiconfig.py(238): item is not None uiconfig.py(239): and item.default is not configitems.dynamicdefault uiconfig.py(240): and default != itemdefault uiconfig.py(249): for s, n in alternates: uiconfig.py(250): candidate = self._rcfg.get(s, n) uiconfig.py(251): if candidate is not None: uiconfig.py(249): for s, n in alternates: uiconfig.py(258): return value uiconfig.py(206): if value is _unset: uiconfig.py(208): return value uiconfig.py(351): if v is None: uiconfig.py(353): try: uiconfig.py(354): return convert(v) __init__.py(99): self._timeout = timeout __init__.py(100): self._watchmanclient = None __init__.py(101): self._root = repo.root __init__.py(102): self._resolved_root = getcanonicalpath(self._root) --- modulename: __init__, funcname: getcanonicalpath __init__.py(524): fd = os.open(name, os.O_RDONLY, 0) __init__.py(525): try: __init__.py(526): numchars = 1024 # MAXPATHLEN __init__.py(529): buf = ctypes.create_string_buffer(numchars) --- modulename: __init__, funcname: create_string_buffer __init__.py(53): if isinstance(init, bytes): __init__.py(61): elif isinstance(init, int): __init__.py(62): _sys.audit("ctypes.create_string_buffer", None, init) __init__.py(63): buftype = c_char * init __init__.py(64): buf = buftype() __init__.py(65): return buf __init__.py(530): ctypes.set_errno(0) __init__.py(531): result = getpathfcntl(fd, F_GETPATH, buf) Segmentation fault: 11 ```

Here's the tail of it :)

quark-zju commented 1 year ago

Thanks for the information. We noticed the fcntl can also fail with an unexpected errno 14 on ARM arch, which is likely the cause for #184.

I drafted a fix and it might take a while to get it merged and released.