mirror of
https://github.com/nmap/nmap.git
synced 2026-06-29 04:33:23 +00:00
Always release memory
This commit is contained in:
parent
236a392cf0
commit
ff028e681f
13 changed files with 6 additions and 128 deletions
|
|
@ -1,5 +1,8 @@
|
|||
#Nmap Changelog ($Id$); -*-text-*-
|
||||
|
||||
o The --release-memory option is now a no-op. Nmap will always run finalization
|
||||
routines that release allocated memory before closing.
|
||||
|
||||
o Fixed an integer underflow in service_scan.cc that would cause little-endian
|
||||
integers extracted from the beginning of a service banner to be interpreted
|
||||
as 0. Discovered with AFL++ by Malek Althubiany.
|
||||
|
|
|
|||
|
|
@ -315,7 +315,6 @@ void NmapOps::Initialize() {
|
|||
ipoptionslen = 0;
|
||||
ipopt_firsthop = 0;
|
||||
ipopt_lasthop = 0;
|
||||
release_memory = false;
|
||||
topportlevel = -1;
|
||||
#ifndef NOLUA
|
||||
script = false;
|
||||
|
|
|
|||
|
|
@ -339,7 +339,6 @@ class NmapOps {
|
|||
bool noninteractive;
|
||||
char *locale;
|
||||
|
||||
bool release_memory; /* suggest to release memory before quitting. used to find memory leaks. */
|
||||
private:
|
||||
int max_os_tries;
|
||||
int max_rtt_timeout;
|
||||
|
|
|
|||
|
|
@ -4075,21 +4075,6 @@ gesetzt werden.</para>
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (gibt Speicher vor Terminierung frei)
|
||||
<indexterm><primary><option>--release-memory</option></primary></indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
|
||||
<para>Diese Option ist nur bei der Suche nach Speicherlecks nützlich.
|
||||
Sie bewirkt, dass Nmap den von ihm belegten Speicher direkt vor seiner
|
||||
Terminierung freigibt, damit man echte Speicherlecks einfacher finden kann.
|
||||
Normalerweise macht Nmap das nicht, weil es das Betriebssystem ohnehin
|
||||
macht, wenn es den Prozess terminiert.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (gibt Versionsnummer aus)
|
||||
|
|
|
|||
|
|
@ -2112,18 +2112,6 @@ le temps supplémentaire que cela suppose.</para>
|
|||
<option>--unprivileged</option>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (Libérer la mémoire avant de quitter)
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Cette option n'est utile que dans le cadre du deboggage de fuites de mémoire.
|
||||
Elle force Nmap a libérer la mémoire allouée juste avant de
|
||||
quitter de facon a repérer les véritables fuites de mémoire.
|
||||
En temps normal Nmap ne fait pas ceci étant donné que l'OS le fait de toutes facons
|
||||
à la fin du processus.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (Affiche le numéro de version)
|
||||
|
|
|
|||
|
|
@ -3459,22 +3459,6 @@ kapuk csak egy számként jelennek meg, ha túl sok van belőlük.
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (Kilépés előtt felszabadítja a memóriát)
|
||||
<indexterm significance="normal"><primary>--release-memory</primary></indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
|
||||
<para>Ez a paraméter csak a memóriaszivárgási hibák keresésekor hasznos.
|
||||
Arra utasítja az Nmap programot, hogy a kilépés előtt szabadítsa fel a
|
||||
lefoglalt memóriát, így a memóriaszivárgás könnyen felderíthető. Normál
|
||||
helyzetben az Nmap átugorja ezt, mivel a program leállításakor az operációs
|
||||
rendszert ezt amúgy is végrehajtja.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (Programváltozat megjelenítése)
|
||||
|
|
|
|||
|
|
@ -3755,22 +3755,6 @@ banyaknya permintaan. Berikan <option>--open</option> untuk hanya melihat port
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (Release memory before quitting)
|
||||
<indexterm significance="normal"><primary><option>--release-memory</option></primary></indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
|
||||
<para>Opsi ini hanya berguna untuk memory-leak debugging.
|
||||
Ia membuat Nmap merilis memori yang telah dialokasikan sebelum ia berhenti
|
||||
sehingga kebocoran memori sebenarnya mudah ditemukan.
|
||||
Normalnya Nmap melewati langkah ini karena SO melakukannya setelah
|
||||
penghentian proses.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (Print version number)
|
||||
|
|
|
|||
|
|
@ -4343,20 +4343,6 @@ SEE THE MAN PAGE (https://nmap.org/book/man.html) FOR MORE OPTIONS AND EXAMPLES
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--release-memory </option>(Release memory before
|
||||
quitting)</term>
|
||||
|
||||
<listitem>
|
||||
<para>Quest'opzione è utile solo per la risoluzione di problemi di
|
||||
perdita di memoria (memory-leak debugging). Obbliga infatti ad Nmap
|
||||
a liberare la memoria allocata appena prima di uscire così da
|
||||
individuare più facilmente le effettive perdite di memoria. Di
|
||||
solito Nmap salta questo passaggio come fa il sistema operativo in
|
||||
ogni caso al momento della chiusura del processo.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-V</option>; <option>--version</option> (Print version
|
||||
number)</term>
|
||||
|
|
|
|||
|
|
@ -1362,7 +1362,7 @@ rttvar: 14987 to: 100000</computeroutput>。こうした行の内容が理解で
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<!-- Missing options: -/-unprivileged -/-release-memory -->
|
||||
<!-- Missing options: -/-unprivileged -->
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (バージョン番号を表示する)
|
||||
|
|
|
|||
|
|
@ -3554,24 +3554,6 @@ EXAMPLES:
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--release-memory</option> (Release memory before
|
||||
quitting)</term>
|
||||
|
||||
<listitem>
|
||||
<indexterm significance="normal">
|
||||
<primary>--release-memory</primary>
|
||||
</indexterm>
|
||||
|
||||
<para>Esta opção é útil apenas para depuração de vazamentos de
|
||||
memória (memory-leak). Ela faz com que o Nmap libere memória
|
||||
alocada pouco antes de encerrar de forma a tornar os vazamentos de
|
||||
memória reais mais fáceis de se ver. Normalmente o Nmap pula essa
|
||||
parte pois o SO faz isso de qualquer forma no encerramento de um
|
||||
processo.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-V</option>; <option>--version</option> (Mostra o
|
||||
número da versão)</term>
|
||||
|
|
|
|||
|
|
@ -3295,20 +3295,6 @@ rttvar: 14987 to: 100000</computeroutput>. Если вы не понимаете
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (Освободить память перед завершением работы)
|
||||
<indexterm significance="normal"><primary><option>--release-memory</option></primary></indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
|
||||
<para>Эта опция полезна только во время отладки утечки памяти. Заставляет Nmap освободить занянутю память
|
||||
перед завершением работы, что облегчает задачу обнаружения действительной утечки памяти. В обычном режиме
|
||||
работы Nmap пропускает этот шаг, так ОС делает это самостоятельно при закрытии процесса.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (Вывести номер версии)
|
||||
|
|
|
|||
|
|
@ -4488,22 +4488,6 @@ hosts with at least one
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>--release-memory</option> (Release memory before quitting)
|
||||
<indexterm><primary><option>--release-memory</option></primary></indexterm>
|
||||
</term>
|
||||
<listitem>
|
||||
|
||||
<para>This option is only useful for memory-leak debugging.
|
||||
It causes Nmap to release allocated memory just before it
|
||||
quits so that actual memory leaks are easier to spot.
|
||||
Normally Nmap skips this as the OS does this anyway upon
|
||||
process termination.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<option>-V</option>; <option>--version</option> (Print version number)
|
||||
|
|
|
|||
6
nmap.cc
6
nmap.cc
|
|
@ -728,7 +728,7 @@ void parse_options(int argc, char **argv) {
|
|||
} else if (strcmp(long_options[option_index].name, "nogcc") == 0) {
|
||||
o.nogcc = true;
|
||||
} else if (strcmp(long_options[option_index].name, "release-memory") == 0) {
|
||||
o.release_memory = true;
|
||||
/* No-op. We always release memory now. */
|
||||
} else if (strcmp(long_options[option_index].name, "min-parallelism") == 0) {
|
||||
o.min_parallelism = atoi(optarg);
|
||||
if (o.min_parallelism < 1)
|
||||
|
|
@ -2371,9 +2371,7 @@ int nmap_main(int argc, char *argv[]) {
|
|||
|
||||
eth_close_cached();
|
||||
|
||||
if (o.release_memory) {
|
||||
nmap_free_mem();
|
||||
}
|
||||
nmap_free_mem();
|
||||
if (o.resuming) {
|
||||
arg_parse_free(argv);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue