zsh-workers
 help / color / mirror / code / Atom feed
* [BUG] Long line makes pattern matching (by //) hog Zsh
@ 2016-06-05 14:36 Sebastian Gniazdowski
  2016-06-05 19:10 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastian Gniazdowski @ 2016-06-05 14:36 UTC (permalink / raw)
  To: Zsh hackers list

[-- Attachment #1: Type: text/plain, Size: 568 bytes --]

Hello,
attached is a test program that in general blocks Zsh from ending.
Github user kapsh reported "fatal error: out of heap memory" and I
investigated that it's about long lines in his data. The pattern:

([^ /\\\\]##[^0-9/\\\\ ]##[^/\\\\]#(#e))

is:
1. not backslash nor slash nor space [^ /\\\\]##
2. not number, slash, backslash, space [^0-9/\\\\ ]##
3. not slash, backslash [^/\\\\]#
4. end of line (#e)

Removing first segment makes Zsh end after a couple of seconds (but
not on zsh-5.0.8). Tested on zsh-5.0.2, 5.0.8, 5.2

Best regards,
Sebastian Gniazdowski

[-- Attachment #2: 2pat.zsh --]
[-- Type: application/octet-stream, Size: 3284 bytes --]

#!/usr/bin/env zsh

emulate -LR zsh
setopt extendedglob

typeset -a list disp_list
list=( "3226  1802 /opt/google/chrome/chrome --type=renderer --enable-lcd-text --enable-features=DownloadResumption,IncidentReportingModuleLoadAnalysis<SafeBrowsingIncidentReportingServiceFeatures,IncidentReportingSuspiciousModuleReporting<SafeBrowsingIncidentReportingServiceFeatures,LinuxObsoleteSystemIsEndOfTheLine<LinuxObsoleteSystemIsEndOfTheLine,PrintPreviewDistiller,*UsePasswordSeparatedSigninFlow<PasswordSeparatedSigninFlow,WebFontsIntervention<WebFontsIntervention,*WebRTC-EnableWebRtcEcdsa<WebRTC-EnableWebRtcEcdsa,brotli-encoding<BrotliEncoding,enable-automatic-password-saving --disable-features=RenderingPipelineThrottling<RenderingPipelineThrottling --force-fieldtrials=AppBannerTriggering/Aggressive/*AutoReloadExperiment/FlagEnabled/*AutoReloadVisibleOnlyExperiment/FlagEnabled/AutofillProfileOrderByFrecency/Enabled/*BrotliEncoding/Enabled/CaptivePortalInterstitial/Enabled/*ChildAccountDetection/Disabled/*ClientSideDetectionModel/Model0/*CrossDevicePromo/28DaySingleProfile/EnableSessionCrashedBubbleUI/EnabledByFlag/*ExtensionActionRedesign/Enabled/*ExtensionDeveloperModeWarning/Default/*GFE/Default/InstanceID/Enabled/LinuxObsoleteSystemIsEndOfTheLine/EndOfLine/MaterialDesignDownloads/Enabled/*NewProfileManagement/Command-Line-Disabled/*OmniboxBundledExperimentV1/Unused_2/*OutOfProcessPac/Default/*PageRevisitInstrumentation/Default/PasswordBranding/Disabled/*PasswordGeneration/Disabled/*PasswordManagerSettingsMigration/Disable/PasswordSeparatedSigninFlow/Default/*QUIC/FlagEnabled/*RenderingPipelineThrottling/Disabled/ReportCertificateErrors/ShowAndPossiblySend/*ResourcePriorities/Launch50pct_11011_1_1_10/SHA1IdentityUIWarning/Enabled/SHA1ToolbarUIJanuary2016/Warning/SHA1ToolbarUIJanuary2017/Error/SSLCommonNameMismatchHandling/Enabled/*SafeBrowsingIncidentReportingService/Default/SafeBrowsingIncidentReportingServiceFeatures/WithSuspiciousModuleReporting/SafeBrowsingUnverifiedDownloads/DisableByParameterMostSbTypes2/SafeBrowsingUpdateFrequency/Default/*SimpleCacheTrial/ExperimentYes2/SyncHttpContentCompression/Disabled/*UMA-Population-Restrict/normal/*UMA-Uniformity-Trial-1-Percent/group_61/*UMA-Uniformity-Trial-10-Percent/default/*UMA-Uniformity-Trial-100-Percent/group_01/*UMA-Uniformity-Trial-20-Percent/group_03/*UMA-Uniformity-Trial-5-Percent/group_04/*UMA-Uniformity-Trial-50-Percent/group_01/*UseDelayAgnosticAEC/DefaultEnabled/*WebFontsIntervention/Enabled/WebRTC-EnableWebRtcEcdsa/Default/ --primordial-pipe-token=F02F1A91C1338A95D3C111314BA6B87A --lang=en-US --enable-crash-reporter=831AB4A2-FDF7-4D2B-9BE0-F22377348434, --extension-process --enable-webrtc-hw-h264-encoding --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --show-saved-copy=secondary --blink-settings=fetchDeferLateScripts=true,fetchIncreaseFontPriority=true,fetchIncreasePriorities=true --enable-suggestions-with-substring-match -" )

_nlist_colorify_disp_list() {
    local col=$'\x1b[00;34m' reset=$'\x1b[0m'
    NLIST_COLORING_PATTERN="([^ /\\\\]##[^0-9/\\\\ ]##[^/\\\\]#(#e))"
    disp_list=( "${(@)disp_list//(#mi)$~NLIST_COLORING_PATTERN/$col${MATCH}$reset}" )
}

disp_list=( "${(@)list[1, 50]}" )
echo "Starting"
_nlist_colorify_disp_list
echo "Done"

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-06-06  0:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-05 14:36 [BUG] Long line makes pattern matching (by //) hog Zsh Sebastian Gniazdowski
2016-06-05 19:10 ` Bart Schaefer
2016-06-05 19:37   ` Peter Stephenson
2016-06-05 20:39     ` Peter Stephenson
2016-06-05 21:21       ` Sebastian Gniazdowski
2016-06-06  0:07     ` Bart Schaefer
2016-06-05 19:47   ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).