Maybe my inexperienced point of view will help? Typical pscan, next values are: ====== BEGIN ====== exp: zplugin�saved�visual�line�mode pscan: 0x7fd9b425d820, next: 0xffffffe700000000 AFTER pscan: 0x7fd9b425d820, next: 0x7fd9b425d850 pscan: 0x7fd9b425d850, next: 0x7fd9b425d850 AFTER pscan: 0x7fd9b425d850, next: 0x0 When core is triggered, this looks like: ====== BEGIN ====== exp: ��m�AglogBA0A/Diff/A/Users/sgniazdowski/github/zsh-navigation-tools.gitA0a87c8044c1c6677a38ccdabd36334cc2aaab496BF"znt-tmux.zsh  � initial commit of skylite21 submission"Y pscan: 0x7f9bb3d075e0, next: 0x10886db73 AFTER pscan: 0x7f9bb3d075e0, next: 0x7f9bb3d07698 pscan: 0x7f9bb3d07698, next: 0x7f9bb3d07698 AFTER pscan: 0x7f9bb3d07698, next: 0xff9bb3d07698 pscan: 0xff9bb3d07698, next: 0xff9bb3d07698 Cannot print last "next" from debugger, inaccessible memory. What can be seen here? First next value seems to be weird in both cases. Either 0xffffff at the beginning, or low value 0x10886db73 (low when compared to pscan's value). Then, AFTER message shows the weird value is fixed. First log says there should be 0x0 after successful processing. In second log it is seen that instead of 0x0 another weird value is assigned to "next" – it starts with 0xff. I did many runs and it was always that the odd value appeared before core. I also did step by step walk through patcompile(). Unluckily it wasn't a core-triggering dump (next ended with 0x0). I attach screenshots with some crucial places. dbg_metacharinc_detecting_meta.gif dbg_metacharinc_finishing.gif Traversing the string METACHARINC() is called. It rather correctly detects special characters and skips them, as shown. dbg_patadd_1_length.gif dbg_patadd_2_string.gif Pattern is being added, it's length is visible, number of meta characters, also P_LS_STR result. dbg_patadd_nmeta.gif An action is taken, metas counted again. dbg_patcompiece_detecting_meta.gif patcomppiece() correctly detects meta characters dbg_patoptail_value_unavailable_1.gif dbg_patoptail_value_unavailable_2.gif Detected some incorrect pointers, however I might misunderstand what ptr is. Best regards, Sebastian Gniazdowski