Debugging a Program With dbx

Misaligned Write (maw)


Problem: Attempt to write data to an address without proper alignment.
Possible causes: Writing 2, 4, or 8 bytes to an address that is not half-word-aligned, word-aligned, or double-word-aligned, respectively.
		char *s = "hello world";
		int *i = (int *)&s[1];

		*i = 0;					/* Misaligned write (maw) */