Author Topic: [solved] WeiDU triggers "Too many open files" error with COPY_EXISTING_REGEXP  (Read 1620 times)

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Original post: http://gibberlings3.net/forums/index.php?showtopic=29055&p=257456

The following code snippet seems to fail on OS X in an EET installation with a "Too many open files" error:
Code: [Select]
OUTER_TEXT_SPRINT folder_input ~%MOD_FOLDER%/temp/in~
MKDIR ~%folder_input%~
COPY_EXISTING_REGEXP + ~.+\.pvrz~ ~%folder_input%~

Full error message:
Code: [Select]
Copying 7185 files ...
ERROR: COPY ~B070000.PVRZ~ ~A7-CopyTest/temp/in/B070000.PVRZ~ FAILED: cannot open target
Stopping installation because of error.

ERROR Installing [Mass copy test], rolling back to previous state
WARNING: Unable to write tlk-path uninstall info to [A7-CopyTest/backup/0/TLKPATH.0]: Sys_error("A7-CopyTest/backup/0/TLKPATH.0: Too many open files")
Will uninstall 0 files for [A7-COPYTEST/SETUP-A7-COPYTEST.TP2] component 0.
Uninstalled 0 files for [A7-COPYTEST/SETUP-A7-COPYTEST.TP2] component 0.
ERROR: Sys_error("A7-CopyTest/temp/in/B070000.PVRZ: Too many open files")
« Last Edit: December 14, 2017, 11:04:32 AM by Argent77 »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
No idea. I assume this code works on not-macOS with an equal number of files?

COPY loads the file with Util.load_file, which raises an intended-to-be fatal exception if it can't close the file. The buffer is later written by this code, which is printing the error and raising the exception in this case. The out file is also closed properly.

(Incidentally, both of the aforementioned exceptions are among those unsafe exceptions I was warning about a while back; using TRY to catch these exception and not terminating the installation would result in the mod continuing on, with the file remaining open.)

Edit: fixed code tag.
« Last Edit: December 05, 2017, 12:44:15 PM by Wisp »

Offline AstroBryGuy

  • Planewalker
  • *****
  • Posts: 154
  • Gender: Male
Argent77 - What version of macOS are you running? Apple set the maxfiles on Sierra/High Sierra to 256(!?!) files per process.

This post has instructions for increasing the maxfiles settings in Sierra/High Sierra.

https://content.nanobox.io/fixing-too-many-open-files-in-macos/

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
This bug report was based on feedback from subtledoctor (see link in first post). I can't even run the binary that is executed by the mod in question on my own OSX system anymore. I'm using Mac OS X 10.7.4 (Lion) on a virtual machine, which is only good for compiling and testing stuff.

Offline subtledoctor

  • Planewalker
  • *****
  • Posts: 131
It's been solved, looks like a problem in MacOS Sierra, not in Weidu.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: