fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

100% CPU load #78

Closed dschneller closed 13 years ago

dschneller commented 13 years ago

Using marked.app (but also mmd2xhtml.app) I have repeatedly seen multimarkdown processes hogging the CPU with 100%. I usually notice this, because the fans in the machine start to make noise. Often I then find multiple processes in Activity Monitor, each with 99-100% CPU load.

A sample of one of these processes with Activity Monitor shows this:

Sampling process 5363 for 3 seconds with 1 millisecond of run time between samples Sampling completed, processing symbols... Analysis of sampling multimarkdown (pid 5363) every 1 millisecond Process: multimarkdown [5363] Path: /usr/local/bin/multimarkdown Load Address: 0x100000000 Identifier: multimarkdown Version: ??? (???) Code Type: X86-64 (Native) Parent Process: ??? [1]

Date/Time: 2011-07-25 17:00:11.945 +0200 OS Version: Mac OS X 10.7 (11A511) Report Version: 7

Call graph: 1665 Thread_711529 DispatchQueue_1: com.apple.main-thread (serial) 1665 start (in multimarkdown) + 52 [0x100000a04] 1665 main (in multimarkdown) + 1650 [0x10003c982] 1665 markdown_to_string (in multimarkdown) + 14 [0x10003c2be] 1665 markdown_to_g_string (in multimarkdown) + 145 [0x10003c201] 1665 parse_markdown_with_metadata (in multimarkdown) + 65 [0x1000010f1] 1665 yyparsefrom (in multimarkdown) + 74 [0x100000e9a] 1665 yy_DocWithMetaData (in multimarkdown) + 1148 [0x1000311ec] 1665 yy_MetaData (in multimarkdown) + 278 [0x10001e436] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] ... 1665 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103] 1393 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]

... (and 12MB more of this)

Total number in stack (recursive counted multiple, when >=5): 7274 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 7154 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103] 765 yy_MetaDataKeyValue (in multimarkdown) + 1608 [0x10001e168] 739 yy_RawLine (in multimarkdown) + 0 [0x10001c820] 390 yymatchChar (in multimarkdown) + 0 [0x100002670] 216 yy_MetaDataKeyValue (in multimarkdown) + 61 [0x10001db5d] 171 yy_MetaDataKeyValue (in multimarkdown) + 0 [0x10001db20] 139 yy_MetaDataKeyValue (in multimarkdown) + 1559 [0x10001e137] 127 yy_MetaDataKey (in multimarkdown) + 48 [0x10001c060] 107 memmove$VARIANT$sse42 (in libsystem_c.dylib) + 0 [0x7fff90cf8cbd] 107 yyText (in multimarkdown) + 117 [0x100000dc5] 97 yyDo (in multimarkdown) + 0 [0x100000cb0] 94 yy_MetaDataKeyValue (in multimarkdown) + 1431 [0x10001e0b7] 69 yyText (in multimarkdown) + 0 [0x100000d50] 68 yy_MetaDataKey (in multimarkdown) + 0 [0x10001c030] 51 yy_MetaDataKeyValue (in multimarkdown) + 644 [0x10001dda4] 44 yy_MetaDataKeyValue (in multimarkdown) + 612 [0x10001dd84] 37 yy_MetaDataKeyValue (in multimarkdown) + 1636 [0x10001e184] 37 yy_MetaDataKeyValue (in multimarkdown) + 54 [0x10001db56] 29 yy_MetaDataKeyValue (in multimarkdown) + 1344 [0x10001e060] 24 yy_RawLine (in multimarkdown) + 990 [0x10001cbfe] 18 yy_Newline (in multimarkdown) + 0 [0x10001cdb0] 17 yy_RawLine (in multimarkdown) + 42 [0x10001c84a] 16 yy_MetaDataKeyValue (in multimarkdown) + 1480 [0x10001e0e8] 16 yy_MetaDataKeyValue (in multimarkdown) + 1586 [0x10001e152] 14 yy_RawLine (in multimarkdown) + 652 [0x10001caac] 10 yy_MetaDataKeyValue (in multimarkdown) + 1458 [0x10001e0d2] 9 yy_MetaDataKey (in multimarkdown) + 1388 [0x10001c59c] 6 DYLD-STUB$$memcpy (in multimarkdown) + 0 [0x10003cada] 6 yy_MetaDataKeyValue (in multimarkdown) + 1095 [0x10001df67] 5 yy_MetaDataKey (in multimarkdown) + 333 [0x10001c17d]

