From vineash30640 at gmail.com Thu May 11 15:48:28 2023 From: vineash30640 at gmail.com (=?UTF-8?B?546L5Yqg55uK?=) Date: Thu, 11 May 2023 22:48:28 +0800 Subject: [klee-dev] get the absolute path of file in InstructionInfo Message-ID: Hi, I have a question about the `const std::string &file` in `struct InstructionInfo`. From my observation, this `file` is always a relative path, regardless of whether the file is in klee-uclibc, klee runtime, or my own testing subjects. For example, we have: - runtime/POSIX/fd.c - ../lib/getopt.c - libc/string/strcmp.c This makes it difficult to analyze, especially in `run.istats`, as tools like kcachegrind cannot find the corresponding source code with relative paths. Is there a way to make the `file` absolute? Thanks, Jiayi -------------- next part -------------- HTML attachment scrubbed and removed From f.busse at imperial.ac.uk Sun May 21 11:55:01 2023 From: f.busse at imperial.ac.uk (Frank Busse) Date: Sun, 21 May 2023 11:55:01 +0100 Subject: [klee-dev] get the absolute path of file in InstructionInfo In-Reply-To: References: Message-ID: <20230521115501.19a0680d@haengemotte.localdomain> Hi Jiayi, On Thu, 11 May 2023 22:48:28 +0800 ??? wrote: > I have a question about the `const std::string &file` in `struct > InstructionInfo`. From my observation, this `file` is always a > relative path, regardless of whether the file is in klee-uclibc, klee > runtime, or my own testing subjects. For example, we have: > > - runtime/POSIX/fd.c > - ../lib/getopt.c > - libc/string/strcmp.c > > This makes it difficult to analyze, especially in `run.istats`, as > tools like kcachegrind cannot find the corresponding source code with > relative paths. Is there a way to make the `file` absolute? Either add a field for the directory to that struct (the directory is in the debug info, you can see it at the end of assembly.ll) or configure your kcachegrind to access those directories. I don't have it at hand currently but it's sth. like View -> Settings -> Directory Settings for Source Annotation. Kind regards, Frank From mcsinyx at disroot.org Tue May 23 08:38:25 2023 From: mcsinyx at disroot.org (=?utf-8?q?Nguy=E1=BB=85n_Gia_Phong?=) Date: Tue, 23 May 2023 16:38:25 +0900 Subject: [klee-dev] Use of -sym-stdin/stdout In-Reply-To: <2b05ec25-3219-c2a7-3c27-1a0275c52a85@imperial.ac.uk> Message-ID: On Tue Feb 9 11:33:00 GMT 2021, Cristian Cadar wrote: > printf is run concretely by default (you can add -DKLEE_SYM_PRINTF > when compiling KLEE's uclibc to change this) Do you recall the reason for that default, i.e. what are the potential drawbacks of enabling symbolic printf in KLEE's ?Clibc? From f.busse at imperial.ac.uk Tue May 23 18:05:00 2023 From: f.busse at imperial.ac.uk (Frank Busse) Date: Tue, 23 May 2023 18:05:00 +0100 Subject: [klee-dev] Use of -sym-stdin/stdout In-Reply-To: References: <2b05ec25-3219-c2a7-3c27-1a0275c52a85@imperial.ac.uk> Message-ID: <20230523180500.1ce839d5@gyali> Hi, On Tue, 23 May 2023 16:38:25 +0900 Nguy?n Gia Phong wrote: > Do you recall the reason for that default, > i.e. what are the potential drawbacks of enabling > symbolic printf in KLEE's ?Clibc? printf has to transform its parameters into strings. This is heavily branching code (even worse when the format string is symbolic). Have a look e.g. at musl's implementation: https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c Kind regards, Frank From mcsinyx at disroot.org Wed May 24 08:24:15 2023 From: mcsinyx at disroot.org (=?utf-8?q?Nguy=E1=BB=85n_Gia_Phong?=) Date: Wed, 24 May 2023 16:24:15 +0900 Subject: [klee-dev] Use of -sym-stdin/stdout In-Reply-To: <20230523180500.1ce839d5@gyali> References: <2b05ec25-3219-c2a7-3c27-1a0275c52a85@imperial.ac.uk> <20230523180500.1ce839d5@gyali> Message-ID: On 2023-05-23 at 18:05+01:00, Frank Busse wrote: > On Tue, 23 May 2023 16:38:25 +0900 > Nguy?n Gia Phong wrote: > > what are the potential drawbacks of enabling > > symbolic printf in KLEE's ?Clibc? > > printf has to transform its parameters into strings. This is heavily > branching code (even worse when the format string is symbolic). Have a > look e.g. at musl's implementation: > > https://git.musl-libc.org/cgit/musl/tree/src/stdio/vfprintf.c Thanks, that explains it for me.