[GH-ISSUE #88] CocoaSplit crashes when I write displayed text file #79

Open
opened 2026-05-05 15:05:18 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @gobzer on GitHub (Apr 8, 2020).
Original GitHub issue: https://github.com/zakk4223/CocoaSplit/issues/88

Hi,
CocoaSplit 2.1.12 crashes when displaying contents of a file being rewritten by an external process.
To reproduce:

  1. make file sample.txt write some text to it.
  2. Open CocoaSplit and add text file source. Source the text from sample.txt
  3. Run this script:

python2

cnt = 0
while True:
    cnt = cnt + 1
    f = open("sample.txt", "w")
    f.write(str(cnt))
    f.close()

CocoaSplit 2.1.12 should crash.

Rewriting text files by an external process is useful either for chat or donations.
I tried to do the same on OBS, but it doesn't crash.

Attached crash report and console messages.
crash_write_to_file.txt
console_write_to_file.txt

Originally created by @gobzer on GitHub (Apr 8, 2020). Original GitHub issue: https://github.com/zakk4223/CocoaSplit/issues/88 Hi, CocoaSplit 2.1.12 crashes when displaying contents of a file being rewritten by an external process. To reproduce: 1. make file sample.txt write some text to it. 2. Open CocoaSplit and add text file source. Source the text from sample.txt 3. Run this script: **python2** ``` cnt = 0 while True: cnt = cnt + 1 f = open("sample.txt", "w") f.write(str(cnt)) f.close() ``` CocoaSplit 2.1.12 should crash. Rewriting text files by an external process is useful either for chat or donations. I tried to do the same on OBS, but it doesn't crash. Attached crash report and console messages. [crash_write_to_file.txt](https://github.com/zakk4223/CocoaSplit/files/4449878/crash_write_to_file.txt) [console_write_to_file.txt](https://github.com/zakk4223/CocoaSplit/files/4450120/console_write_to_file.txt)
Author
Owner

@zakk4223 commented on GitHub (Apr 9, 2020):

Fixed in commit 16564b3780

I'll have a new release out in a day or two

<!-- gh-comment-id:611798824 --> @zakk4223 commented on GitHub (Apr 9, 2020): Fixed in commit 16564b3780a1767c826ae087a093085bc9f79dae I'll have a new release out in a day or two
Author
Owner

@gobzer commented on GitHub (Apr 13, 2020):

Yes. It's not crashing now. But sometimes it skips states.
For example. I count to infinity with a timed interval. On live view the the source sometimes becomes blank. Skips number or two:

import time
cnt = 0
while True:
    time.sleep(1)
    cnt = cnt + 1
    f = open("sample.txt", "w")
    f.write(str(cnt))
    f.close()
<!-- gh-comment-id:612877244 --> @gobzer commented on GitHub (Apr 13, 2020): Yes. It's not crashing now. But sometimes it skips states. For example. I count to infinity with a timed interval. On live view the the source sometimes becomes blank. Skips number or two: ``` import time cnt = 0 while True: time.sleep(1) cnt = cnt + 1 f = open("sample.txt", "w") f.write(str(cnt)) f.close() ```
Author
Owner

@zakk4223 commented on GitHub (Apr 17, 2020):

(Hopefully) fixed in commit db39e676f3

File change events were causing double updates of the CATextLayer, one of which was a nil string. Sometimes the layout render would hit during the blank phase. Removed the nil update part and it seems better behaved now

<!-- gh-comment-id:615483660 --> @zakk4223 commented on GitHub (Apr 17, 2020): (Hopefully) fixed in commit db39e676f3897aa01fcc8dd8b080d0913b7450e7 File change events were causing double updates of the CATextLayer, one of which was a nil string. Sometimes the layout render would hit during the blank phase. Removed the nil update part and it seems better behaved now
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/CocoaSplit#79
No description provided.