Sort by top of stack, same collapsed (when >= 5): yy_RawLine (in multimarkdown) 739 yymatchChar (in multimarkdown) 390 yy_MetaDataKeyValue (in multimarkdown) 171 memmove$VARIANT$sse42 (in libsystem_c.dylib) 107 yyDo (in multimarkdown) 97 yyText (in multimarkdown) 69 yy_MetaDataKey (in multimarkdown) 68 yy_Newline (in multimarkdown) 18 DYLD-STUB$$memcpy (in multimarkdown) 6

Binary Images: 0x100000000 - 0x100046ff7 +multimarkdown (??? - ???) /usr/local/bin/multimarkdown 0x10004d000 - 0x100130ff7 +libglib-2.0.0.dylib (2401.2.0 - compatibility 2401.0.0) <4C001EC3-B8B4-82F4-91BE-7CDE33086560> /usr/local/lib/libglib-2.0.0.dylib 0x10014e000 - 0x100156fe7 +libintl.8.dylib (9.2.0 - compatibility 9.0.0) <70F82C22-9FF1-0643-750B-DD9DBCEBC0B7> /usr/local/lib/libintl.8.dylib 0x7fff6a749000 - 0x7fff6a77dac7 dyld (195.5 - ???) <4A6E2B28-C7A2-3528-ADB7-4076B9836041> /usr/lib/dyld 0x7fff84ef9000 - 0x7fff84efdff7 com.apple.CommonPanels (1.2.5 - 94) <0BB2C436-C9D5-380B-86B5-E355A7711259> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels 0x7fff84efe000 - 0x7fff84f04fff com.apple.DiskArbitration (2.4 - 2.4) <5185FEA6-92CA-3CAA-8442-BD71DBC64AFD> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration 0x7fff84f05000 - 0x7fff84f06ff7 libsystem_blocks.dylib (53.0.0 - compatibility 1.0.0) <8BCA214A-8992-34B2-A8B9-B74DEACA1869> /usr/lib/system/libsystem_blocks.dylib 0x7fff84f07000 - 0x7fff84f15fff libdispatch.dylib (187.5.0 - compatibility 1.0.0) <698F8EFB-7075-3111-94E3-891156C88172> /usr/lib/system/libdispatch.dylib 0x7fff84f8f000 - 0x7fff84f9dfff com.apple.NetAuth (1.0 - 3.0) /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth 0x7fff84f9e000 - 0x7fff84fc9ff7 libxslt.1.dylib (3.24.0 - compatibility 3.0.0) <8051A3FC-7385-3EA9-9634-78FC616C3E94> /usr/lib/libxslt.1.dylib 0x7fff85173000 - 0x7fff85173fff com.apple.CoreServices (53 - 53) <5946A0A6-393D-3087-86A0-4FFF6A305CC0> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices 0x7fff8517f000 - 0x7fff85184fff libpam.2.dylib (3.0.0 - compatibility 3.0.0) /usr/lib/libpam.2.dylib 0x7fff855b0000 - 0x7fff856b5ff7 libFontParser.dylib (??? - ???) <22AADE96-E54D-3918-9DFA-1967F8B21E54> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib 0x7fff856b6000 - 0x7fff856bafff libdyld.dylib (195.5.0 - compatibility 1.0.0) /usr/lib/system/libdyld.dylib 0x7fff856c9000 - 0x7fff856cefff com.apple.OpenDirectory (10.7 - 144) /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory 0x7fff856cf000 - 0x7fff85739fff com.apple.framework.IOKit (2.0 - ???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x7fff857c8000 - 0x7fff857cdff7 libsystem_network.dylib (??? - ???) <4ABCEEF3-A3F9-3E06-9682-CE00F17138B7> /usr/lib/system/libsystem_network.dylib 0x7fff857ce000 - 0x7fff858acff7 com.apple.ImageIO.framework (3.1.0 - 3.1.0) <70228E69-063C-32FF-BBE7-FCCD9C5C0864> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO 0x7fff85f00000 - 0x7fff85f12ff7 libz.1.dylib (1.2.5 - compatibility 1.0.0) <30CBEF15-4978-3DED-8629-7109880A19D4> /usr/lib/libz.1.dylib 0x7fff85f50000 - 0x7fff85f57ff7 com.apple.CommerceCore (1.0 - 17) /System/Library/PrivateFrameworks/CommerceKit.framework/Versions/A/Frameworks/CommerceCore.framework/Versions/A/CommerceCore 0x7fff85f58000 - 0x7fff86271fff com.apple.CoreServices.CarbonCore (960.13 - 960.13) <398ABDD7-BB95-3C05-96D2-B54243FC4745> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore 0x7fff86274000 - 0x7fff86293fff libresolv.9.dylib (46.0.0 - compatibility 1.0.0) <33263568-E6F3-359C-A4FA-66AD1300F7D4> /usr/lib/libresolv.9.dylib 0x7fff86373000 - 0x7fff86373fff com.apple.Accelerate.vecLib (3.7 - vecLib 3.7) <4CC14F7C-BCA7-3CAC-BEC9-B06576E5A15B> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib 0x7fff86374000 - 0x7fff863cbfff libTIFF.dylib (??? - ???) <9E32B490-4C5B-3D96-AF27-9C085C606403> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib 0x7fff86517000 - 0x7fff8651cfff libcompiler_rt.dylib (6.0.0 - compatibility 1.0.0) <98ECD5F6-E85C-32A5-98CD-8911230CB66A> /usr/lib/system/libcompiler_rt.dylib 0x7fff865bc000 - 0x7fff865fbff7 libGLImage.dylib (??? - ???) <29F82AD9-45F0-3AC5-A4A4-B767EC555D82> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib 0x7fff86625000 - 0x7fff8662dfff libsystem_dnssd.dylib (??? - ???) <7749128E-D0C5-3832-861C-BC9913F774FA> /usr/lib/system/libsystem_dnssd.dylib 0x7fff8662e000 - 0x7fff86631ff7 com.apple.securityhi (4.0 - 1) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI 0x7fff866db000 - 0x7fff866dcff7 libremovefile.dylib (21.0.0 - compatibility 1.0.0) /usr/lib/system/libremovefile.dylib 0x7fff866dd000 - 0x7fff86737fff com.apple.HIServices (1.9 - ???) <8791E8AA-C034-330D-B2BA-5141154C21CD> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices 0x7fff86e74000 - 0x7fff86e86ff7 libbsm.0.dylib (??? - ???) <349BB16F-75FA-363F-8D98-7A9C3FA90A0D> /usr/lib/libbsm.0.dylib 0x7fff87f23000 - 0x7fff883caff7 FaceCoreLight (1.4.2 - compatibility 1.0.0) <6F89E9A9-DEB6-32B5-8B50-3B97F5DB597D> /System/Library/PrivateFrameworks/FaceCoreLight.framework/Versions/A/FaceCoreLight 0x7fff88405000 - 0x7fff8846cff7 com.apple.audio.CoreAudio (4.0.0 - 4.0.0) <0B715012-C8E8-386D-9C6C-90F72AE62A2F> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio 0x7fff8846d000 - 0x7fff884e8ff7 com.apple.print.framework.PrintCore (7.0 - 366) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore 0x7fff884e9000 - 0x7fff884ffff7 com.apple.ImageCapture (7.0 - 7.0) <69E6E2E1-777E-332E-8BCF-4F0611517DD0> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture 0x7fff88500000 - 0x7fff88552ff7 libGLU.dylib (??? - ???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib 0x7fff88553000 - 0x7fff88592ff7 libcups.2.dylib (2.9.0 - compatibility 2.0.0) /usr/lib/libcups.2.dylib 0x7fff88593000 - 0x7fff88594fff libunc.dylib (24.0.0 - compatibility 1.0.0) /usr/lib/system/libunc.dylib 0x7fff88595000 - 0x7fff88c639df com.apple.CoreGraphics (1.600.0 - ???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics 0x7fff88c64000 - 0x7fff88c7bfff com.apple.CFOpenDirectory (10.7 - 144) <9709423E-8484-3B26-AAE8-EF58D1B8FB3F> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory 0x7fff88cc1000 - 0x7fff88e60fff com.apple.QuartzCore (1.7 - 269.0) /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore 0x7fff88e66000 - 0x7fff8913dfff com.apple.security (7.0 - 55010) <2418B583-D3BD-3BC5-8B07-8289C8A5B43B> /System/Library/Frameworks/Security.framework/Versions/A/Security 0x7fff89168000 - 0x7fff8916ffff com.apple.NetFS (4.0 - 4.0) /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS 0x7fff89269000 - 0x7fff8926afff libsystem_sandbox.dylib (??? - ???) <8D14139B-B671-35F4-9E5A-023B4C523C38> /usr/lib/system/libsystem_sandbox.dylib 0x7fff8926b000 - 0x7fff89276ff7 libc++abi.dylib (14.0.0 - compatibility 1.0.0) <8FF3D766-D678-36F6-84AC-423C878E6D14> /usr/lib/libc++abi.dylib 0x7fff894b9000 - 0x7fff894bafff libdnsinfo.dylib (395.6.0 - compatibility 1.0.0) <718A135F-6349-354A-85D5-430B128EFD57> /usr/lib/system/libdnsinfo.dylib 0x7fff894bb000 - 0x7fff8950efff libFontRegistry.dylib (??? - ???) <8FE14D77-1286-3619-A02E-0AC1A622596E> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib 0x7fff895e7000 - 0x7fff895f2fff com.apple.CommonAuth (2.1 - 2.0) <49949286-61FB-3A7F-BF49-0EBA45E2664E> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth 0x7fff897e5000 - 0x7fff897e9fff libmathCommon.A.dylib (2026.0.0 - compatibility 1.0.0) /usr/lib/system/libmathCommon.A.dylib 0x7fff8981c000 - 0x7fff8985bfff com.apple.AE (527.6 - 527.6) <6F8DF9EF-3250-3B7F-8841-FCAD8E323954> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE 0x7fff89864000 - 0x7fff899bdff7 com.apple.audio.toolbox.AudioToolbox (1.7 - 1.7) <296F10D0-A871-39C1-B8B2-9200AB12B5AF> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox 0x7fff89a1b000 - 0x7fff89d2dfff com.apple.Foundation (6.7 - 833.1) <618D7923-3519-3C53-9CBD-CF3C7130CB32> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation 0x7fff89d5a000 - 0x7fff89d5ffff libcache.dylib (47.0.0 - compatibility 1.0.0) /usr/lib/system/libcache.dylib 0x7fff89dc0000 - 0x7fff89dd6fff libGL.dylib (??? - ???) <22064411-0A62-373C-828B-0AA2BA2A8D34> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib 0x7fff89de4000 - 0x7fff89dfbfff com.apple.MultitouchSupport.framework (220.62 - 220.62) <7EF58A7E-CB97-335F-A025-4A0F00AEF896> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport 0x7fff89dfc000 - 0x7fff89e29fe7 libSystem.B.dylib (159.0.0 - compatibility 1.0.0) <7B4D685D-939C-3ABE-8780-77A1889E0DE9> /usr/lib/libSystem.B.dylib 0x7fff8a3f8000 - 0x7fff8a406ff7 libkxld.dylib (??? - ???) <65BE345D-6618-3D1A-9E2B-255E629646AA> /usr/lib/system/libkxld.dylib 0x7fff8a407000 - 0x7fff8a448fff com.apple.QD (3.12 - ???) <4F3C5629-97C7-3E55-AF3C-ACC524929DA2> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD 0x7fff8a449000 - 0x7fff8a55efff com.apple.DesktopServices (1.6.0 - 1.6.0) <208D40FC-8BBE-330F-B999-18771BEA6895> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv 0x7fff8a5a0000 - 0x7fff8a5a6fff libGFXShared.dylib (??? - ???) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib 0x7fff8a5a7000 - 0x7fff8a6a9ff7 libxml2.2.dylib (10.3.0 - compatibility 10.0.0) /usr/lib/libxml2.2.dylib 0x7fff8a6af000 - 0x7fff8a745ff7 libvMisc.dylib (325.3.0 - compatibility 1.0.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib 0x7fff8a746000 - 0x7fff8a76eff7 com.apple.CoreVideo (1.7 - 70.0) <59D5B407-CCB6-3406-8C55-C1B0168D7DC2> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo 0x7fff8a772000 - 0x7fff8a774ff7 com.apple.print.framework.Print (7.0 - 247) <579D7E49-A7F4-3C41-9434-3114B8A9B96C> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print 0x7fff8adf1000 - 0x7fff8ae45ff7 com.apple.ScalableUserInterface (1.0 - 1) <1873D7BE-2272-31A1-8F85-F70C4D706B3B> /System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/ScalableUserInterface.framework/Versions/A/ScalableUserInterface 0x7fff8ae46000 - 0x7fff8ae4bfff libGIF.dylib (??? - ???) <21851808-BFD2-3141-8354-A419479726BF> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib 0x7fff8ae4c000 - 0x7fff8ae53fff libcopyfile.dylib (85.1.0 - compatibility 1.0.0) <172B1985-F24A-34E9-8D8B-A2403C9A0399> /usr/lib/system/libcopyfile.dylib 0x7fff8ae9b000 - 0x7fff8b47ffaf libBLAS.dylib (??? - ???) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib 0x7fff8b480000 - 0x7fff8b482fff com.apple.TrustEvaluationAgent (2.0 - 1) <80AFB5D8-5CC4-3A38-83B9-A7DF5820031A> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent 0x7fff8b4b1000 - 0x7fff8b578ff7 com.apple.ColorSync (4.7.0 - 4.7.0) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync 0x7fff8b579000 - 0x7fff8b5fdff7 com.apple.ApplicationServices.ATS (5.0 - ???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS 0x7fff8b7ce000 - 0x7fff8b9a1ff7 com.apple.CoreFoundation (6.7 - 635) <57446B22-0778-3E07-9690-96AC705D57E8> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x7fff8b9ef000 - 0x7fff8b9faff7 com.apple.speech.recognition.framework (4.0.19 - 4.0.19) <7ADAAF5B-1D78-32F2-9FFF-D2E3FBB41C2B> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition 0x7fff8bd50000 - 0x7fff8bd50fff com.apple.vecLib (3.7 - vecLib 3.7) <29927F20-262F-379C-9108-68A6C69A03D0> /System/Library/Frameworks/vecLib.framework/Versions/A/vecLib 0x7fff8bd51000 - 0x7fff8bd75ff7 com.apple.Kerberos (1.0 - 1) <2FF2569B-F59A-371E-AF33-66297F512CB3> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos 0x7fff8c201000 - 0x7fff8c20afff libnotify.dylib (80.0.0 - compatibility 1.0.0) /usr/lib/system/libnotify.dylib 0x7fff8c20b000 - 0x7fff8c238ff7 com.apple.opencl (1.50.62 - 1.50.62) <616ADE61-11D1-3816-A255-3F0F80F2EAC8> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL 0x7fff8c239000 - 0x7fff8c255ff7 com.apple.GenerationalStorage (1.0 - 124) /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage 0x7fff8c25c000 - 0x7fff8c3bffff com.apple.CFNetwork (520.0.13 - 520.0.13) <67E3BB43-2A22-3F5A-964E-391375B24CE0> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CFNetwork.framework/Versions/A/CFNetwork 0x7fff8c3d0000 - 0x7fff8c7fdfff libLAPACK.dylib (??? - ???) <4F2E1055-2207-340B-BB45-E4F16171EE0D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib 0x7fff8c82e000 - 0x7fff8c8c8ff7 com.apple.SearchKit (1.4.0 - 1.4.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit 0x7fff8c8c9000 - 0x7fff8c939fff com.apple.datadetectorscore (3.0 - 179.3) /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore 0x7fff8c949000 - 0x7fff8ca56fff libJP2.dylib (??? - ???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib 0x7fff8cb1a000 - 0x7fff8cb9fff7 com.apple.Heimdal (2.1 - 2.0) /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal 0x7fff8cba0000 - 0x7fff8cc95fff libiconv.2.dylib (7.0.0 - compatibility 7.0.0) <5C40E880-0706-378F-B864-3C2BD922D926> /usr/lib/libiconv.2.dylib 0x7fff8cd83000 - 0x7fff8cdcefff com.apple.SystemConfiguration (1.11 - 1.11) <0B02FEC4-C36E-32CB-8004-2214B6793AE8> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration 0x7fff8cfdd000 - 0x7fff8d0e9fef libcrypto.0.9.8.dylib (0.9.8 - compatibility 0.9.8) <3AD29F8D-E3BC-3F49-A438-2C8AAB71DC99> /usr/lib/libcrypto.0.9.8.dylib 0x7fff8d0ea000 - 0x7fff8d12cff7 libcommonCrypto.dylib (55010.0.0 - compatibility 1.0.0) /usr/lib/system/libcommonCrypto.dylib 0x7fff8d12d000 - 0x7fff8d12dfff com.apple.Carbon (153 - 153) <895C2BF2-1666-3A59-A669-311B1F4F368B> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon 0x7fff8d12e000 - 0x7fff8d15dfff com.apple.DictionaryServices (1.2 - 158) <2CE51CD1-EE3D-3618-9507-E39A09C9BB8D> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices 0x7fff8d15e000 - 0x7fff8d187fff libJPEG.dylib (??? - ???) <3DBFEB41-4BF2-3502-872A-BB3738EE61B0> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib 0x7fff8d188000 - 0x7fff8d2c1fef com.apple.vImage (5.0 - 5.0) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage 0x7fff8df7e000 - 0x7fff8df9bfff libPng.dylib (??? - ???) <75DA9F95-C2A1-3534-9F8B-14CFFDE2A290> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib 0x7fff8dfcd000 - 0x7fff8dfe1ff7 com.apple.LangAnalysis (1.7.0 - 1.7.0) <04C31EF0-912A-3004-A08F-CEC27030E0B2> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis 0x7fff8dfe2000 - 0x7fff8e081fff com.apple.LaunchServices (480.19 - 480.19) <41ED4C8B-C74B-34EA-A9BF-34DBA5F52307> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices 0x7fff8e91a000 - 0x7fff8e937ff7 com.apple.openscripting (1.3.3 - ???) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting 0x7fff8e938000 - 0x7fff8e986ff7 libauto.dylib (??? - ???) /usr/lib/libauto.dylib 0x7fff8e987000 - 0x7fff8e991ff7 liblaunch.dylib (392.18.0 - compatibility 1.0.0) <39EF04F2-7F0C-3435-B785-BF283727FFBD> /usr/lib/system/liblaunch.dylib 0x7fff8ea95000 - 0x7fff8ead1fff libsystem_info.dylib (??? - ???) /usr/lib/system/libsystem_info.dylib 0x7fff8ec43000 - 0x7fff8ec52fff com.apple.opengl (1.7.4 - 1.7.4) <38AF4430-7E81-3C98-9330-21DCDA90507E> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL 0x7fff8ed49000 - 0x7fff8edbcfff libstdc++.6.dylib (52.0.0 - compatibility 7.0.0) <6BDD43E4-A4B1-379E-9ED5-8C713653DFF2> /usr/lib/libstdc++.6.dylib 0x7fff8f2c2000 - 0x7fff8f337ff7 libc++.1.dylib (19.0.0 - compatibility 1.0.0) /usr/lib/libc++.1.dylib 0x7fff8f338000 - 0x7fff8f33efff libmacho.dylib (800.0.0 - compatibility 1.0.0) /usr/lib/system/libmacho.dylib 0x7fff8f33f000 - 0x7fff8f3e1ff7 com.apple.securityfoundation (5.0 - 55005) <0D59908C-A61B-389E-AF37-741ACBBA6A94> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation 0x7fff8fc8c000 - 0x7fff8fc92ff7 libunwind.dylib (30.0.0 - compatibility 1.0.0) <1E9C6C8C-CBE8-3F4B-A5B5-E03E3AB53231> /usr/lib/system/libunwind.dylib 0x7fff8fce5000 - 0x7fff8fd67fff com.apple.Metadata (10.7.0 - 627.9) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata 0x7fff8fd68000 - 0x7fff8fd68fff libkeymgr.dylib (23.0.0 - compatibility 1.0.0) <61EFED6A-A407-301E-B454-CD18314F0075> /usr/lib/system/libkeymgr.dylib 0x7fff90023000 - 0x7fff90029fff IOSurface (??? - ???) <06FA3FDD-E6D5-391F-B60D-E98B169DAB1B> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface 0x7fff90037000 - 0x7fff9004aff7 libCRFSuite.dylib (??? - ???) <034D4DAA-63F0-35E4-BCEF-338DD7A453DD> /usr/lib/libCRFSuite.dylib 0x7fff90163000 - 0x7fff90183fff libsystem_kernel.dylib (1699.22.73 - compatibility 1.0.0) <69F2F501-72D8-3B3B-8357-F4418B3E1348> /usr/lib/system/libsystem_kernel.dylib 0x7fff90184000 - 0x7fff901a1ff7 libxpc.dylib (77.16.0 - compatibility 1.0.0) <0A4B4775-29A9-30D6-956B-3BE1DBF98090> /usr/lib/system/libxpc.dylib 0x7fff901d1000 - 0x7fff901d1fff com.apple.Accelerate (1.7 - Accelerate 1.7) <3E4582EB-CFEF-34EA-9DA8-8421F1C3C77D> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate 0x7fff901d2000 - 0x7fff901d4fff libCVMSPluginSupport.dylib (??? - ???) <2D21E6BE-CB20-3F76-8DCC-1CB0660A8A5B> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib 0x7fff901d5000 - 0x7fff902d8fff libsqlite3.dylib (9.6.0 - compatibility 9.0.0) /usr/lib/libsqlite3.dylib 0x7fff902d9000 - 0x7fff9054afff com.apple.CoreImage (7.77 - 1.0.1) /System/Library/Frameworks/QuartzCore.framework/Versions/A/Frameworks/CoreImage.framework/Versions/A/CoreImage 0x7fff9055e000 - 0x7fff90573fff com.apple.speech.synthesis.framework (4.0.74 - 4.0.74) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis 0x7fff90574000 - 0x7fff90577fff libCoreVMClient.dylib (??? - ???) <9E9F7B24-567C-3102-909C-219CF2B191FD> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib 0x7fff907ff000 - 0x7fff908b1fff com.apple.CoreText (4.0.0 - ???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/CoreText.framework/Versions/A/CoreText 0x7fff908ed000 - 0x7fff90991fef com.apple.ink.framework (1.3.2 - 110) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink 0x7fff90a5b000 - 0x7fff90abbfff libvDSP.dylib (325.3.0 - compatibility 1.0.0) <74B62E70-4189-3022-8FC9-1182EA7C6E34> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib 0x7fff90ace000 - 0x7fff90cd0fff libicucore.A.dylib (46.1.0 - compatibility 1.0.0) <82DCB94B-3819-3CC3-BC16-2AACA7F64F8A> /usr/lib/libicucore.A.dylib 0x7fff90cd1000 - 0x7fff90daefef libsystem_c.dylib (763.11.0 - compatibility 1.0.0) <1D61CA57-3C6D-30F7-89CB-CC6F0787B1DC> /usr/lib/system/libsystem_c.dylib 0x7fff90daf000 - 0x7fff90db2fff com.apple.help (1.3.2 - 42) /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help 0x7fff90db3000 - 0x7fff910d6fff com.apple.HIToolbox (1.7 - ???) <10FA3432-6638-39D9-8681-9E95298D239E> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox 0x7fff910de000 - 0x7fff91111fff com.apple.GSS (2.1 - 2.0) /System/Library/Frameworks/GSS.framework/Versions/A/GSS 0x7fff9113c000 - 0x7fff9113efff libquarantine.dylib (36.0.0 - compatibility 1.0.0) <4C3BFBC7-E592-3939-B376-1C2E2D7C5389> /usr/lib/system/libquarantine.dylib 0x7fff9113f000 - 0x7fff911a1ff7 com.apple.coreui (0.3 - 162) /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI 0x7fff911a2000 - 0x7fff911a3fff liblangid.dylib (??? - ???) /usr/lib/liblangid.dylib 0x7fff913a6000 - 0x7fff9148adef libobjc.A.dylib (228.0.0 - compatibility 1.0.0) /usr/lib/libobjc.A.dylib 0x7fff9148b000 - 0x7fff9148cfff libDiagnosticMessagesClient.dylib (??? - ???) <3DCF577B-F126-302B-BCE2-4DB9A95B8598> /usr/lib/libDiagnosticMessagesClient.dylib 0x7fff9148d000 - 0x7fff91490fff libRadiance.dylib (??? - ???) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib 0x7fff914bd000 - 0x7fff914bdfff com.apple.ApplicationServices (41 - 41) <03F3FA8F-8D2A-3AB6-A8E3-40B001116339> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices 0x7fff914be000 - 0x7fff914e4ff7 com.apple.framework.familycontrols (3.0 - 300) <72FEA71A-5865-3875-97E9-3C8C96B7F7FA> /System/Library/PrivateFrameworks/FamilyControls.framework/Versions/A/FamilyControls 0x7fff91568000 - 0x7fff91648fff com.apple.CoreServices.OSServices (478.25 - 478.25) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices Sample analysis of process 5363 written to file /dev/stdout

Seems to be some kind of infinite loop? The nesting depth is astonishing, to say the least :-)

fletcher commented 13 years ago

If you an reproduce this with mmd2xhtml.app, can you send me the document? There have been reports of CPU hanging with the quick look, but the only time I can reproduce it is if I try to run a really long file (on the order of megabytes). No one ever seems to know what file it is that caused the problem.

F-

On Jul 25, 2011, at 11:22 AM, dschneller wrote:

Using marked.app (but also mmd2xhtml.app) I have repeatedly seen multimarkdown processes hogging the CPU with 100%. I usually notice this, because the fans in the machine start to make noise. Often I then find multiple processes in Activity Monitor, each with 99-100% CPU load.

A sample of one of these processes with Activity Monitor shows this:

Sampling process 5363 for 3 seconds with 1 millisecond of run time between samples Sampling completed, processing symbols... Analysis of sampling multimarkdown (pid 5363) every 1 millisecond Process: multimarkdown [5363] Path: /usr/local/bin/multimarkdown Load Address: 0x100000000 Identifier: multimarkdown Version: ??? (???) Code Type: X86-64 (Native) Parent Process: ??? [1]

Date/Time: 2011-07-25 17:00:11.945 +0200 OS Version: Mac OS X 10.7 (11A511) Report Version: 7

Call graph: 1665 Thread_711529 DispatchQueue_1: com.apple.main-thread (serial) 1665 start (in multimarkdown) + 52 [0x100000a04] 1665 main (in multimarkdown) + 1650 [0x10003c982] 1665 markdown_to_string (in multimarkdown) + 14 [0x10003c2be] 1665 markdown_to_g_string (in multimarkdown) + 145 [0x10003c201] 1665 parse_markdown_with_metadata (in multimarkdown) + 65 [0x1000010f1] 1665 yyparsefrom (in multimarkdown) + 74 [0x100000e9a] 1665 yy_DocWithMetaData (in multimarkdown) + 1148 [0x1000311ec] 1665 yy_MetaData (in multimarkdown) + 278 [0x10001e436] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] 1665 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005] ... 1665 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103] 1393 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]

  • 1341 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! 673 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : 337 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | 337 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | 170 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + 86 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! 43 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : 22 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! : | 11 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + 6 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! 3 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! : 2 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! : | 1 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1253 [0x10001e005]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]
  • ! : | + ! : | + ! : | + 1 yy_MetaDataKeyValue (in multimarkdown) + 1431 [0x10001e0b7]
  • ! : | + ! : | + ! : | + 1 yymatchChar (in multimarkdown) + 206 [0x10000273e]
  • ! : | + ! : | + ! : | 1 yy_MetaDataKeyValue (in multimarkdown) + 1507 [0x10001e103]

... (and 12MB more of this)

Seems to be some kind of infinite loop? The nesting depth is astonishing, to say the least :-)

Reply to this email directly or view it on GitHub: https://github.com/fletcher/peg-multimarkdown/issues/78

Fletcher T. Penney fletcher@fletcherpenney.net

fletcher commented 13 years ago

I took a minute to dig back through the MetaData parsing, and I think I figured out the cause. A metadata key looks ahead to the next line to make sure it's not a metadata key. I'm guessing under the right circumstances this could cause an infinite loop.

I recoded the metadata routine, and pushed a commit to the development branch for anyone who wants to go ahead and use. I am in the midst of a retooling the way I compile binaries of MMD, so I'm not able to (easily) push a binary release yet. But the next binary release will be much easier to install for those with 32 bit mac machines!

I'm going to close this issue, but if necessary it can be reopened if the problem persists after the next release