# Reason of SEGV in strlen () from /lib/libc.so.7



## kenorb (Nov 17, 2010)

This is general question of the common problem with /lib/libc.so.7 which do SEGV in strlen()
Why does it do SEGV?
http://www.google.co.uk/search?q="strlen+()+from+%2Flib%2Flibc.so.7" (1,470 results)
I understand from C perspective that the NULL is passed, but why libc.so can't check for passed NULLs and it should solve all the problems with software crashes.

Examples:
http://forums.freebsd.org/showthread.php?t=19387&highlight=strlen
http://forums.freebsd.org/showpost.php?p=56576&postcount=23&highlight=strlen
http://forums.freebsd.org/showthread.php?p=110591

Any main reason that it crashing and can't be fixed from the root? It will save a lot of time.


----------



## SirDice (Nov 17, 2010)

kenorb said:
			
		

> Any main reason that it crashing and can't be fixed from the root? It will save a lot of time.


I'd say start writing the IEEE and have them change the POSIX standard.

None of the functions in the standard C library check their inputs. That's the programmer's job.


----------



## DutchDaemon (Nov 17, 2010)

This topic has been closed. Issues as technical or detailed as this should not be discussed in general user-oriented forums like The FreeBSD Forums. These forums are intended for end-user support with installing and/or running FreeBSD and/or applications from the ports tree, not for routinely resolving low-level problems with the operating system or add-on applications. Developers and port maintainers usually do not spend much time here, and we routinely refer technically detailed questions to them.

Consider opening this topic elsewhere, e.g.:

In the case of *the FreeBSD base system*:

1) by posting to one of the relevant mailing lists
2) by opening a bug report

In the case of *ported applications*:

1) by contacting the port maintainer (run make maintainer in the port directory)
2) by opening a bug report


----------

