Extended use of PAC causes instant crashes? - PAC Backup System causes crashes.
For a while I've been having this issue, where PAC crashes to desktop outright with seemingly no known cause to why it happens. The screenshot above is the only thing I managed to capture.
I have no idea what is causing this, but it always happens to me and apparently nobody else that I know of. It has become exceedingly annoying and is present in both master and develop branch.
Edit: Additional information added. See comments below.
The 'not enough memory' message there makes it clear you're out of RAM
That's a good point, tho this pc has 16 GB of RAM. This should NOT be happening whatsoever. In that case there must be a memory leak going on
x86 gmod is limited to 3GB of RAM. You could try x64 beta gmod to see if that solves the issue.
Hm, been a while since I used the x64 beta gmod since I don't play any beta versions. It's the one called x86-64 - Chromium IIRC, will test later and see if there's any difference.
Pardon for necro-posting, but I have additional information that may be worth to look into.
It turns out it may be the backup system for pac causing these mysterious crashes on my end. I managed to capture a clear view of the error message that usually is shown, before crashing straight to desktop (see below)

Following the trail, it appears this string of code is what causes these issues. (see below)
(From the master branch, located in pac3/lua/pac3/editor/client/parts.lua)
For whatever reason, the backup system fails and the issue persists across workshop, master and develop branch.
This error is expected if your lua state is full of memory. That doesn't make pac the cause of your lua state being full. I took a look at pace.Backup and didn't see any leaks.
This error is expected if your lua state is full of memory. That doesn't make pac the cause of your lua state being full. I took a look at pace.Backup and didn't see any leaks.
I am unsure what you are speaking of regarding "lua state", please explain.
Every single crash I've had through gmod the past 6 months is entirely because of PAC. I've even tried using it with NO ADDONS on except PAC. Same results every time - crash to desktop.
Dead certain it's a problem with the backup system here.
You could try turning off backups maybe? add do return end at line 221 in your screenshot and see if it happens then
You could try turning off backups maybe? add
do return endat line 221 in your screenshot and see if it happens then
I will give it a try
You could try turning off backups maybe? add
do return endat line 221 in your screenshot and see if it happens thenI will give it a try
Doing this caused PAC to become completely unusable. I cannot attach parts to other bones on a playermodel, nor can I edit any settings on models, bones etc except position and angles (including positionoffset and angleoffset).
Yeah an early return there is not good. On line 219 change if not not_from_editor then to if false then
Yeah an early return there is not good. On line 219 change
if not not_from_editor thentoif false then
Alright, will try this.
Edit: Do I keep the return? Because without it, backups are created when saving only. Or maybe that's intentional?
Yeah an early return there is not good. On line 219 change
if not not_from_editor thentoif false thenAlright, will try this.
Edit: Do I keep the return? Because without it, backups are created when saving only. Or maybe that's intentional?
Noticed one thing off the bat with the current setup: Things are running much smoother than before, there are no backups generated when making changes to a PAC, right up until you save. It also removed other issues, such as gmod freezing periodically after making a change.
Overall, the editor feels a lot smoother to work in now. Now for the test run
Noticed one thing off the bat with the current setup: Things are running much smoother than before, there are no backups generated when making changes to a PAC, right up until you save. It also removed other issues, such as gmod freezing periodically after making a change.
Overall, the editor feels a lot smoother to work in now. Now for the test run
I have been using pac for 3-4 hours straight, editing large and complex ones and so far, not a single crash has been encountered where I run out of memory. Not sure what else to say about this.
So, after editing the code back to normal and using a clean data directory, it has been noted down that each time you edit a part (such as hiding it), it takes a second for a backup to be generated. This process creates lag that freezes gmod a second or more afterwards. Eventually a crash is bound to happen.
The outfit used for the experiment: ball spam.txt
It's the undo system, not backups. Or probably both. Someone will need to investigate why it's so terrible if that's creating lag.
util.TableToJson is most likely the slow point
https://github.com/CapsAdmin/pac3/blob/develop/lua/pac3/editor/client/undo.lua#L93
Is it known if this memory leak issue can also cause the source-engine crash message "ed.alloc: no free edicts", it seems from the evidence so far that it could also be related to the issue as this crash is also related to memory handling.
Is it known if this memory leak issue can also cause the source-engine crash message "ed.alloc: no free edicts", it seems from the evidence so far that it could also be related to the issue as this crash is also related to memory handling.
From the crashes I've had, never gotten this message personally.