[HTML payload içeriği buraya]
26.6 C
Jakarta
Tuesday, November 26, 2024

Lengthy Applescript inflicting crash with segmentation fault


I’ve an Applescript script that I run as a batch in opposition to a photograph enhancing app (Seize One). It’s auto-generated by one other app and creates good collections out of a database of key phrases. It’s fairly lengthy and over time turns into longer and longer as a result of extra key phrases are added infrequently. In the mean time it is about 50k traces and 5MB lengthy. It is fairly sluggish to run (a number of hours), however that is one other matter (in any case I run it in a single day just a few occasions per yr). I have been operating it with out issues since a few years.

The script is principally an unrolled loop of about 3.600 iterations, each does principally the identical issues over totally different information. It has grown fairly a bit not too long ago as a result of I added just a few traces to compute estimated completion time. Now it appears it by no means completes, as a result of at a sure level (kind of 2/3 of the script, not at all times on the similar level) just a few unusual error messages are printed on the console (an excerpt right here):

Catalog 2024-11-23T00:57:01.192162Capture One received an error: Can’t make doc into sort integer.4-1700
make
group, Seize One received an error: Can’t make progress whole models into sort textual content., title, -1700
Catalog 2024-11-23T00:57:01.192162
«class prdt», Seize One received an error: Can’t make make into sort textual content., type, -1700
group

and shortly after a segmentation fault happens. I consider there’s some kind of reminiscence corruption, so the console output is meaningless. Inspecting the block of code the place the script crashes exhibits no points, and if I run the identical script once more the crash would possibly occur a bit earlier or later, so I the code shouldn’t be related.

The script is run by command line with osascript.

Is there any limitation to the lenght of an Applescript? Concepts? Workarounds? I anticipate that splitting the script or resuming from the purpose it stopped shouldn’t be a straightforward choice for me, for a variety of causes associated to Seize One APIs.

Thanks.

PS I’ve stated I do not assume code is related, anyway that is an iteration:

    attempt
      set progress textual content to "Importing: Workflow/workflow:revealed/workflow:revealed#twitter-weekly"
      inform _workflow_published to make assortment with properties {type:good album, title:"workflow:revealed#twitter-weekly", guidelines:"<?xml model="1.0" encoding="UTF-8"?><MatchOperator Variety="AND"><Situation Enabled="YES"><Key>IB_S_CONTENT_KEYWORDS</Key><Operator>6</Operator><Criterion>workflow:revealed#twitter-weekly</Criterion></Situation></MatchOperator>"}
      set progress accomplished models to 3670
      set ___elapsedtime to (present date) - ___basetime
      set ___ct to ___elapsedtime * 0.000272
      set ___completionTime to "" & (___ct div 60) & " minutes to finish"
      set ___eta to  time string of ((present date) + ___ct)
      set progress further textual content to "3670 / 3671 — 99% " & ___completionTime & " " & ___eta & ""
    on error errorMessage quantity errorNumber
      log "errorMessage: " & errorMessage & ", errorNumber: " & errorNumber
      log ">>>> key phrase: Workflow/workflow:revealed/workflow:revealed#twitter-weekly"
    finish attempt

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles