Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to identify shebang when it has initial spaces #1690

Closed
honggyukim opened this issue May 1, 2023 · 0 comments · Fixed by #1697 · May be fixed by #1789
Closed

unable to identify shebang when it has initial spaces #1690

honggyukim opened this issue May 1, 2023 · 0 comments · Fixed by #1697 · May be fixed by #1789

Comments

@honggyukim
Copy link
Collaborator

uftrace detects shebang in the first line as follows.

#!/usr/bin/env python3

But if it has some whitespaces at the beginning, it can't detect the shebang as follows.

#! /usr/bin/env python3

For example, when there is a script as follows.

$ cat p-abc.py
#! /usr/bin/env python3

import os

def c():
    return os.getpid()

def b():
    return c()

def a():
    return b()

a()

The tracing result looks as follows.

$ uftrace p-abc.py
uftrace: /home/honggyu/work/uftrace/cmds/record.c:1580:find_in_path
 ERROR: Cannot trace '': No such executable file.

The shebang with whitespaces is legal so we should fix our shebang detection logic.

yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 10, 2023
Python tracing won't work when the shebang line has a space like below:

Fixed: namhyung#1690

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 11, 2023
Python tracing won't work when the shebang line has a space like below:

Fixed: namhyung#1690

Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 11, 2023
Python tracing won't work when the shebang line has a space like below:

Fixed: namhyung#1690

Signed-off-by: Yi Hong <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 11, 2023
Python tracing won't work when the shebang line has a space like below:

Fixed: namhyung#1690

Signed-off-by: yihong <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 11, 2023
Python tracing won't work when the shebang line has a space like below:

Fixed: namhyung#1690
Signed-off-by: Yi Hong <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 11, 2023
Python tracing won't work when the shebang line has a space like below:

  #! /usr/bin/env python3

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Yi Hong <zouzou0208@gmail.com>
namhyung pushed a commit that referenced this issue May 12, 2023
Python tracing won't work when the shebang line has a space like below:

  #! /usr/bin/env python3

This patch makes uftrace to understand the above shebang as well.

Fixed: #1690
Signed-off-by: Yi Hong <zouzou0208@gmail.com>
yihong0618 added a commit to yihong0618/uftrace that referenced this issue May 12, 2023
Python tracing won't work when the shebang line has a space like below:

  #! /usr/bin/env python3

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Yi Hong <zouzou0208@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 30, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Jul 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
record: skip whitespaces after shebang for scripts

Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690
Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
GabrielKimm added a commit to GabrielKimm/uftrace that referenced this issue Aug 31, 2023
Python tracing won't work when the shebang line has a space like below:

" #! /usr/bin/env python3 "

This patch makes uftrace to understand the above shebang as well.

Fixed: namhyung#1690

Signed-off-by: Gabriel Kim <0xgabriel.kim@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment