Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP running out of memory while executing ServerInterface.php (memory leak ?) using ice 3.7 and php 8.2 #77

Open
t0uch opened this issue Sep 12, 2024 · 6 comments

Comments

@t0uch
Copy link

t0uch commented Sep 12, 2024

Hello,

I've been using your software without any issues for several years using Ice 3.4 & php5 but i had to completely reinstall my setup because my distro (raspbian - debian 8) wasn't supported anymore and I couldn't update my mumble server to be compatible with mumble client 1.5+
My new setup uses Raspberry Pi OS (debian 12), apache2 v2.4, PHP v8.2 and Ice v3.7

Here is the apache error.log last line :

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4147642368 bytes) in ServerInterface.php on line 155

line 155 is :
$servers = $this->meta->getAllServers();

note that this error also triggers on line 131 :
$this->meta->getVersion($major, $minor, $patch, $text);
but i've managed to make it work by returning "1.5" directly as a string and commenting out the upper line which allowed me to get the homepage working
and it also triggers at line 204 :
$server = $this->meta->getServer(intval($srvid));
depending if I click either on "Login" or "Admin" button on the homepage.

I use default config in php.ini which sets the memory limit to 128M
I don't really see why it should need more ram to process a single mumble server (which has <10 channels and <10 concurrent users)
(and I didn't increased this value on my previous install, even though it was working)

Thanks for the help

@Kissaki
Copy link
Owner

Kissaki commented Sep 15, 2024

Hello,

yeah, that seems suspect. I don't see why it would hit such high limits.

@Kissaki
Copy link
Owner

Kissaki commented Sep 15, 2024

getServer returns a Server which doesn't even include a list of users or channels.

@Kissaki
Copy link
Owner

Kissaki commented Sep 15, 2024

How did you test getServer only? Did you comment out getAllServers?

@t0uch
Copy link
Author

t0uch commented Sep 15, 2024

I've only commented out the logic in the getVersion() function as I saw $this->version is a string so I could just return a handcrafted one:

	public function getVersion()
	{
	/* if ($this->meta != null && $this->version == null) {
			$this->meta->getVersion($major, $minor, $patch, $text);
			$this->version = $major . '.' . $minor . '.' . $patch . ' ' . $text;
		}
		return $this->version;
	*/
		return "1.5"; 
	}

But i'm absolutely not familiar with either Ice or mumble API and I have no idea of the expected return type for the getServers() or getServer($srvid) function. I haven't tested anything else because it feels beyond my knowledge.

With getVersion() "fixed", it allowed me to have the homepage working but then if I click on the Login or Register button, I get the php error line 155 (ie. within the getServers() function) and the Admin button triggers the error on line 204 (getServer() function)

@t0uch
Copy link
Author

t0uch commented Sep 16, 2024

The 3 times this error occurs, it's always when there is a call to the $this->meta property but I can't tell if the error occurs when accessing the poperty or affecting the result in a variable

@Kissaki
Copy link
Owner

Kissaki commented Sep 23, 2024

I wonder if it's a PHP Ice lib issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants