diff --git a/alib2common/src/debug/simpleStacktrace.cpp b/alib2common/src/debug/simpleStacktrace.cpp
index 794a41e69060df334c54f29a254aca66c26dcd62..4d1775f416e90f2f1f35fe72b7b485fa0192ef71 100644
--- a/alib2common/src/debug/simpleStacktrace.cpp
+++ b/alib2common/src/debug/simpleStacktrace.cpp
@@ -38,7 +38,11 @@ std::string simpleStacktrace(unsigned int max_frames) {
 
 	/* Now read the symbolic link */
 	ret = readlink(linkname, buf, 512);
-	buf[ret] = 0;
+	if ( ret < 0 ) {
+		strcpy(buf, "[UNKNOWN]");
+	} else {
+		buf[ret] = 0;
+	}
 
 	std::stringstream ss;
 	ss << "stack trace for process " << buf << " (PID:" << pid << "):"<< std::endl;
@@ -132,3 +136,4 @@ std::string simpleStacktrace(unsigned int max_frames) {
 }
 
 } /* namespace ext */
+