fulup-bzh / AlsaJsonGateway

HTTP REST/JSON Gateway to ALSA mixer service for HTML5 UI
53 stars 5 forks source link

Fix session store segfaults #14

Closed lazzarello closed 4 years ago

lazzarello commented 4 years ago

the localtime() function was causing segfaults on my system, so I commented them out. it seems mostly informational, not functional to operation so the API works at those points again.

This also removes some calls to json_object_put() which caused segfaults and didn't seem to do anything I could understand.

fulup-bzh commented 4 years ago

Thank you the contribution. While I merge it to solve your issue, I'm a afraid that this hide something more complexe, no reason for localtime() fonction to break a system. Running alsajsongatreway on your system with Walgrin or Electricfence may show a memory bug somewhere else.

lazzarello commented 4 years ago

Thanks for the merge! I agree that it seems unusual that something simple like localtime() will segfault but I stepped through with gdb and that's def the culprit. It is called elsewhere successfully, so it might have something to do with the interaction with strftime() not sure. Removing that step to output the modified time on the session file fixed the crash. Not sure where the functionality is for that data on the front end. Might be easier to put it in the JSON contents and output from there?

fulup-bzh commented 4 years ago

Until it works, everything is fine :+1: