Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

It's great to be smart 'cause then you know stuff.


devel / comp.lang.python / Weird strace of #! python script

SubjectAuthor
o Weird strace of #! python scriptDan Stromberg

1
Weird strace of #! python script

<mailman.301.1647293225.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17505&group=comp.lang.python#17505

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: drsali...@gmail.com (Dan Stromberg)
Newsgroups: comp.lang.python
Subject: Weird strace of #! python script
Date: Mon, 14 Mar 2022 14:26:51 -0700
Lines: 52
Message-ID: <mailman.301.1647293225.2329.python-list@python.org>
References: <CAGGBd_oHbCXgu-q+ANXUh2t1zRqErpNBOVqu74ycd=fP28pLUQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de pKReNsJUW8/m+1M3yp5H7wWRa1ru281Zf1bWm045E7mg==
Return-Path: <drsalists@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=OsTMPcSr;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:python': 0.06;
'anyway,': 0.09; 'debian': 0.09; 'grep': 0.09; 'linux': 0.09;
'skip:[ 20': 0.09; 'skip:\xc2 20': 0.09; 'subject:script': 0.09;
'import': 0.15; '1024': 0.16; '1163': 0.16; '1363': 0.16; '1366':
0.16; '1367': 0.16; '3.x': 0.16; 'bash': 0.16; 'cat': 0.16;
'from:addr:drsalists': 0.16; 'from:name:dan stromberg': 0.16;
'pid': 0.16; 'porting': 0.16; 'python3.': 0.16; 'script.': 0.16;
'to?': 0.16; 'python': 0.16; 'larger': 0.17; 'bug': 0.19; 'to:addr
:python-list': 0.20; "i've": 0.22; 'command': 0.23; 'thanks!':
0.24; 'follows:': 0.26; 'else': 0.27; 'done': 0.28; 'deleted':
0.32; 'happening': 0.32; 'here,': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "i'm": 0.33; 'there':
0.33; 'script': 0.33; 'same': 0.34; 'received:google.com': 0.34;
'track': 0.35; 'from:addr:gmail.com': 0.35; 'processes': 0.36;
'missing': 0.37; "it's": 0.37; 'received:209.85': 0.37; 'way':
0.38; 'received:209': 0.39; 'list': 0.39; 'stopped': 0.40;
'security': 0.64; 'down': 0.64; 'in.': 0.64; 'top': 0.65; '&amp;':
0.65; 'skip:t 20': 0.66; '8bit%:7': 0.67; 'heard': 0.67; 'skip:#
10': 0.68; 'skip:/ 10': 0.69; 'skip:f 30': 0.71; 'happens': 0.84;
'skip:j 20': 0.84; 'subject:Weird': 0.84; 'ancient': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:from:date:message-id:subject:to;
bh=5FxJRtoc+1zZMAXKqYcjKY97V39ufIwfMKqQHeRBRuo=;
b=OsTMPcSr99Seg2uDZKAZ21kywUhicOHUpNt+qH+HmwZP8yxMplgZ2XralhknR+EdEI
exW0P1VTaUO+MrVf6NyrHSs7TFq44fajDWe5CZC2txLCBJChqc5Bt6B9b58meHqSz4cZ
R5dym/RvurMjxFvufA9mHYM72RF59qV/+yR2JGEC9dcT2WYd9JT+dqYcJ6yhtIMPWpjA
SczS6czTPNrSNMoEvMg4sK9fRIuF6TmwhNKShtZ6aISBl/EZFREOi0ppZQE7+hWHd7kp
2EYZGmkLfMH90UTWyukWSteM93+2sIjUXe4hog4P2z+HHQRbzQAyE1tiscUwcAj7IDJo
V2PA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=5FxJRtoc+1zZMAXKqYcjKY97V39ufIwfMKqQHeRBRuo=;
b=vSZF1ywYyM8mj4tMH5HnvkLLCELyq3Aj1S2QXfM9kvPzgjnPmm9590W3Xuz4TNxkW7
H7/dn7CW+uTaUpenajLVH8P9fAcCnmqN+af6OKlbhAcGM16wVQ1haGszSPtuXP1lbewL
L8RfE2OYwZgNvh7LDm95VBZlz49iDQm8OWBsjjwwM7Pf6GUZxHUON1fq0GZp3T5WU36s
t4npP7p9ibdSyLH5/Ddw2xylgN90KYXtrX+g+2Rseqh26/kBFTwybrLE97p23XgGCu9I
LWpPHKuo08U9z0+aU0/zipLbrnH8vkOhWlJf+5KbAE1aOQR+zF6EB1IlKSsAo4ecvm+q
F05g==
X-Gm-Message-State: AOAM533JGsCFZhWA4yhDQ7dUqOWVz92DG+xxp4HCag6LOf/rXxIeZyQ1
cy8JJWNLIScOsjW9+YKHAr16UEdnhg34r0/dZq7BAQ6qcKQ=
X-Google-Smtp-Source: ABdhPJyRrm33wpxqbHKkaEgyyu0eRYInAK0noSsOGuSB+mZUs7HUCyJFMlI7pDh3gfGG6/ylIHCzjDzI0IDHdGAs1qw=
X-Received: by 2002:a1f:50c4:0:b0:336:e84d:2873 with SMTP id
e187-20020a1f50c4000000b00336e84d2873mr10390326vkb.30.1647293222705; Mon, 14
Mar 2022 14:27:02 -0700 (PDT)
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAGGBd_oHbCXgu-q+ANXUh2t1zRqErpNBOVqu74ycd=fP28pLUQ@mail.gmail.com>
 by: Dan Stromberg - Mon, 14 Mar 2022 21:26 UTC

