# Is SEGV is a bug?



## kenorb (Nov 16, 2010)

This is the abstract question:
*If the software do SEGV, it's a bug or not?*

Wiki says:


> SIGSEGV is the signal sent to a process when it makes an invalid memory reference, or segmentation fault.



Other example:
When user using non-existing option in console (or executing program in "different" way), what's the correct behavior:

```
> ping -b
ping: illegal option -- b
usage: ping [-AaDdfnoQqRrv]
```
or:

```
> ping -b
Segmentation fault
```
Both behaviors are correct (depends of company policy, or the second is a BUG?).

If it's a BUG, where it's defined that's the BUG?
What if SEGV could cause unexpected behavior by accessing invalid memory and could impact on system stability?
Is SEGV signal is for informing user that something is wrong, or informing programmer to fix it about the critical issue, which must be fixed?
If it's not a bug, that means all software can just disappearing or exiting with SEGV, and nobody/never will fix it, because nobody care about end users experience?
This is the standard approach of POSIX? Or definitely software BUG?
Expecting simple answer


----------



## SirDice (Nov 16, 2010)

kenorb said:
			
		

> This is the abstract question:
> *If the software do SEGV, it's a bug or not?*


Simple answer, yes.


----------



## kenorb (Nov 16, 2010)

SirDice said:
			
		

> Simple answer, yes.



Real example: http://bugs.mysql.com/bug.php?id=58209
with mysql-workbench-bin which is doing SEGV every time when I run.



			
				16 Nov 3:59 - Alfredo Kojima said:
			
		

> You're not supposed to run the -bin script directly, you must start WB using the
> mysql-workbench script.



That means they haven't got the right. They should definitely fix it if this still happening in the latest version?


----------



## SirDice (Nov 16, 2010)

Here's my view on it, when some condition hasn't been met or something isn't set correctly it should produce a proper and clear error message. A segfault just means some developer cut some corners and didn't do a proper check. In a multiuser, multitasking environment _everything_ you request (memory, files etc) must be verified. NEVER assume you got what you asked for.


----------



## nORKy (Nov 16, 2010)

Yeah, it's a bug.
I think there are 2 bug types :
- The "use bug" : The software don't use correctly datas
- The "creator bug" : The software don't create correctly datas


----------



## 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


----------

