jgigault / 42FileChecker

42FileChecker is a tiny bash script developed at 42 school for testing and checking files according to the rules of the subjects
Apache License 2.0
303 stars 56 forks source link

[ft_printf] [leaks] unknown argument #105

Open FirelightFlagboy opened 6 years ago

FirelightFlagboy commented 6 years ago

42Checker n'arrive pas a tester les fuite sur printf avec la command leaks voici le fichier que donne 42checker quand il test les leaks sur printf : myleaks.txt

Seluj78 commented 6 years ago

Pour ceux que ca interessent, j'ai arrange le fichier texte imbuvable oneline :

Here is the main() 
test:\n-----------------------------\n#include <string.h>
int ft_printf(char const *str, ...);

int main(void)
{

  ft_printf("\\n");

  ft_printf("%%\\n");

  ft_printf("%d\\n", 42);

  ft_printf("%d%d\\n", 42, 41);

  ft_printf("%d%d%d\\n", 42, 43, 44);

  ft_printf("%ld\\n", 2147483647);

  ft_printf("%lld\\n", 9223372036854775807);

  ft_printf("%x\\n", 505);

  ft_printf("%X\\n", 505);

  ft_printf("%p\\n", &ft_printf);

  ft_printf("%20.15d\\n", 54321);

  ft_printf("%-10d\\n", 3);

  ft_printf("% d\\n", 3);

  ft_printf("%+d\\n", 3);

  ft_printf("%010d\\n", 1);

  ft_printf("%hhd\\n", 0);

  ft_printf("%jd\\n", 9223372036854775807);

  ft_printf("%zd\\n", 4294967295);

  ft_printf("%\\n");

  ft_printf("%U\\n", 4294967295);

  ft_printf("%u\\n", 4294967295);

  ft_printf("%o\\n", 40);

  ft_printf("%%#08x\\n", 42);

  ft_printf("%x\\n", 1000);

  ft_printf("%#X\\n", 1000);

  ft_printf("%s\\n", NULL);

  ft_printf("%S\\n", L"ݗݜशব);
  ft_printf("%s%s\\n", "test", "test");

  ft_printf("%s%s%s\\n", "test", "test", "test");

  ft_printf("%C\\n", 15000);

  while (1);

  return (0);

}
\n-----------------------------\n\n\n
[invalid usage]: unknown argument: 92173

leaks: Search through a process for leaked memory.

Usage: leaks [-hq] [--nocontext] [--nostacks] [--outputGraph=<path>] [--fullContent] [--forkCorpse] [--trace=<address>] [--atExit] <pid | partial-process-name | memory-graph-file | -- process-and-arguments>

    -e/--exclude <sym>     exclude leaked blocks whose backtraces include the specified symbol

-h/--help              show this helpful usage message!

-q/--quiet             suppress the process description header and footer

--nocontext            do not print the binary contexts of discovered leaks

--nostacks             do not print backtraces or save them in the memory graph file, even when available

--nosources            do not show sourceFile:lineNumber in backtraces

--outputGraph=<path>   save a memory graph file into the given directory or file

--fullContent          save allocation content descriptions into the memory graph file

--forkCorpse           generate a corpse fork from process and run leaks on it

--atExit               Launches the specified process and runs leaks when the process exits.  The process to launch must be the end of the command, and proceeded by '--'

--trace=<address>      print chains of references from process 'roots' (e.g., global data) to the given block

--traceTree=<address>  print a reverse tree of references, from the given block up to the process roots; can be imported into Instruments with Import Sampler Data

De ce que je comprends tu as utilise une version de leaks differente de celle utilisee d'habitude parce que leaks semble ne pas apprecier le PID que 42fc lui donne

Seluj78 commented 6 years ago

@FirelightFlagboy Possible d'avoir ton OS, la version de leaks et la commande executee ?

FirelightFlagboy commented 6 years ago
Process:         minishell [13488]
Path:            /Users/fbenneto/repo/minishell/minishell
Load Address:    0x106e80000
Identifier:      minishell
Version:         ???
Code Type:       X86-64
Parent Process:  zsh [95616]

Date/Time:       2018-02-06 09:22:57.631 +0100
Launch Time:     2018-02-06 09:22:47.603 +0100
OS Version:      Mac OS X 10.12.6 (16G1212)
Report Version:  7
Analysis Tool:   /Applications/Xcode.app/Contents/Developer/usr/bin/leaks
Analysis Tool Version:  Xcode 9.1 (9B55)
----

leaks Report Version:  2.0
Process 13488: 239 nodes malloced for 15 KB
Process 13488: 0 leaks for 0 total leaked bytes.

@Seluj78 en espérant que ce te seras utile