Hi folks.

First off, I know, python2 is ancient history. Porting to 3.x is on my
list of things to do (though I'm afraid it's not yet at the top of the
list), and the same thing happens with python3.

So anyway, I'm strace'ing a #!/usr/bin/python2 script.

I expected to see an exec of /usr/bin/python2, but I don't. I just see an
exec of /tmp/t.

As follows:
tact@celery_worker:/app$ strace -f -s 1024 -o /tmp/t.strace /tmp/t
^Z
[1]+ Stopped strace -f -s 1024 -o /tmp/t.strace /tmp/t
tact@celery_worker:/app$ bg
[1]+ strace -f -s 1024 -o /tmp/t.strace /tmp/t &
tact@celery_worker:/app$ ps axf
PID TTY STAT TIME COMMAND
1163 pts/0 Ss 0:00 bash
1363 pts/0 S 0:00 \_ strace -f -s 1024 -o /tmp/t.strace /tmp/t
1366 pts/0 S 0:00 | \_ /usr/bin/python2 /tmp/t
1367 pts/0 R+ 0:00 \_ ps axf
tact@celery_worker:/app$ fg
bash: fg: job has terminated
[1]+ Done strace -f -s 1024 -o /tmp/t.strace /tmp/t
tact@celery_worker:/app$ grep execve /tmp/t.strace
1366 execve("/tmp/t", ["/tmp/t"], 0x7ffd89f9c3b8 /* 49 vars */) = 0
tact@celery_worker:/app$

I've deleted some irrelevant processes from the 'ps axf'.

/tmp/t is actually just:
tact@celery_worker:/app$ cat /tmp/t
#!/usr/bin/python2

import time

time.sleep(10)

Was this some sort of security feature I never heard about? I'm tracing a
very simple time.sleep(10) here, but the same thing is (not) happening in a
larger script that I need to track down a bug in.

Is there a way I can coax Linux and/or strace to show all the exec's, like
they used to? Not having them makes me wonder what else is missing from
the strace report.

I'm on a Debian 11.2 system with strace 5.10 and Python 2.7.18.

Thanks!

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor