[asterisk-bugs] [JIRA] (ASTERISK-29040) Failed assertion bad magic number in res_speech

Nickolay V. Shmyrev (JIRA) noreply at issues.asterisk.org
Fri Aug 21 16:39:43 CDT 2020


Nickolay V. Shmyrev created ASTERISK-29040:
----------------------------------------------

             Summary: Failed assertion bad magic number in res_speech
                 Key: ASTERISK-29040
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29040
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Resources/res_speech
    Affects Versions: GIT
            Reporter: Nickolay V. Shmyrev


This issue has been raised many times, due to memory issues user often see in the logs with res_speech

[Feb 6 10:48:35] ERROR[17692][C-00000021] astobj2.c: FRACK!, Failed assertion bad magic number 0x0 for object 0x31990d8 (0)

Discussion here https://community.asterisk.org/t/astobj2-c-131-internal-obj-frack-failed-assertion-bad-magic-number/73439

The previous issue is https://issues.asterisk.org/jira/browse/ASTERISK-27986

The fix is not correct, the real issue seems that the new_speech->format variable is not bumped properly. best is released with RAII, format is release in ast_speech_destroy but it is never bumped.

In this code:

{code}
	RAII_VAR(struct ast_format *, best, NULL, ao2_cleanup);
        ......

	/* Can't forget the format audio is going to be in */
	new_speech->format = best;

	/* Pass ourselves to the engine so they can set us up some more and if they error out then do not create a structure */
	if (engine->create(new_speech, best)) {
		ast_mutex_destroy(&new_speech->lock);
		ast_free(new_speech);
		new_speech = NULL;
	}

/*! \brief Destroy a speech structure */
int ast_speech_destroy(struct ast_speech *speech)
{
         ...
	ao2_ref(speech->format, -1);
        ...
}
{code}





--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list