From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 717 invoked by alias); 18 Mar 2010 08:10:58 -0000 Received: (qmail 645 invoked by uid 48); 18 Mar 2010 08:10:39 -0000 Date: Thu, 18 Mar 2010 08:10:00 -0000 Message-ID: <20100318081039.644.qmail@sourceware.org> From: "wenji dot huang at oracle dot com" To: systemtap@sources.redhat.com In-Reply-To: <20100225211044.11325.chwang@redhat.com> References: <20100225211044.11325.chwang@redhat.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug runtime/11325] Spaces and exclamation marks invalid as module arguments X-Bugzilla-Reason: AssignedTo 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 X-SW-Source: 2010-q1/txt/msg00706.txt.bz2 ------- Additional Comments From wenji dot huang at oracle dot com 2010-03-18 08:10 ------- (In reply to comment #0) > Examples: > > $ stap -p4 -m mod1 -e 'global var1="foo"; probe begin{printf("%s\n", var1); > exit()}' > > $ staprun mod1.ko var1="hello!" > bash: !": event not found ... > Also, escaping the exclamation mark results in the escape character also being > printed: > $ staprun mod1.ko var1="hello\!" > hello\! Same results as bash, $ echo "foo!" -bash: !": event not found $ echo "foo\!" foo\! > $ staprun mod1.ko var1="hello world" > Error inserting module '/notnfs/chwang/systemtap/mod1.ko': Unknown symbol in module > Retrying, after attempted removal of module mod1 (rc -1) > Error inserting module '/notnfs/chwang/systemtap/mod1.ko': Unknown symbol in module Seems a bug, maybe fixed by the following patch. $staprun mod1.ko var1="hello foo" hello foo diff --git a/runtime/staprun/staprun_funcs.c b/runtime/staprun/staprun_funcs.c index db58cd4..2f8076a 100644 --- a/runtime/staprun/staprun_funcs.c +++ b/runtime/staprun/staprun_funcs.c @@ -68,13 +68,14 @@ int insert_module( return -1; } for (i = 0; options[i] != NULL; i++) { - opts = realloc(opts, strlen(opts) + strlen(options[i]) + 2); + opts = realloc(opts, strlen(opts) + strlen(options[i]) + 4); if (opts == NULL) { _perr("[re]allocating memory failed"); return -1; } - strcat(opts, " "); + strcat(opts, " \""); strcat(opts, options[i]); + strcat(opts, "\""); } dbug(2, "module options: %s\n", opts); -- http://sourceware.org/bugzilla/show_bug.cgi?id=11325 ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee.