LKBEN11077: Posix error 14: Bad address
LKB | Created: 02/04/2020 | Version: 0 | Language: EN | Rating: 0 | Outdated: False | Marked for deletion: False
Author: Wim Peeters - Keskon GmbH & Co. KG
Symptom
You get the error message: Bad address
Cause
none
Solution
In C/C++ or Objective C programming an EFAULT is a bad buffer address... are you sure you've actually initialized this buffer to point to something valid? It's obviously a global or sometime... which itself is a pretty bad idea. You should allocate it in your function or it should be an ivar (if you're using Obj-C).
The POSIX error code 14 is called EFAULT, and it means you made a system call with an invalid pointer value. This is almost certainly some user-supplied buffer pointer to a read or write system call of some sort. Check all of the buffer pointers and make sure they're not NULL. Check the return value from malloc() - you might be failing to allocate a buffer.
Check on the file under /usr/include/asm/errno.h that contains a complete list of basic error codes.
# cat /usr/include/bits/errno.h
# cat /usr/include/asm-generic/errno.h
Bad address; an invalid pointer was detected. In the GNU system, this error never happens; you get a signal instead.
Shell Programming
ERROR IS "cat: write error: Bad address."
PS:
The Postfix "bad address syntax" has nothing to do with the EFAULT bad address!
About the Author
Wim Peeters is electronics engineer with an additional master in IT and over 30 years of experience including time spent in support, development, consulting, training and database administration. Wim has worked with SQL Server since version 6.5. He has developed in C/C++, Java and C# on Windows and Linux in different European countries and different European languages. He writes knowledge base articles to solve IT problems and publishes them on the Lubby Knowledge Platform where he is one of the most important contributors and the main developer.