FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 02-16-2012, 05:08 PM
Bruce Korb
 
Default bug in cmdline.c

$ cat > test-in <<_EOF_
+ mod | cat > test-out
+ _EOF_
$ crash [....]
crash> < test-in
crash> quit
$ cat test-out
crash> mod | cat > test-out
MODULE NAME SIZE OBJECT FILE
[....]

That first line does not belong in "test-out".
It is very noticeable if "cat" were trying to parse the "mod" output.
WRT printf, you can always add another global: trace_fp
and let that one be the fp for writing trace logs. But it should
always be stdout. (Well, "stderr", actually, but you are already
printing your command traces to stdout.)

On Thu, Feb 16, 2012 at 7:59 AM, Dave Anderson <anderson@redhat.com> wrote:
>
> I'm not sure I agree...
>
>> $ diff -u *~ cmdline.c
>> --- cmdline.c~ *2012-02-03 11:22:33.000000000 -0800
>> +++ cmdline.c * 2012-02-15 16:51:07.209524248 -0800
>> @@ -1372,10 +1372,8 @@
>> * * * * * * * * *if (!(argcnt = parse_line(pc->command_line, args)))
>> * * * * * * * * * * * * *continue;
>>
>> - * * * * * * * *if (!(pc->flags & SILENT)) {
>> - * * * * * * * * * * * *fprintf(fp, "%s%s", pc->prompt, buf);
>> - * * * * * * * * * * * *fflush(fp);
>> - * * * * * * * *}
>> + * * * * * * * *if (!(pc->flags & SILENT))
>> + * * * * * * * * * * * *printf("%s%s", pc->prompt, buf);
>>
>> * * * * * * * * * exec_command();
>> * * * * * }
>
> Can you show an example of the problem that you're trying
> to handle?
>
> Also, printf() is never used by the crash utility. (well, except
> by some dead va_server.c code, some dead remote.c debug code,
> and a couple places in s390dbf.c which I don't control...)
>
> Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 05:39 PM
Dave Anderson
 
Default bug in cmdline.c

----- Original Message -----
> $ cat > test-in <<_EOF_
> + mod | cat > test-out
> + _EOF_
> $ crash [....]
> crash> < test-in
> crash> quit
> $ cat test-out
> crash> mod | cat > test-out
> MODULE NAME SIZE OBJECT FILE
> [....]
>
> That first line does not belong in "test-out".
> It is very noticeable if "cat" were trying to parse the "mod" output.
> WRT printf, you can always add another global: trace_fp
> and let that one be the fp for writing trace logs. But it should
> always be stdout. (Well, "stderr", actually, but you are already
> printing your command traces to stdout.)

What happens when the "silent" environment variable is set "on"?
(i.e., run "crash -s ..." or enter "set silent on" during runtime)

Dave

> On Thu, Feb 16, 2012 at 7:59 AM, Dave Anderson <anderson@redhat.com>
> wrote:
> >
> > I'm not sure I agree...
> >
> >> $ diff -u *~ cmdline.c
> >> --- cmdline.c~ *2012-02-03 11:22:33.000000000 -0800
> >> +++ cmdline.c * 2012-02-15 16:51:07.209524248 -0800
> >> @@ -1372,10 +1372,8 @@
> >> * * * * * * * * *if (!(argcnt = parse_line(pc->command_line,
> >> * * * * * * * * *args)))
> >> * * * * * * * * * * * * *continue;
> >>
> >> - * * * * * * * *if (!(pc->flags & SILENT)) {
> >> - * * * * * * * * * * * *fprintf(fp, "%s%s", pc->prompt, buf);
> >> - * * * * * * * * * * * *fflush(fp);
> >> - * * * * * * * *}
> >> + * * * * * * * *if (!(pc->flags & SILENT))
> >> + * * * * * * * * * * * *printf("%s%s", pc->prompt, buf);
> >>
> >> * * * * * * * * * exec_command();
> >> * * * * * }
> >
> > Can you show an example of the problem that you're trying
> > to handle?
> >
> > Also, printf() is never used by the crash utility. (well, except
> > by some dead va_server.c code, some dead remote.c debug code,
> > and a couple places in s390dbf.c which I don't control...)
> >
> > Dave
>

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 05:57 PM
Bruce Korb
 
Default bug in cmdline.c

On 02/16/12 10:39, Dave Anderson wrote:



----- Original Message -----

$ cat> test-in<<_EOF_
+ mod | cat> test-out
+ _EOF_
$ crash [....]
crash> < test-in
crash> quit
$ cat test-out
crash> mod | cat> test-out
MODULE NAME SIZE OBJECT FILE
[....]

That first line does not belong in "test-out".
It is very noticeable if "cat" were trying to parse the "mod" output.
WRT printf, you can always add another global: trace_fp
and let that one be the fp for writing trace logs. But it should
always be stdout. (Well, "stderr", actually, but you are already
printing your command traces to stdout.)


What happens when the "silent" environment variable is set "on"?
(i.e., run "crash -s ..." or enter "set silent on" during runtime)


Obviously, that would not happen. The issue is that the behavior
is completely unanticipatable. When you type in:
crash> mod | cat > test-out
you get what you expect in "test-out". When you put that into
a sourced file, you get different results. That is wrong, without
regard to any silent settings. The cause is this command trace stuff
that gets inserted into the command output stream. It doesn't belong.

Would you fix it, please? Thank you.

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 06:06 PM
Dave Anderson
 
Default bug in cmdline.c

----- Original Message -----
> On 02/16/12 10:39, Dave Anderson wrote:
> >
> >
> > ----- Original Message -----
> >> $ cat> test-in<<_EOF_
> >> + mod | cat> test-out
> >> + _EOF_
> >> $ crash [....]
> >> crash> < test-in
> >> crash> quit
> >> $ cat test-out
> >> crash> mod | cat> test-out
> >> MODULE NAME SIZE OBJECT FILE
> >> [....]
> >>
> >> That first line does not belong in "test-out".
> >> It is very noticeable if "cat" were trying to parse the "mod" output.
> >> WRT printf, you can always add another global: trace_fp
> >> and let that one be the fp for writing trace logs. But it should
> >> always be stdout. (Well, "stderr", actually, but you are already
> >> printing your command traces to stdout.)
> >
> > What happens when the "silent" environment variable is set "on"?
> > (i.e., run "crash -s ..." or enter "set silent on" during runtime)
>
> Obviously, that would not happen. The issue is that the behavior
> is completely unanticipatable. When you type in:
> crash> mod | cat > test-out
> you get what you expect in "test-out". When you put that into
> a sourced file, you get different results. That is wrong, without
> regard to any silent settings. The cause is this command trace stuff
> that gets inserted into the command output stream. It doesn't
> belong.
>
> Would you fix it, please? Thank you.

No, I won't. You're welcome.

This discussion came up many years ago. Some people want the command
interspersed and others do not. The "silent" variable was the compromise.

But, that's the beauty of open source -- you can do whatever you'd like
with your copy.

Dave



--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 06:44 PM
Bruce Korb
 
Default bug in cmdline.c

On 02/16/12 11:06, Dave Anderson wrote:

Would you fix it, please? Thank you.


No, I won't. You're welcome.

This discussion came up many years ago. Some people want the command
interspersed and others do not. The "silent" variable was the compromise.


Ick. Backup plan: add "<" to the list of commands that get help
and make a note (strongly that any command output redirected to
shell commands will get the command prompt and full command line
sent to it as well. It is very unexpected. Perhaps an example
like the one I sent showing the merged text. Advertise the feature
so it won't bite so hard.

Thank you!

$ cat test-in
mod | cat > test-out
$ crash [.....]
crash> < test-in
crash> quit
$ cat test-out
crash> mod | cat > test-out
MODULE NAME SIZE OBJECT FILE
ffffffffa0001200 craytrace 6284 (not loaded) [CONFIG_KALLSYMS]
[...]

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-16-2012, 06:54 PM
Dave Anderson
 
Default bug in cmdline.c

----- Original Message -----
> On 02/16/12 11:06, Dave Anderson wrote:
> >> Would you fix it, please? Thank you.
> >
> > No, I won't. You're welcome.
> >
> > This discussion came up many years ago. Some people want the command
> > interspersed and others do not. The "silent" variable was the
> > compromise.
>
> Ick. Backup plan: add "<" to the list of commands that get help
> and make a note (strongly that any command output redirected to
> shell commands will get the command prompt and full command line
> sent to it as well. It is very unexpected. Perhaps an example
> like the one I sent showing the merged text. Advertise the feature
> so it won't bite so hard.

The usage of "<" is part of the "help input" page. And the "silent"
variable is described in the "set" help page.

Dave


--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-17-2012, 08:02 AM
Michael Holzheu
 
Default bug in cmdline.c

Hi Dave,

On Thu, 2012-02-16 at 10:59 -0500, Dave Anderson wrote:
> Also, printf() is never used by the crash utility. (well, except
> by some dead va_server.c code, some dead remote.c debug code,
> and a couple places in s390dbf.c which I don't control...)

Probably I should change that in s390dbf.c. Should I always use
fprintf(fp, ...)? Also for error messages?

Michael

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 02-17-2012, 12:48 PM
Dave Anderson
 
Default bug in cmdline.c

----- Original Message -----
> Hi Dave,
>
> On Thu, 2012-02-16 at 10:59 -0500, Dave Anderson wrote:
> > Also, printf() is never used by the crash utility. (well, except
> > by some dead va_server.c code, some dead remote.c debug code,
> > and a couple places in s390dbf.c which I don't control...)
>
> Probably I should change that in s390dbf.c. Should I always use
> fprintf(fp, ...)? Also for error messages?
>

Ideally, yes, and error() with the proper type for error messages.

Dave

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 01:26 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org