Bad Magic Number

Hi,

this morning i had problem with Asterisk, i restarted the server and everything now is working properly.
The last message i read is: bad magic number 0x41 for 0x15f7038
What does it mean?

Thanks,
Davide

Memory has been corrupted.

This will be a secondary fault, and can happen some time after the primary fault. Look for errors earlier in the logs.

If it is not repeatable, you may find it is almost impossible to debug.

Hi David,

thanks for you reply, iI verified but there are no other Error before that error i posted.

Thanks,
Davide

Hi,

this morning Asterisk was down and in the log i found this error:

[Nov 14 23:52:52] ERROR[20871] astobj2.c: bad magic number 0x31 for 0x1a7c268
[Nov 14 23:52:52] WARNING[20871] chan_sip.c: Weird, couldn’t find packet owner!
[Nov 14 23:52:52] ERROR[20871] astobj2.c: bad magic number 0xffffffff for 0x1a7c268

What does it mean?

Best regards,
Davide

As already note, it is memory corruption, either due to a bug in the code or a machine fault.

Part of the code has been given a pointer to an internal data structure and that data structure should have a particular value at a particular offset, to confirm it is the right type of data structure. That has proved not to be the case.

This means that one of:

  • the data structure has been overwritten whilst it is still active;
  • the code is still using a pointer to a data structure that some other part of the code has freed, because it thought it was no longer needed;
  • the code is using a pointer which itself has been overwritten.

atobj2 is a library that handles the allocation of memory for data structures and should do the reference counting needed to avoid freeing memory too soon.

The fact that you need to ask indicates that you don’t have the skills to aggressively debug this, so, unless you are using a current, standard, version of the software, and you can either reproduce this fault on demand, or there is a clear indication of something going wrong leading up to these errors, there is probably little you can do. If you can reproduce it easily or have more evidence, and it is a supported standard version, you should report it on the issue tracker.