I am using nodejs v10.13.0 with VS Code as my IDE.
When I run my nodejs program,
It exits at this line:
let matches = address.match(reallyCrazyLongRegex);
No errors
no exceptions
nothing
in the VS Code Terminal then I run
>> echo %ERRORLEVEL%
-1073741819
Why is it crashing?
Why are there no exceptions/errors when it crashes?
What exit code is -1073741819 for nodejs?
Note, if I replace reallyCrazyLongRegex with reallySimpleTestingRegex it runs as normal.
Thanks,
Ryan
Edit: address is a mailing address
the regex:
let reallyCrazyLongRegex = new RegExp([arrayOfEveryCityNameInTheUSA].map(function (v)
{
return "([ ]+|^)" + v + "([ ]+|$)";
}).join("|"), "ig");
It's simple, just very long.
Edit2: I have split it into multiple regexes (every 1000 names)
and it works for the most part but will randomly crash with
JavaScript heap out of memory
which doesn't make any sense at all cause i'm running --max-old-space-size=4048 and my node process never goes above 500MB
<--- Last few GCs --->
[5048:0000000000379B20] 92031 ms: Mark-sweep 293.3 (307.6) -> 293.3
(299.8) MB, 271.7 / 0.0 ms (average mu = 0.910, current mu = 0.000)
last resort GC in old space requested [5048:0000000000379B20] 92227
ms: Mark-sweep 293.3 (299.8) -> 293.3 (299.8) MB, 195.9 / 0.0 ms
(average mu = 0.850, current mu = 0.000) last resort GC in old space
requested
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 00000001402BAE3D]
1: StubFrame [pc: 00000001402FB91E] Security context: 0x01abc1840921 <JSObject>
2: match [000001ABC184D011](this=0x00df6da620c1 <String[30]: room no nanjing shanghai china>,0x0352098253f1 <JSRegExp <Very long string[25794]>>)
3: findArea [000001CEE0D6B1E1] [c:\script.js:900]
[bytecode=0000035209839239 offset=430](this=0x00fab1aeb5d1
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap
out of memory 1: 000000013F6AC80F napi_wrap+125199 2:
000000013F64BFE6 v8::base::CPU::has_sse+36198 3: 000000013F64CCB6
v8::base::CPU::has_sse+39478 4: 000000013FE744AE
v8::Isolate::ReportExternalAllocationLimitReached+94 5:
000000013FE5BC01 v8::SharedArrayBuffer::Externalize+785 6:
000000013FD22F5C
v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1436 7:
000000013FD1ED69 v8::internal::Heap::AllocateExternalBackingStore+1561
8: 000000013FD39FEC
v8::internal::Factory::CodeBuilder::BuildInternal+412 9:
000000013FD39E26 v8::internal::Factory::CodeBuilder::Build+22 10:
000000013F89D6E4 v8::internal::RegExpMacroAssemblerX64::GetCode+4116
11: 000000013FAD5101
v8::internal::IrregexpInterpreter::MatchInternal+7057 12:
000000013FAC6C80 v8::internal::RegExpParser::operator=+4544 13:
000000013FAC7149 v8::internal::RegExp::CompileForTesting+425 14:
000000013FAC74E5 v8::internal::RegExp::DotPrintForTesting+245 15:
000000013FAC7D68 v8::internal::RegExp::Exec+1256 16: 000000013FAC78F7
v8::internal::RegExp::Exec+119 17: 000000013FA74B26
v8::internal::DeclarationScope::was_lazily_parsed+21974 18:
00000001402BAE3D v8::internal::SetupIsolateDelegate::SetupHeap+517453
19: 00000001402FB91E
v8::internal::SetupIsolateDelegate::SetupHeap+782382 20:
00000001402A6E7E v8::internal::SetupIsolateDelegate::SetupHeap+435598
21: 000000014024675B
v8::internal::SetupIsolateDelegate::SetupHeap+40555 22:
000000014024675B v8::internal::SetupIsolateDelegate::SetupHeap+40555
23: 000000014024675B
v8::internal::SetupIsolateDelegate::SetupHeap+40555 24:
0000000140272F70 v8::internal::SetupIsolateDelegate::SetupHeap+222848
25: 0000000140297C52
v8::internal::SetupIsolateDelegate::SetupHeap+373602 26:
0000000140265354 v8::internal::SetupIsolateDelegate::SetupHeap+166500
27: 00000001402441AC
v8::internal::SetupIsolateDelegate::SetupHeap+30908 28:
000000013FD7ED0F v8::internal::Execution::CallWasm+1551 29:
000000013FD7EE03 v8::internal::Execution::CallWasm+1795 30:
000000013FD7F1E5 v8::internal::Execution::TryCall+357 31:
000000013FD61745 v8::internal::MicrotaskQueue::RunMicrotasks+501 32:
000000013FE26BE0 v8::internal::Builtins::builtin_handle+326608 33:
000000013FE26120 v8::internal::Builtins::builtin_handle+323856 34:
000000013FE26468 v8::internal::Builtins::builtin_handle+324696 35:
000000013FE2626E v8::internal::Builtins::builtin_handle+324190 36:
00000001402BAF1D v8::internal::SetupIsolateDelegate::SetupHeap+517677
37: 000000014024675B
v8::internal::SetupIsolateDelegate::SetupHeap+40555 38:
00000001402442BE v8::internal::SetupIsolateDelegate::SetupHeap+31182
39: 0000000140243EAC
v8::internal::SetupIsolateDelegate::SetupHeap+30140 40:
000000013FD7EC82 v8::internal::Execution::CallWasm+1410 41:
000000013FD7E5F9 v8::internal::Execution::Call+185 42:
000000013FE520E0 v8::Function::Call+608 43: 000000013F6C8E52
node::CallbackScope::~CallbackScope+770 44: 000000013F6C9114
node::CallbackScope::~CallbackScope+1476 45: 000000013F6C2093
v8::internal::compiler::Operator::EffectOutputCount+179 46:
000000013F5BFE33 v8::internal::MicrotaskQueue::microtasks_policy+19395
47: 000000013F5C062C
v8::internal::MicrotaskQueue::microtasks_policy+21436 48:
000000013F5BB6B5 v8::internal::MicrotaskQueue::microtasks_policy+1093
49: 000000013F6E0A2B uv_tty_set_vterm_state+8299 50: 000000013F6F588C
uv_loop_init+844 51: 000000013F6F5BC4 uv_run+244 52: 000000013F6173F3
EVP_CIPHER_CTX_buf_noconst+29635 53: 000000013F6740D0 node::Start+288
54: 000000013F52673C RC4_options+339516 55: 0000000140377788
v8::internal::SetupIsolateDelegate::SetupHeap+1289880 56:
00000000775A556D BaseThreadInitThunk+13 57: 000000007790385D
RtlUserThreadStart+29
Figuring out the error code by using bash:
$ printf "%x" -1073741819
ffffffffc0000005
Ignoring the f's, this is c0000005 -- an access violation.
Your regex is too complicated; node can't cope; it's crashing.
There are many capture groups that should be factored out.
Unless there exist's a source of US Cities that is updated daily,
the way to do this is with
a full blown regex trie that is created offline every month or so.
Source #1 : US Cities
Here can be obtained a 28900 item list of the full regex.
Or individual regex as broken down by state.
This is derived from the public list obtained from https://simplemaps.com/data/us-cities.
What is interessting here is that the 52 individual regex are small and
can be compiled into a list of regex's.
A code segment can be such that inside a loop each regex is tried
until one (or multiple) by state is found.
Or, if the State is already known, the city can be checked.
Source #2 :
There are about 1950 Cities that the Encylopedia Britanica's list on their website.
This is sparce, and are the biggest populated cities.
(\s|^)(A(?:b(?:beville|erdeen|i(?:lene|ng(?:d|t)on))|coma|d(?:a(?:ms)?|rian)|iken|jo|kron|l(?:am(?:eda|o(?:gordo|sa))|b(?:any|ert[\t ]+Lea|uquerque)|coa|exand(?:er[\t ]+City|ria)|hambra|iquippa|l(?:entown|iance)|ma|pine|t(?:a|o(?:n|ona)|us)|va)|m(?:a(?:na[\t ]+Colonies|rillo)|bridge|e(?:ric(?:an[\t ]+Fork|us)|s(?:bury)?)|herst|sterdam)|n(?:a(?:co(?:nda|rtes)|darko|heim)|chorage|d(?:alusia|erson(?:ville)?|over)|n(?:[\t ]+Arbor|apolis|iston)|sonia|tioch)|p(?:alachicola|pleton)|r(?:cadia|dmore|ka(?:delphia|nsas[\t ]+(?:City|Post))|lington(?:[\t ]+Heights)?|t(?:esia|hur))|s(?:bury[\t ]+Park|h(?:e(?:boro|ville)|land|tabula)|pen|toria)|t(?:chison|h(?:ens|ol)|lant(?:a|ic[\t ]+City)|more|tleboro)|u(?:burn|gusta|rora|stin)|vondale)|B(?:a(?:bylon|inbridge|ker(?:[\t ]+City|sfield)|ltimore|ngor|r(?:[\t ]+Harbor|aboo|b(?:erton|ourville)|dstown|nstable|r(?:e|ington)|stow|t(?:lesville|ow))|strop|t(?:avia|esville|h|on[\t ]+Rouge|tle[\t ]+Creek)|y(?:[\t ]+(?:City|Saint[\t ]+Louis)|onne|town))|e(?:a(?:con|trice|u(?:for|mon)t|verton)|ckley|dford|l(?:en|fast|l(?:e(?:[\t ]+(?:Fourch|Glad)e|fontaine|v(?:ill|u)e)|ingham|ows[\t ]+Falls)|mont|oit|videre)|midji|n(?:d|nington|ton(?:[\t ]+Harbor)?)|r(?:ea|keley|lin)|ssemer|th(?:any|esda-Chevy[\t ]+Chase|lehem)|verly(?:[\t ]+Hills)?)|i(?:ddeford|g[\t ]+Spring|l(?:lings|oxi)|nghamton|rmingham|s(?:bee|marck))|l(?:a(?:ckfoot|irsville)|oom(?:field(?:[\t ]+Hills)?|ington|sburg)|uefield|ytheville)|o(?:ca[\t ]+Raton|galusa|ise|nners[\t ]+Ferry|o(?:n(?:e(?:sborough)?|ville)|thbay[\t ]+Harbor)|r(?:dentown|ger)|s(?:sier[\t ]+City|ton)|u(?:lder(?:[\t ]+City)?|n(?:d[\t ]+Brook|tiful)|rne)|w(?:ie|ling[\t ]+Green)|ys[\t ]+Town|zeman)|r(?:a(?:d(?:enton|ford)|in(?:erd|tree)|n(?:ford|son)|ttleboro)|e(?:a|ckenridge|merton)|i(?:dge(?:port|ton)|gh(?:am[\t ]+City|ton)|stol)|o(?:ckton|nx|ok(?:field|ings|l(?:ine|yn))|wnsville)|unswick|yan)|u(?:ckhannon|ena[\t ]+Park|ffalo|r(?:bank|lington|ns)|tte))|C(?:a(?:dillac|hokia|iro|l(?:ais|dwell|exico|houn|istoga|umet[\t ]+City)|m(?:bridge|den|pbellsville)|n(?:on[\t ]+City|ton|yon)|pe[\t ]+(?:Coral|Girardeau|May)|r(?:bondale|ibou|l(?:i(?:nvil|s)le|sbad)|mel|rollton|son[\t ]+City|thage)|s(?:a[\t ]+Grande|per|tine)|tonsville)|e(?:dar[\t ]+(?:City|Falls|Rapids)|ntral(?:[\t ]+(?:City|Falls)|ia))|h(?:a(?:dron|m(?:bersburg|paign)|n(?:dler|ute)|pel[\t ]+Hill|rl(?:e(?:s(?:[\t ]+(?:City|Town)|to(?:w)?n)|voix)|otte(?:sville)?)|ttanooga|utauqua)|e(?:boygan|ektowaga|l(?:msford|sea)|rokee|s(?:apeake|ter)|yenne)|i(?:c(?:ago(?:[\t ]+Heights)?|kas(?:aw|ha)|o(?:pee)?)|llicothe)|ula[\t ]+Vista)|i(?:cero|ncinnati)|l(?:a(?:nton|r(?:emo(?:nt|re)|ks(?:burg|dale|ville))|yton)|e(?:ar(?:field|water)|burne|veland(?:[\t ]+Heights)?)|i(?:fton|max|nton)|ovis)|o(?:coa(?:[\t ]+Beach|-Rockledge)|dy|eur[\t ]+d’Alene|ffeyville|h(?:asset|oes)|l(?:l(?:ege[\t ]+(?:Park|Station)|insville)|orado[\t ]+Springs|umb(?:ia|us))|mpton|n(?:cord|ey[\t ]+Island|ne(?:aut|rsville)|way)|o(?:keville|perstown|s[\t ]+Bay)|r(?:al[\t ]+Gables|dova|inth|ning|ona(?:do)?|pus[\t ]+Christi|t(?:ez|land)|vallis|ydon)|sta[\t ]+Mesa|u(?:lee[\t ]+Dam|ncil[\t ]+(?:Bluffs|Grove)|peville)|v(?:entry|ington))|r(?:a(?:n(?:ford|ston)|wfordsville)|ipple[\t ]+Creek|o(?:okston|ssett|wn[\t ]+Point)|ystal[\t ]+City)|u(?:l(?:lman|ver[\t ]+City)|mberland|s(?:hing|ter)|yahoga[\t ]+Falls))|D(?:a(?:hlonega|l(?:las|ton|y[\t ]+City)|n(?:bury|v(?:ers|ille))|r(?:ien|lington|tmouth)|v(?:enport|is)|yton(?:a[\t ]+Beach)?)|e(?:[\t ]+(?:Land|Smet)|Kalb|a(?:dwood|rborn)|catur|dham|erfield[\t ]+Beach|fiance|l(?:[\t ]+Rio|aware|ray[\t ]+Beach|ta)|m(?:ing|opolis)|n(?:ison|nis|ton|ver)|r(?:b|r)y|s[\t ]+(?:Mo|Pla)ines|troit|vils[\t ]+Lake)|i(?:ckins|ll|x)on|o(?:dge[\t ]+City|than|uglas|ver|wney)|u(?:buque|luth|n(?:can|kirk)|r(?:an(?:go|t)|ham)|xbury))|E(?:a(?:gle[\t ]+Pass|st(?:[\t ]+(?:Aurora|C(?:hicago|leveland)|Greenwich|Ha(?:mpton|rtford|ven)|L(?:ansing|iverpool)|Moline|Orange|P(?:oint|rovidence)|Saint[\t ]+Louis)|chester|ham|on|po(?:inte|rt))|u[\t ]+Claire)|corse|d(?:enton|gartown|i(?:nburg|son)|mond)|ffingham|l(?:[\t ]+(?:Ce(?:ntr|rrit)o|Dorado|Monte|Paso|Reno)|gin|izabeth(?:[\t ]+City|to(?:w)?n)?|k(?:[\t ]+City|hart|ins|o|ton)|l(?:ensburg|sworth)|m(?:hurst|ira)|wood|y(?:ria)?)|m(?:mitsburg|poria)|n(?:field|glewood|id|terprise)|phrata|rie|s(?:c(?:anaba|ondido)|sex|t(?:es[\t ]+Park|herville))|u(?:clid|faula|gene|reka)|v(?:ans(?:ton|ville)|e(?:leth|rett))|x(?:celsior[\t ]+Springs|eter))|F(?:a(?:ir(?:banks|f(?:ax|ield)|haven|mont)|l(?:l(?:[\t ]+River|on|s[\t ]+Church)|mouth)|r(?:go|ibault|mington)|yetteville)|er(?:gus(?:[\t ]+Falls|on)|nandina[\t ]+Beach)|i(?:llmore|ndlay|t(?:chburg|zgerald))|l(?:agstaff|int|or(?:ence|issant)|ushing)|o(?:n(?:d[\t ]+du[\t ]+Lac|tana)|r(?:est[\t ]+Hills|rest[\t ]+City|t[\t ]+(?:Benton|Collins|Dodge|Kent|L(?:auderdal|e)e|M(?:organ|yers)|P(?:ayn|ierc)e|S(?:cott|mith)|Valley|W(?:a(?:lton[\t ]+Beach|yne)|orth))))|r(?:a(?:mingham|nk(?:fort|lin))|e(?:d(?:erick(?:sburg)?|onia)|eport|mont|nch[\t ]+Lick|sno))|ul(?:ler)?ton)|G(?:a(?:dsden|ffney|inesville|l(?:e(?:na|sburg)|l(?:atin|ipolis|up)|veston)|r(?:d(?:en[\t ]+(?:City|Grove)|iner)|land|y)|stonia|tlinburg)|e(?:n(?:ev|o)a|orgetown|rmantown|ttysburg)|il(?:a[\t ]+Bend|lette)|l(?:assboro|en(?:[\t ]+Ellyn|d(?:al|iv)e|s[\t ]+Falls|view|wood[\t ]+Springs)|o(?:be|ucester|versville))|o(?:l(?:d(?:en|field|sboro)|iad)|shen)|r(?:a(?:fton|n(?:d[\t ]+(?:Forks|Haven|Island|Junction|Rapids)|ite[\t ]+City|ts(?:[\t ]+Pass)?)|yling)|e(?:at[\t ]+(?:B(?:arrington|end)|Falls|Neck)|e(?:ley|n(?:[\t ]+(?:Bay|River)|belt|eville|field|sb(?:oro|urg)|ville|w(?:ich|ood)))|nada|tna)|innell|o(?:sse[\t ]+Pointe|ton))|u(?:ilford|lfport|n(?:nison|tersville)|thrie|ymon))|H(?:a(?:ckensack|ddonfield|gerstown|ines|l(?:ifax|landale[\t ]+Beach)|m(?:den|ilton|mond(?:sport)?|pton)|n(?:alei|cock|nibal|over)|r(?:l(?:an|em|ingen)|mony|pers[\t ]+Ferry|r(?:is(?:burg|on)|odsburg)|t(?:ford|sville)|wich)|stings|ttiesburg|v(?:erhill|re)|y(?:s|ward)|z(?:ard|leton))|e(?:ber[\t ]+City|lena|mpstead|nderson|r(?:kimer|rin|shey))|i(?:aleah|bbing|ckory|gh(?:[\t ]+Point|land[\t ]+Park)|l(?:lsboro(?:ugh)?|o)|n(?:gham|ton))|o(?:b(?:art|bs|oken)|dgenville|l(?:denville|l(?:and|y(?:[\t ]+Springs|wood))|yoke)|me(?:r|stead)|n(?:aunau|esdale|olulu)|od[\t ]+River|p(?:e(?:well)?|kinsville)|quiam|t[\t ]+Springs|u(?:ghton|lton|ma|ston))|u(?:dson|go|nt(?:ington(?:[\t ]+Beach)?|sville)|ron|tchinson)|y(?:a(?:nnis|ttsville)|de[\t ]+Park))|I(?:daho[\t ]+(?:City|Falls)|lion|n(?:d(?:ependence|i(?:an(?:a(?:polis)?|ola)|o))|glewood|ter(?:lochen|national[\t ]+Falls))|owa[\t ]+City|pswich|r(?:on(?:[\t ]+Mountain|wood)|vin(?:e|g(?:ton)?))|shpeming|thaca)|J(?:a(?:ckson(?:ville)?|mestown|nesville|sper)|e(?:annette|fferson(?:[\t ]+City|ville)|rsey[\t ]+City)|im[\t ]+Thorpe|o(?:hn(?:[\t ]+Day|s(?:on[\t ]+City|town))|liet|nesboro(?:ugh)?|plin)|un(?:ction[\t ]+City|eau))|K(?:a(?:hului|l(?:amazoo|ispell)|n(?:ab|eohe|kakee|sas[\t ]+City)|paa|skaskia|waihae)|e(?:arney|ene|l(?:logg|so)|n(?:ne(?:bunkport|wick)|osha|t)|okuk|t(?:chikan|tering)|wanee|y(?:[\t ]+West|ser))|i(?:l(?:gore|leen)|n(?:g(?:man|s(?:port|ton|ville))|ston)|rksville|tt(?:ery|y[\t ]+Hawk))|lamath[\t ]+Falls|noxville|o(?:diak|komo|tzebue))|L(?:a(?:[\t ]+(?:Crosse|Gran(?:d|g)e|Habra|Junta|Salle)|c(?:kawann|oni)a|fayette|guna[\t ]+Beach|haina|ie|ke(?:[\t ]+(?:C(?:harles|ity)|Forest|Geneva|Havasu[\t ]+City|Oswego|Placid|Wales)|hurst|land|view|wood)|mar|n(?:caster|der|sing)|r(?:amie|edo|go)|s[\t ]+(?:Cruce|Vega)s|urel|w(?:rence|ton)|yton)|e(?:a(?:d(?:ville)?|venworth)|banon|hi|nox|ominster|vittown|w(?:es|is(?:burg|to(?:w)?n))|xington)|i(?:ber(?:al|tyville)|ma|ncoln|sle|t(?:chfield|tle(?:[\t ]+(?:Falls|Rock)|ton))|v(?:ermore|ingston|onia))|o(?:ck(?:[\t ]+Haven|port)|di|gan|m(?:bard|poc)|ng(?:[\t ]+B(?:ea|ran)ch|mont|view)|rain|s[\t ]+A(?:lamo|ngele)s|uisville|v(?:eland|ington)|we(?:ll|r[\t ]+Southampton))|u(?:b(?:bock|ec)|d(?:ington|low)|fkin|mberton)|yn(?:chburg|n))|M(?:a(?:c(?:hias|kinaw[\t ]+City|o(?:mb|n))|dison|gnolia|l(?:den|ibu)|maroneck|n(?:assas|chester|dan|hattan|i(?:stee|towoc)|kato|sfield|ti)|r(?:blehead|i(?:etta|nette|on)|lborough|quette|shall|tin(?:ez|s(?:[\t ]+Ferry|burg|ville))|y(?:s)?ville)|s(?:on[\t ]+City|s(?:ena|illon))|ttoon|y(?:field|sville))|c(?:Al(?:ester|len)|Cook|K(?:eesport|inney)|Minnville|Pherson)|e(?:adville|d(?:ford|icine[\t ]+Lodge)|lbourne|mphis|n(?:asha|lo[\t ]+Park|ominee|tor)|r(?:ced|id(?:e|ia)n)|s(?:a|quite)|xico)|i(?:ami(?:[\t ]+Beach)?|chigan[\t ]+City|d(?:dle(?:bury|sboro|town)|land|west[\t ]+City)|l(?:an|bank|es[\t ]+City|ford|l(?:burn|edgeville|ville)|ton|waukee)|n(?:den|eola|neapolis|ot)|s(?:hawaka|s(?:ion|oula))|tchell)|o(?:ab|b(?:il|ridg)e|desto|line|n(?:ett|mouth|roe(?:ville)?|t(?:clair|erey|gomery|icello|pelier|rose))|or(?:e|head)|r(?:ehead[\t ]+City|gan(?:[\t ]+City|to(?:w)?n)|ri(?:lto|stow)n)|s(?:cow|es[\t ]+Lake)|un(?:dsville|t(?:[\t ]+(?:Clemens|Holly|Pleasant|Vernon)|ain[\t ]+View)))|u(?:n(?:cie|delein)|r(?:freesboro|ray)|s(?:catine|k(?:egon|ogee)))|y(?:rtle[\t ]+Beach|stic))|N(?:a(?:cogdoches|gs[\t ]+Head|hant|mpa|nticoke|p(?:a|erville|les|panee)|rragansett|sh(?:ua|ville)|t(?:ch(?:ez|itoches)|ick)|u(?:gatuck|voo))|e(?:braska[\t ]+City|e(?:dles|nah)|osho|phi|w(?:[\t ]+(?:Albany|B(?:e(?:dford|rn)|r(?:aunfels|itain|unswick))|Castle|Glarus|H(?:a(?:rmony|ven)|ope)|Iberia|Kensington|London|M(?:a(?:drid|r(?:ket|tinsville))|ilford)|Orleans|P(?:altz|hiladelphia)|Rochelle|Smyrna[\t ]+Beach|Ulm|Windsor|York[\t ]+City)|ark|b(?:erg|ur(?:gh|yport))|castle|port(?:[\t ]+(?:Beach|News))?|ton))|i(?:agara[\t ]+Fall|le)s|o(?:gales|me|r(?:folk|ma[ln]|ris(?:town)?|t(?:h(?:[\t ]+(?:Adams|C(?:hicago|ollege[\t ]+Hill)|H(?:aven|empstead)|Kingstown|L(?:as[\t ]+Vegas|ittle[\t ]+Rock)|Platte)|ampton|field)|on)|w(?:alk|ich|ood))|vato)|yack)|O(?:ak(?:[\t ]+(?:Harbor|Park|Ridge)|land)|berlin|c(?:ala|ean(?:[\t ]+(?:City|Springs)|side)|onto)|dessa|gden(?:sburg)?|il[\t ]+City|jai|k(?:lahoma[\t ]+City|mulgee)|l(?:athe|d[\t ]+Saybrook|ean|ympia)|maha|n(?:e(?:id|ont)a|tario)|pel(?:ika|ousas)|r(?:a(?:ibi|nge(?:burg)?)|derville|e(?:gon(?:[\t ]+City)?|m)|lando|mond[\t ]+Beach|o(?:no|ville))|s(?:awatomie|ceola|hkosh|kaloosa|sining|wego)|tt(?:a|um)wa|uray|verland[\t ]+Park|w(?:atonna|ensboro)|x(?:fo|na)rd|yster[\t ]+Bay|zark)|P(?:a(?:cific[\t ]+Grove|ducah|gosa[\t ]+Springs|inesville|l(?:at(?:ine|ka)|m(?:[\t ]+(?:B(?:ay|each)|Springs)|dale|er|yra)|o[\t ]+Alto)|mpa|n(?:ama[\t ]+City|guitch)|r(?:is|k(?:[\t ]+(?:City|Forest|Ridge)|ersburg)|ma|sippany–Troy[\t ]+Hills)|s(?:adena|c(?:agoula|o)|s(?:[\t ]+Christian|aic))|terson|uls[\t ]+Valley|w(?:huska|tucket)|yson)|e(?:abody|cos|ekskill|kin|n(?:dleton|sacola)|oria|r(?:ry|th[\t ]+Amboy|u)|shtigo|t(?:aluma|er(?:borough|sburg)|oskey))|h(?:arr|enix[\t ]+City|il(?:adelphia|ippi)|oenix(?:ville)?)|i(?:erre|ne(?:[\t ]+Bluff|hurst)|pestone|qua|tts(?:burgh?|field))|l(?:a(?:in(?:field|s|view)|no|tts(?:burg|mout)h)|ymouth)|o(?:catello|int[\t ]+(?:Pleasant|Roberts)|m(?:ona|pano[\t ]+Beach)|n(?:ca[\t ]+City|tiac)|rt(?:[\t ]+(?:A(?:ngeles|rthur)|Gibson|Hu(?:eneme|ron)|Lavaca|Orford|Washington)|a(?:ge|les)|land|smouth)|t(?:sdam|ts(?:town|ville))|ughkeepsie|well)|r(?:airie[\t ]+du[\t ]+Chien|es(?:cott|que[\t ]+Isle)|i(?:c(?:e|hard)|est[\t ]+River|n(?:ceton|eville))|ov(?:i(?:dence|ncetown)|o)|yor)|u(?:eblo|llman|t-in-Bay|yallup))|Qu(?:eens|incy)|R(?:a(?:cine|leigh|n(?:cho[\t ]+Cucamonga|dolph|toul)|pid[\t ]+City|ton|wlins)|e(?:ading|d(?:[\t ]+(?:Bluff|Cloud|Wing)|ding|lands|mond|ondo[\t ]+Beach|wood[\t ]+City)|edsport|n(?:o|sselaer|ton)|ston|vere|xburg)|hinelander|i(?:ch(?:ardson|land|mond)|dgewood|pon|ver(?:[\t ]+Forest|side|ton))|o(?:anoke|c(?:hester|k(?:[\t ]+(?:Hill|Island|Springs)|ford|land|ville|y[\t ]+Mount))|gers|lla|m(?:e|ney)|s(?:e(?:burg|lle|ville)|well)|tterdam|yal[\t ]+Oak)|u(?:gby|mford|ston|t(?:herfor|lan)d)|ye)|S(?:a(?:c(?:rament)?o|g(?:[\t ]+Harbor|inaw)|int(?:[\t ]+(?:A(?:lbans|ugustine)|C(?:harles|loud)|George|Ignace|Jo(?:hnsbury|seph)|Louis|Mar(?:tinville|ys[\t ]+City)|P(?:aul|etersburg))|e[\t ]+Genevieve)|l(?:em|i(?:nas?|sbury)|lisaw|t[\t ]+Lake[\t ]+City)|n(?:[\t ]+(?:An(?:gel|toni)o|Bernardino|Clemente|Diego|F(?:e(?:lipe|rnando)|rancisco)|Gabriel|J(?:ose|uan[\t ]+Capistrano)|L(?:eandr|uis[\t ]+Obisp)o|Ma(?:r(?:cos|ino)|teo)|Pedro|Rafael|Simeon)|d(?:[\t ]+Springs|usky|wich)|ford|ta[\t ]+(?:Ana|Barbara|C(?:la(?:r(?:it)?a|us)|ruz)|Fe|Monica|Rosa))|pulpa|ra(?:nac[\t ]+Lake|sota|toga[\t ]+Springs)|u(?:gus|k[\t ]+Centre|lt[\t ]+Sainte[\t ]+Marie|salito)|vannah)|c(?:ar(?:borough|sdale)|henectady|otts(?:boro|dale)|ranton)|e(?:a(?:rcy|side|ttle)|bring|dalia|lma|minole|neca[\t ]+Falls|ward|ymour)|h(?:a(?:ker[\t ]+Heights|mokin|ron|wnee(?:town)?)|e(?:boygan|ffield|l(?:by(?:ville)?|ton)|pherdstown|r(?:id|m)an)|iprock|reveport)|i(?:dney|erra[\t ]+Vista|lver(?:[\t ]+(?:City|Spring)|ton)|m(?:i[\t ]+Valle|sbur)y|oux[\t ]+(?:City|Falls)|tka)|k(?:agway|okie)|m(?:ith[\t ]+Center|yrna)|o(?:corro|mer(?:sworth|ville)|noma|uth(?:[\t ]+(?:Bend|Charleston|H(?:adley|olland)|Kingstown|Orange[\t ]+Village|Sa(?:int[\t ]+Paul|n[\t ]+Francisco))|ampton|ington))|p(?:a(?:nish[\t ]+Fork|r(?:ks|tanburg))|earfish|okane|ring(?:[\t ]+Green|field|ville))|t(?:a(?:mford|rkville|te(?:[\t ]+College|n[\t ]+Island)|unton)|e(?:amboat[\t ]+Springs|rling|ubenville|vens[\t ]+Point)|illwater|o(?:ck(?:bridge|ton)|n(?:ington|y[\t ]+(?:Brook|Point))|ughton)|r(?:atford|eator|oudsburg)|u(?:r(?:bridge|g(?:eon[\t ]+Bay|is))|ttgart))|u(?:dbury|ffolk|m(?:m(?:ersville|it)|ter)|n(?:[\t ]+Valley|bury|nyvale)|perior|sanville)|w(?:arthmore|eetwater)|y(?:lacauga|racuse))|T(?:a(?:coma|hlequah|koma[\t ]+Park|lla(?:dega|hassee)|m(?:aqu|p)a|os|r(?:pon[\t ]+Springs|rytown)|unton)|e(?:lluride|mp(?:l)?e|n[\t ]+Sleep|rre[\t ]+Haute|wksbury|xa(?:rkana|s[\t ]+City))|h(?:e(?:[\t ]+(?:Dalles|Village)|rmopolis)|ibodaux|ousand[\t ]+Oaks)|i(?:conderoga|ffin|llamook|tusville|verton)|o(?:ccoa|ledo|mbstone|nawanda|oele|peka|rr(?:ance|ington)|towa|wson)|r(?:averse[\t ]+City|enton|inidad|oy|u(?:ro|th[\t ]+or[\t ]+Consequences))|u(?:c(?:son|umcari)|l(?:lahom|s)a|pelo|rlock|s(?:c(?:aloos|umbi)a|kegee))|win[\t ]+Falls|yler)|U(?:kiah|nion(?:[\t ]+City|town)?|rbana|tica|valde)|V(?:a(?:il|l(?:d(?:ez|osta)|le(?:jo|y[\t ]+City)|paraiso)|n(?:[\t ]+Buren|couver|dalia))|e(?:n(?:ice|tura)|r(?:million|nal))|i(?:c(?:ksburg|tor(?:ia|ville))|n(?:cennes|eland|ita)|r(?:den|ginia(?:[\t ]+(?:Beach|City))?)|salia))|W(?:a(?:bash|co|h(?:iawa|peton)|i(?:luku|mea)|l(?:l(?:a[\t ]+Walla|ingford)|nut[\t ]+Creek|pi|senburg)|r(?:m[\t ]+Springs|ner[\t ]+Robins|ren(?:sburg)?|wick)|shington|t(?:er(?:bury|ford|loo|town|v(?:ille|liet))|kins[\t ]+Glen|ts)|u(?:ke(?:gan|sha)|sau|watosa)|y(?:cross|ne(?:sboro)?))|e(?:atherford|bster(?:[\t ]+City)?|ehawken|irton|l(?:ch|l(?:esley|fleet|sburg))|natchee|st(?:[\t ]+(?:Allis|B(?:end|ridgewater)|C(?:hester|ovina)|Des[\t ]+Moines|Ha(?:rtford|ven)|Lafayette|Memphis|New[\t ]+York|Orange|P(?:alm[\t ]+Beach|lains|oint)|S(?:eneca|pringfield))|erly|field|minster|on|port)|thersfield|woka|ymouth)|h(?:e(?:aton|eling)|it(?:e[\t ]+(?:Plains|S(?:p|ulphur[\t ]+Sp)rings)|man|tier))|i(?:c(?:hita(?:[\t ]+Falls)?|kford)|l(?:kes-Barre|l(?:i(?:ams(?:burg|on|port|town)|mantic|ngboro|ston)|mar)|m(?:ette|ington)|son)|n(?:chester|d(?:ham|ow[\t ]+Rock|sor(?:[\t ]+Locks)?)|ne(?:mucc|tk)a|o(?:na|oski)|s(?:low|t(?:ed|on-Salem))|ter[\t ]+(?:Haven|Park))|sconsin[\t ]+Dells)|o(?:burn|o(?:d(?:[\t ]+River|bridge|land|s(?:[\t ]+Hole|tock)|ward)|nsocket|ster)|r(?:cester|land|thington))|yandotte)|Xenia|Y(?:a(?:kima|nkton|zoo[\t ]+City)|ellow[\t ]+Springs|o(?:nkers|r(?:ba[\t ]+Linda|k)|ungstown)|psilanti|sleta|u(?:ba[\t ]+City|ma))|Z(?:anesville|ion))(?!\S)
This matches all 1960 cities in about 3 ms., and is only about 14k in size.
https://regex101.com/r/qVcHf6/1
These regex are extremely fast being a ternary trie.
You can do this too, it was generated using this Ternary Trie Tool
My guess would be that your complicated regex is causing "redos" to your node.js server. Since node.js is single-threaded it tries to resolve your regex expression using way too much CPU which after some time crushes node execution.
You can prevent that by not using your own regex and try to use some well known regexes or if it is for validation use something like Joi or validator.js
Here is something about "redos":
https://blog.malwarebytes.com/security-world/technology/2018/08/explained-regular-expression-regex/
or
https://javascript.info/regexp-catastrophic-backtracking
Hope this helps :)
Related
I am trying to get an Ethereum smart contract up and running for Solana. I'm using solang and it had a few issues that I was able to fix, like Solidity's assembly not working, but I finally ran into something I can't handle.
I run solang build:
solang ./lib/FastEcMul.sol --target solana --output build
and I get:
thread 'main' panicked at 'type not allowed', src/sema/types.rs:920:18
more detailed, with RUST_BACKTRACE=1 and -v:
info: Solang version v0.1.10
thread 'main' panicked at 'type not allowed', src/sema/types.rs:920:18
stack backtrace:
0: 0x104833ce8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8483effd3e9ec544
1: 0x10433e7e8 - core::fmt::write::ha34752bcd39bca36
2: 0x1048327d0 - std::io::Write::write_fmt::hfc57a6e48a9ddae2
3: 0x104832f98 - std::panicking::default_hook::{{closure}}::he9aaba83dd453f35
4: 0x10483244c - std::panicking::rust_panic_with_hook::hf890018b6cf19ef5
5: 0x10484f6e0 - std::panicking::begin_panic_handler::{{closure}}::hc0918e64b5d68f06
6: 0x10484f668 - std::sys_common::backtrace::__rust_end_short_backtrace::hb99d925d54d4af60
7: 0x10484f634 - _rust_begin_unwind
8: 0x105b17e38 - core::panicking::panic_fmt::hf9e85df46ac02a7d
9: 0x10449be1c - solang::sema::types::<impl solang::sema::ast::Type>::bits::h29f3c107ab9657a4
10: 0x1045df378 - solang::sema::expression::bigint_to_expression::hc02ea43f3e21887f
11: 0x1045f57bc - solang::sema::expression::power::ha1372353023ad777
12: 0x1045e9078 - solang::sema::expression::expression::h07d54b6ce13d6489
13: 0x1045f9ee0 - solang::sema::expression::subtract::hc24c7a4700f0e8e1
14: 0x1045e8748 - solang::sema::expression::expression::h07d54b6ce13d6489
15: 0x1045fba34 - solang::sema::expression::bitwise_and::hc24720f8c53e5be3
16: 0x1045e8574 - solang::sema::expression::expression::h07d54b6ce13d6489
17: 0x1045a22b4 - solang::sema::statements::destructure_values::h1d04cc668cdbf5fd
18: 0x1045a13d0 - solang::sema::statements::destructure::h3937764899bb6c4d
19: 0x104596968 - solang::sema::statements::statement::h392fdbc69b4da93d
20: 0x10459568c - solang::sema::statements::statement::h392fdbc69b4da93d
21: 0x104594868 - solang::sema::statements::resolve_function_body::hc7bc7aac8f20f106
22: 0x10443518c - solang::sema::contracts::resolve::h4024bf7abc2ae716
23: 0x10447a5e8 - solang::sema::sema_file::h3b89ac6a8acdaddb
24: 0x10447c83c - solang::parse_and_resolve::hdc70bef828872f55
25: 0x1047bb45c - solang::main::h5ce247c5504216e2
26: 0x104799d24 - std::sys_common::backtrace::__rust_begin_short_backtrace::hb58d66c82bbbcc6f
27: 0x1047b70a0 - _main
I got no idea, which type is not allowed, or where to find the file src/sema/types.rs:920:18.
However, I managed to compile other .sol file EC.sol, on which the FastEcMul.so is dependent. Yet the result was only bundle.so and .abi file is missing.
link to both files
I'd be grateful for any clue.
I've started looking at this issue. The first issue I can across was the doccomments which were not supported: https://github.com/hyperledger-labs/solang/pull/756
I'll continue looking at the next issue and get back.
Whenever I build using ng build I get the following error. The project I'm working on is an angular 12 with primeface template.
I've tried the following which did not work
set NODE_OPTIONS=--max-old-space-size=8192
<--- Last few GCs --->
[20368:00000209E3C2B160] 34896 ms: Mark-sweep (reduce) 4092.5 (4101.4) -> 4092.1 (4106.9) MB, 3198.8 / 0.0 ms (+ 0.1 ms in 291 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 3322 ms) (average mu = 0.254, current mu [20368:00000209E3C2B160] 40386 ms: Mark-sweep (reduce) 4093.1 (4104.9) -> 4092.7 (4105.2) MB, 5489.4 / 0.1 ms (average mu = 0.102, current mu = 0.000) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
1: 00007FF7AF4F428F napi_wrap+133311
2: 00007FF7AF48DE66 SSL_get_quiet_shutdown+63062
3: 00007FF7AF48ECFD node::OnFatalError+301
4: 00007FF7AFD71B2E v8::Isolate::ReportExternalAllocationLimitReached+94
5: 00007FF7AFD5691D v8::SharedArrayBuffer::Externalize+781
6: 00007FF7AFC0012C v8::internal::Heap::EphemeronKeyWriteBarrierFromCode+1516
7: 00007FF7AFBEABAB v8::internal::NativeContextInferrer::Infer+59739
8: 00007FF7AFBCFE7F v8::internal::MarkingWorklists::SwitchToContextSlow+56975
9: 00007FF7AFBE3B6B v8::internal::NativeContextInferrer::Infer+31003
10: 00007FF7AFBDAC4D v8::internal::MarkCompactCollector::EnsureSweepingCompleted+6285
11: 00007FF7AFBE2DBE v8::internal::NativeContextInferrer::Infer+27502
12: 00007FF7AFBE6E0B v8::internal::NativeContextInferrer::Infer+43963
13: 00007FF7AFBF0802 v8::internal::ItemParallelJob::Task::RunInternal+18
14: 00007FF7AFBF0791 v8::internal::ItemParallelJob::Run+641
15: 00007FF7AFBC3DF3 v8::internal::MarkingWorklists::SwitchToContextSlow+7683
16: 00007FF7AFBDB0FC v8::internal::MarkCompactCollector::EnsureSweepingCompleted+7484
17: 00007FF7AFBD9934 v8::internal::MarkCompactCollector::EnsureSweepingCompleted+1396
18: 00007FF7AFBD74A8 v8::internal::MarkingWorklists::SwitchToContextSlow+87224
19: 00007FF7AFC05F11 v8::internal::Heap::LeftTrimFixedArray+929
20: 00007FF7AFC08005 v8::internal::Heap::PageFlagsAreConsistent+789
21: 00007FF7AFBFD221 v8::internal::Heap::CollectGarbage+2049
22: 00007FF7AFBFB425 v8::internal::Heap::AllocateExternalBackingStore+1349
23: 00007FF7AFC1B89B v8::internal::Factory::NewFillerObject+203
24: 00007FF7AF94A0E1 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator=+1409
25: 00007FF7AFDFCF5D v8::internal::SetupIsolateDelegate::SetupHeap+474253
26: 00000048464760F0
So I knew it was a syntax error because I didn't install any packages or make any changes to the project.
It turns out I found a code example.
<div class="p-field" *ngIf="column.fieldType =='date'">
<label [for]="column.field">{{column.header}}</label>
<p-calendar [id]="column.field"
[(ngModel)]="selectedItem[column.field] | date:'dd/MM/yyyy hh:mm a'"
[showIcon]="true" [required]="column.required" [name]="column.field">
</p-calendar>
</div>
If I remove the following from within ngModel, the code compiles.
| date:'dd/MM/yyyy hh:mm a'
I'm on Windows, trying to build the Rust documentation.
I cloned the Rust repository, copied the config.toml.example under the name config.toml and executed ./x.py doc but here is the error I get (with the RUST_BACKTRACE environment variable set to full):
~\source\repos\rust [master ≡]> ./x.py doc
~\source\repos\rust [master ≡]> Updating only changed submodules
Submodules updated in 0.08 seconds
Finished dev [unoptimized + debuginfo] target(s) in 0.41s
thread 'main' panicked at 'fs::read_dir(builder.src.join(&relative_path).join("redirects")) failed with The system cannot find the path specified. (os error 3)', src\bootstrap\doc.rs:243:21
stack backtrace:
0: 0x7ff7a88e481f - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
1: 0x7ff7a88e481f - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ff7a88e481f - std::sys_common::backtrace::_print_fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:67
3: 0x7ff7a88e481f - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:46
4: 0x7ff7a89029da - core::fmt::write
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\core\src\fmt\mod.rs:1110
5: 0x7ff7a88df148 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\io\mod.rs:1588
6: 0x7ff7a88e8356 - std::sys_common::backtrace::_print
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:49
7: 0x7ff7a88e8356 - std::sys_common::backtrace::print
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:36
8: 0x7ff7a88e8356 - std::panicking::default_hook::{{closure}}
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:208
9: 0x7ff7a88e7e39 - std::panicking::default_hook
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:225
10: 0x7ff7a88e89b5 - std::panicking::rust_panic_with_hook
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:622
11: 0x7ff7a88e85a1 - std::panicking::begin_panic_handler::{{closure}}
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:519
12: 0x7ff7a88e513f - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\sys_common\backtrace.rs:141
13: 0x7ff7a88e84f9 - std::panicking::begin_panic_handler
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:515
14: 0x7ff7a890ad7c - std::panicking::begin_panic_fmt
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:457
15: 0x7ff7a8166b14 - bootstrap::doc::{{impl}}::run
at C:\Users\jerome\source\repos\rust\src\bootstrap\doc.rs:243
16: 0x7ff7a8349024 - bootstrap::builder::Builder::ensure<bootstrap::doc::TheBook>
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:1563
17: 0x7ff7a81661a0 - bootstrap::doc::{{impl}}::make_run
at C:\Users\jerome\source\repos\rust\src\bootstrap\doc.rs:200
18: 0x7ff7a80eff44 - bootstrap::builder::StepDescription::maybe_run
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:181
19: 0x7ff7a80f0402 - bootstrap::builder::StepDescription::run
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:202
20: 0x7ff7a80f42b9 - bootstrap::builder::Builder::run_step_descriptions
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:610
21: 0x7ff7a80f3f7d - bootstrap::builder::Builder::execute_cli
at C:\Users\jerome\source\repos\rust\src\bootstrap\builder.rs:590
22: 0x7ff7a7f25950 - bootstrap::Build::build
at C:\Users\jerome\source\repos\rust\src\bootstrap\lib.rs:620
23: 0x7ff7a7f11773 - bootstrap::main
at C:\Users\jerome\source\repos\rust\src\bootstrap\bin\main.rs:33
24: 0x7ff7a7f127eb - core::ops::function::FnOnce::call_once<fn(),tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\core\src\ops\function.rs:227
25: 0x7ff7a7f126db - std::sys_common::backtrace::__rust_begin_short_backtrace<fn(),tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\sys_common\backtrace.rs:125
26: 0x7ff7a7f11101 - std::rt::lang_start::{{closure}}<tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\rt.rs:49
27: 0x7ff7a88e8f0a - core::ops::function::impls::{{impl}}::call_once
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\core\src\ops\function.rs:280
28: 0x7ff7a88e8f0a - std::panicking::try::do_call
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:401
29: 0x7ff7a88e8f0a - std::panicking::try
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panicking.rs:365
30: 0x7ff7a88e8f0a - std::panic::catch_unwind
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\panic.rs:434
31: 0x7ff7a88e8f0a - std::rt::lang_start_internal
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\/library\std\src\rt.rs:34
32: 0x7ff7a7f110df - std::rt::lang_start<tuple<>>
at /rustc/bf62f4de32a085c1080d9e77b1b73f1a8e42cce2\library\std\src\rt.rs:48
33: 0x7ff7a7f11d66 - main
34: 0x7ff7a8909ac4 - invoke_main
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
35: 0x7ff7a8909ac4 - __scrt_common_main_seh
at D:\agent\_work\9\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
36: 0x7fff5ee37034 - BaseThreadInitThunk
37: 0x7fff5f302651 - RtlUserThreadStart
Build completed unsuccessfully in 0:00:02
I tried under Ubuntu with WSL but I get the same error.
I tried Googling this error but found nothing and the Rust Readme is saying nothing special except the command I ran
Could you please tell me what am I missing and how to build the documentation?
I'd like to end up with Markdown files so I can read the book on my phone while being offline.
Thanks for your answer
I checked the remote branches and saw a stable branch which I checked out.
I tried running again the command ./x.py doc and this time it worked well.
I saw they don't have any develop branch and all the Pull Requests on Github have the master as target branch. So it seems their master branch is what I usually call the develop branch at my work.
As of today the master branch seems a bit broken since building the documentation doesn't work but using the stable branch worked like a charm.
I try to implement this actix tracing_log logging solution which leads to panic
thread 'main' panicked at 'Failed to set logger: SetLoggerError(())', mytool/src/main.rs:112:23
stack backtrace:
0: rust_begin_unwind
at /rustc/18bf6b4f01a6feaf7259b/library/std/src/panicking.rs:475
1: core::panicking::panic_fmt
at /rustc/18bf6b4f01a6feaf7259b/library/core/src/panicking.rs:85
2: core::option::expect_none_failed
at /rustc/18bf6b4f01a6feaf7259b/library/core/src/option.rs:1221
3: mytool::main::{{closure}}
4: std::thread::local::LocalKey<T>::with
5: tokio::macros::scoped_tls::ScopedKey<T>::set
6: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
7: std::thread::local::LocalKey<T>::with
8: tokio::macros::scoped_tls::ScopedKey<T>::set
9: tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on
10: tokio::runtime::context::enter
11: tokio::runtime::handle::Handle::enter
12: actix_rt::builder::SystemRunner::block_on
13: mytool::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Panic in Arbiter thread.
backtrace isn't clear about implications - how to figure out why panic?
this article mentions that LogTracer::init() should be done first thing in main. Doing so lead to following panic
thread 'main' panicked at 'Builder::init should not be called after logger initialized: SetLoggerError(())', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/env_logger-0.6.2/src/lib.rs:715:25
stack backtrace:
...
apparently there was an env_logger initialized further down, which interfered with LogTracer
Removing the env_logger fixed the issue.
Kia ora,
I exported all my GPX files from Strava so I could do some analysis on them and am stuck trying to figure out what type of activity each file is for.
My file looks like this, for example, where the <type> element seems to define the activity type.
<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="StravaGPX iPhone" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd" version="1.1" xmlns="http://www.topografix.com/GPX/1/1">
<metadata>
<time>2014-03-21T22:44:39Z</time>
</metadata>
<trk>
<name>Sugar Loaf</name>
<type>9</type>
<trkseg>
...
I know (in my head) that the activity was a run, but I cannot find any documentation of all the numbers and their corresponding activity types.
Strava says:
Strava strives to comply with the FIT Activity File (FIT_FILE_TYPE = 4) spec as defined in the official FIT SDK.
That is great, but if I interrogate the FIT SDK I can find the following in the fit_profile.hpp file:
typedef FIT_ENUM FIT_SPORT;
#define FIT_SPORT_INVALID FIT_ENUM_INVALID
#define FIT_SPORT_GENERIC ((FIT_SPORT)0)
#define FIT_SPORT_RUNNING ((FIT_SPORT)1)
#define FIT_SPORT_CYCLING ((FIT_SPORT)2)
#define FIT_SPORT_TRANSITION ((FIT_SPORT)3) // Mulitsport transition
#define FIT_SPORT_FITNESS_EQUIPMENT ((FIT_SPORT)4)
#define FIT_SPORT_SWIMMING ((FIT_SPORT)5)
#define FIT_SPORT_BASKETBALL ((FIT_SPORT)6)
#define FIT_SPORT_SOCCER ((FIT_SPORT)7)
#define FIT_SPORT_TENNIS ((FIT_SPORT)8)
#define FIT_SPORT_AMERICAN_FOOTBALL ((FIT_SPORT)9)
#define FIT_SPORT_TRAINING ((FIT_SPORT)10)
#define FIT_SPORT_WALKING ((FIT_SPORT)11)
...
I can also find in that same fit_profile.hpp file:
#define FIT_FILE_ACTIVITY ((FIT_FILE)4) // Read/erase, multiple files. Directory=Activities
Which would confirm to me that it is indeed an activity file.
Does anyone know where I can find a reference for these integers?
By experimentation, I’ve produced this list.
1: Ride
2: Alpine Ski
3: Backcountry Ski
4: Hike
5: Ice Skate
6: Inline Skate
7: Nordic Ski
8: Roller Ski
9: Run
10: Walk
11: Workout
12: Snowboard
13: Snowshoe
14: Kitesurf
15: Windsurf
16: Swim
17: Virtual Ride
18: E-Bike Ride
19: Velomobile
21: Canoe
22: Kayaking
23: Rowing
24: Stand Up Paddling
25: Surfing
26: Crossfit
27: Elliptical
28: Rock Climb
29: Stair-Stepper
30: Weight Training
31: Yoga
51: Handcycle
52: Wheelchair
53: Virtual Run
I suspect 20 is for sailing, but Strava won’t let me set any of my activities to sailing to check.