From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18123 invoked by alias); 25 Aug 2017 04:36:21 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 18104 invoked by uid 89); 25 Aug 2017 04:36:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail-wm0-f54.google.com Received: from mail-wm0-f54.google.com (HELO mail-wm0-f54.google.com) (74.125.82.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Aug 2017 04:36:16 +0000 Received: by mail-wm0-f54.google.com with SMTP id z132so3976005wmg.1 for ; Thu, 24 Aug 2017 21:36:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=UhPBRpLog5bOBRM+xKqdXgBe33BSOrbwknrg6QaaG0s=; b=aeyulxGLuXRgaXL1Kr/iSPIYrordoEr1mKMOCm2SbKDNJoSWxflvAxxSuiThmHzSZz smMGiATYB4Wtm11bHoMxZNHv7ufrQ052S6cYj7MeWExVRJa0S7iX/weT/Yj9iwYYSqBN 8Esq5WxDbGKR5OkdjWfI4lSSj7o6aq0vWwlghTKdW1pnRqKq2Y6HZ3j15YrO40dqtJl/ gTbm9Acv9h8LnVocLe1avp2bwOVRH/KMHDVBVKUAXE2x3A0woGa1zHYfwg9elcOFYzgC KS48kQGEdid79jSywvu65CQbQ8684V1gN1u4Np0zjNIRSABjJnGsCeSuFi7zLrNxomD2 Cw/w== X-Gm-Message-State: AHYfb5gr0ZfwVSI28hdBV4A/stAJabYeGBucKkPbY+Q3TiD77hnsZ134 4zjWR5hTsvfyfl/RX0AjHSyv/1IhuMfF X-Received: by 10.80.216.141 with SMTP id p13mr8394833edj.10.1503635774191; Thu, 24 Aug 2017 21:36:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.148.206 with HTTP; Thu, 24 Aug 2017 21:35:53 -0700 (PDT) In-Reply-To: References: From: Arkady Date: Fri, 25 Aug 2017 04:36:00 -0000 Message-ID: Subject: Re: Failure in syscall.open probe To: systemtap@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-q3/txt/msg00134.txt.bz2 Update 4 The problem can be reproduced on the kernel 2.6.32-696.10.1.el6.x86_64 #1 SMP as well On Fri, Aug 25, 2017 at 6:55 AM, Arkady wrote: > Update 3 > > This code fails as well > > > global ARRAY_FILENAME% > > probe syscall.open > { > tid = tid() > ARRAY_FILENAME[tid] = filename > } > > probe syscall.open.return > { > tid = tid(); > delete ARRAY_FILENAME[tid] > } > > Load thescript > stap -g -p 4 -m test_open -v -k test_open.stp > staprun test_open -L > > Run a tight loop which opens a file > touch test.txt;while [ 1 ];do cat test.txt;done; > > Wait a couple of minutes. > > The problem appears to be specific for the kernel > 2.6.32-696.3.2.el6.x86_64 #1 CentOS 6.9 > > On Thu, Aug 24, 2017 at 7:28 PM, Arkady wrote: >> Update 2 >> >> I made the script shorter - failed after 400 driver restarts >> >> global ARRAY_FILENAME_PID% >> global ARRAY_TIMESTAMP_OPEN% >> >> function current_time:long() >> %{ /* pure */ >> struct timespec now = current_kernel_time(); >> STAP_RETURN(timespec_to_ns(&now)); >> %} >> >> probe syscall.open >> { >> tid = tid() >> ARRAY_FILENAME_PID[tid] = filename >> ARRAY_TIMESTAMP_OPEN[tid] = current_time() >> } >> >> probe syscall.open.return >> { >> tid = tid(); >> delete ARRAY_FILENAME_PID[tid] >> delete ARRAY_TIMESTAMP_OPEN[tid] >> } >> >> On Thu, Aug 24, 2017 at 5:35 PM, Arkady wrote: >>> Update >>> The build line can be as short as >>> >>> stap -g -p4 -m test_open -v -k test_open.stp >>> >>> >>> On Thu, Aug 24, 2017 at 5:26 PM, Arkady wrote: >>>> Hi, >>>> >>>> I am trying the following code >>>> https://gist.github.com/larytet/5c361b1a4ee967655f500909026978f9 >>>> - the script is mostly syscall.open and syscall.open.return >>>> >>>> on CentOS release 6.9 (Final) >>>> kernel 2.6.32-696.3.2.el6.x86_64 #1 SMP Tue Jun 20 01:26:55 UTC 2017 >>>> x86_64 x86_64 x86_64 GNU/Linux >>>> >>>> g++ (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6) >>>> >>>> I use a custom build of 3.1 release of Systemtap >>>> Systemtap translator/driver (version 3.1/0.164, commit >>>> release-2.9-1416-gb8ea350dc13a) >>>> Copyright (C) 2005-2017 Red Hat, Inc. and others >>>> This is free software; see the source for copying conditions. >>>> tested kernel versions: 2.6.18 ... 4.10-rc8 >>>> enabled features: PYTHON2 NLS >>>> >>>> Build command stap -g -p4 -m test_open -g --suppress-time-limits -v -k >>>> -D MAXSKIPPED=0 -D MAXTRYLOCK=100000 -D TRYLOCKDELAY=1 test_open.stp >>>> >>>> I restart the script using the following bash one liner >>>> count=0;while [ 1 ];do echo $count;count=$(($count+1));sudo rmmod >>>> test_open;sudo staprun test_open.ko -L ;done; >>>> >>>> 30-50 restarts later I get an exception: >>>> >>>> Aug 24 10:13:52 localhost kernel: <#DB> [] ? >>>> __schedule_bug+0x44/0x50 >>>> Aug 24 10:13:52 localhost kernel: [] ? schedule+0xa4c/0xb70 >>>> Aug 24 10:13:52 localhost kernel: [] ? vsnprintf+0x336/0x5e0 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> __cond_resched+0x2a/0x40 >>>> Aug 24 10:13:52 localhost kernel: [] ? _cond_resched+0x30/0x40 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> strncpy_from_user+0x4a/0x90 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> function___global_user_string_quoted__overload_0+0x460/0x890 >>>> [test_open] >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> _new_map_create+0x3e/0xa0 [test_open] >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> probe_3606+0x101/0x400 [test_open] >>>> Aug 24 10:13:52 localhost kernel: [] ? sys_open+0x1/0x30 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> enter_kprobe_probe+0x1c0/0x2d0 [test_open] >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> aggr_pre_handler+0x5b/0xb0 >>>> Aug 24 10:13:52 localhost kernel: [] ? sys_open+0x0/0x30 >>>> Aug 24 10:13:52 localhost kernel: [] ? sys_open+0x1/0x30 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> kprobe_exceptions_notify+0x3d5/0x430 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> notifier_call_chain+0x55/0x80 >>>> Aug 24 10:13:52 localhost kernel: [] ? >>>> atomic_notifier_call_chain+0x1a/0x20 >>>> Aug 24 10:13:52 localhost kernel: [] ? notify_die+0x2e/0x30 >>>> Aug 24 10:13:52 localhost kernel: [] ? do_int3+0x35/0xb0 >>>> Aug 24 10:13:52 localhost kernel: [] ? int3+0x33/0x40 >>>> Aug 24 10:13:52 localhost kernel: [] ? sys_open+0x0/0x30 >>>> >>>> Thank you, Arkady.