Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.alt.folklore.computer > #44500
| From | ram@zedat.fu-berlin.de (Stefan Ram) |
|---|---|
| Newsgroups | de.alt.folklore.computer |
| Subject | Re: Triumph of the Nerds |
| Date | 2024-05-05 14:34 +0000 |
| Organization | Stefan Ram |
| Message-ID | <Stapel-20240505152650@ram.dialup.fu-berlin.de> (permalink) |
| References | (9 earlier) <Layer-20240502200849@ram.dialup.fu-berlin.de> <l9ku8lF7n2pU4@mid.individual.net> <v14u0g.4hk.1@stefan.msgid.phost.de> <l9p8fuFrft6U1@mid.individual.net> <sicher-20240505123956@ram.dialup.fu-berlin.de> |
ram@zedat.fu-berlin.de (Stefan Ram) schrieb oder zitierte:
>poc@pocnet.net schrieb oder zitierte:
>>Vielleicht ist das blauäugug von mir, aber ich bin mir sicher, dass man auch
>>in C sauber und sicher programmieren kann.
>Diese Meinung sollte jeder teilen, der eine Sprache wie Python
>empfiehlt, denn Python /ist/ ja in C geschrieben. Wenn es nicht
Aber ich meine, daß es zum Beispiel in Standard-C nicht gesagt
wird, wieviel Stapel überhaupt zur Verfügung steht [1].
Dadurch hat man schon ein ernsthaftes Problem.
Und Python hat dieses Problem in gewissem Sinne von C geerbt [2].
Damit sind diese Sprachen nicht /per se/ "sicher", aber eine
bestimmte Implementation von C oder Python könnte diese
Probleme lösen, indem sie zusätzliche Garantien gibt.
Für die Frage, wie man "sicheren Code" schreibt, empfehle ich auch
einmal die Lektüre von [3] oder eine Beschäftigung mit /cleanroom
software engineering/ [4] (nicht zu verwechseln mit dem /cleanroom
engineering/ zur Vermeidung urheberrechtlicher Probleme).
[1]
|Unfortunately, the notion of stack overflow is not mentioned
|by the standard or the standard’s rationale at all. This is
|very troublesome, as for most actual implementations stack
|overflow is a real problem.
...
|in a real C implementation, a call like f(10000000) will not
|return 10000000, but instead will crash with a message like
|"segmentation fault". Furthermore, stack overflow does not
|necessarily have to result in a crash with a nice error
|message, but might also overwrite non-stack parts of the
|memory (possibly putting the address of virus code there).
|Stack overflow even can occur without function calls. For
|example, the program int main(void) { int a[10000000]; }
...
"Subtleties of the ANSI/ISO C standard" (2012); Robbert
Krebbers, Freek Wiedijk; Radboud University Nijmegen.
[2]
|sys.setrecursionlimit(limit)
|Set the maximum depth of the Python interpreter stack to
|limit. This limit prevents infinite recursion from causing an
|overflow of the C stack and crashing Python. The highest
|possible limit is platform-dependent. A user may need to set
|the limit higher when they have a program that requires deep
|recursion and a platform that supports a higher limit. This
|should be done with care, because a too-high limit can lead
|to a crash.
The Python Library Reference; Release 3.13.0a0
[3]
"They Write the Right Stuff" (1996) - Charles Fishman
[4]
Cleanroom Software Engineering ist ein theoriebasierter,
teamorientierter Prozess für die Entwicklung und
Zertifizierung von hochzuverlässiger Softwaresysteme unter
statistischer Qualitätskontrolle. Die Schlüsselpraktiken
des Cleanroom Software Engineering sind:
- Es werden formale Spezifikations- und Verifikationsmethoden
verwendet, um Software von ausreichender Qualität zu erstellen,
damit auf Programmiertests verzichtet werden kann.
Dahinter steht die Idee, daß es besser ist, die am häufigsten
auftretenden Fehler die am häufigsten auftreten, mit formalen
Methoden zu finden, anstatt sich auf Tests zu verlassen.
Es gibt keine Programmierertests, da der Schwerpunkt auf der
Fehlervermeidung durch rigorosen Entwurf und Verifizierung
und nicht auf Fehlerbeseitigung durch Testen liegt.
Die Software wird inkrementell entwickelt, wobei jedes Inkrement
eher einer Korrektheitsprüfung als einem Unit-Test unterzogen wird.
Der endgültigen Software wird statistisch bescheinigt, dass sie eine
bekannte und angestrebte mittlere Zeit bis zum Ausfall (MTTF) hat.
Cleanroom-Software-Engineering wurde bereits von Organisationen
wie NASA und IBM eingesetzt, um hochzuverlässige Software mit sehr
niedrigen Fehlerquoten zu entwickeln. So wies beispielsweise ein
85.000 Zeilen umfassendes IBM-COBOL-Programm eine Testfehlerrate
von nur 0,1 Fehlern pro 1.000 Codezeilen auf. Die wichtigsten
Vorteile sind eine verbesserte Softwarequalität, Produktivität und
Zuverlässigkeit durch die Konzentration auf Fehlervermeidung statt
Fehlerbeseitigung.
Back to de.alt.folklore.computer | Previous | Next | Find similar | Unroll thread
csiph-web