I/O problem (stdio and stderr redirection to txt files)

I think the first order here is to decide what are “critical” error
messages.

Sorry no. You, nor anyone else, gets to decide what is critical. That
is
up to the programmers using the library and the developers of the
library. It is up to the individuals and is not subject to any sort
of
group decision or policy. The rest of your legalistic discussion is
seriously off topic.

I’m afraid one or both of us are responsible for a miscommunication
here, Bob. Deciding what constitutes a “critical error” was merely an
endeavor to create operational terminology for the purpose of this
discussion. The word “critical” indicates “necessary severity.” In this
thread, the necessary severity for an SDL application to be unable to
communicate with the user is generally going to be a segmentation
fault, or corrupt and/or missing resource files. Why is this where the
distinction is drawn? Because if you can find your resources, and you
haven’t crashed, then you are still able to report the error to the
user.

On the other hand, if you wanted a more “casual” GUI dialog interface,
I think you are in the minority here. There are several GUI libraries,
and if utilizing the native environment’s “message box” interface is
that important to you, I recommend finding a library to accomplish this
for you, or writing it yourself separately from SDL.

Donny, considering the sehar volume of misinformation you have posted
since you started on this list it is very hard to take anything you say
the least bit seriously. AFAIK, I am the only person in the world
actively working on adding multi-window support to SDL. I believe that
working on that project has given me a moderate level of understanding
of the issues you are talking about. Something you have demonstrated
that you clearly do not have. Well, all I can say is that it is time for
you to take a deep breath and spend some time thinking about what you
are saying. You appear to be much more interested in getting your own
way and “winning” the argument than in coming to a solution that will
work.

Seriously, take a deep breath, let it out slowly, and then spend a few
minutes trying to see the issue from all sides. Not just from yours.

		Bob Pendleton

P.S.

Seriously Folks, this whole thread has turned into an exercise in
futility. Although it has been hilarious watching the people who
actually know what they are talking about poking holes in the self
important blowhards. It is just too painful to watch when the people who
are being made fun of don’t even seem to understand they are being egged
on for the shear humor of watching their blustering and strutting
reactions.On Sat, 2005-03-19 at 02:00 -0500, Donny Viszneki wrote:

On Mar 18, 2005, at 1:30 PM, Bob Pendleton wrote:


On Mar 18, 2005, at 7:56 AM, Brian Barrett wrote:

          B) The average X (Linux, BSD, etc.) user will be >smart 

enough to
check stdout / stderr themselves.

Do you not think that’s just a bit misinformed. i used linux and
before learniing SDL i would have no reason to assume apps printed
errors to some obscure file when they crashed.

Some obscure file? On Linux (which you say you were using) you would
either have run the application from the command line (no problems
seeing the error output in this case, I assume,) or you would have run
it from your desktop environment (most likely scenario.) In the latter
case, there is no “obscure” file. Typically, your X session will send
the non-graphical of a graphical application to a log, the system
console (or another similar “console” file) or sometimes nowhere.
However, most Unix users know this. I’m sorry you did not. The fact
that you didn’t is probably a good indication that I am better than you
to say what the typical Unix user is likely to know. (Read: most Unix
users are not newbs, and know how to retrieve the non-graphical output
of their graphical applications.)


On Mar 18, 2005, at 7:56 AM, Brian Barrett wrote:

The way i see it is

  1. SDL can make windows on many platforms
  2. SDL has built in surfaces

so instead of printing SDL_Parachute deployed , after the window
closes, open a different window and import an error surface… at the
very least you could set the title of the window to SDL_ERROR #4 so
users could report errors back to the developers…

Software of every origin and purpose for decades has found a message
box a perfectly acceptable method of reporting critical errors. Why
don’t you?

In a small project, why not use a message box to inform the user the
program has crashed, and where (and if) to report the crash. For a
large project, I recommend writing a crash reporter, or finding one
that’s right for you. You’ll also find that it’s not something to
implement in a cross-platform fashion… or, more accurately, most
effective when left platform segregated.


One thing I didn’t really cover in my last post were crashes resultant
of segmentation faults, and similar conditions. Would anyone like the
suggestion of allowing the parachute to execute another program, or
perhaps a function in the current program? I think this is both the
most flexible, and the lightest solution possible. A cross-platform
message-box would still be more appropriate for errors such as the
typical “cannot find resources” error that I covered thoroughly in my
previous post. Perhaps both of these features together can cover all
the bases for everyone?

I do realize you can turn the parachute off, however I think telling
the parachute to execute your own program or function allows you to
retain the benefit of SDL already knowing how to hook into the varying
signal handling interface of each platform. I hope everyone will agree
that these two solutions cover everything adequately.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Sorry, gotta step back in on this one. I don’t think Donny is being
abrasive, I personally think most of his comments are pretty spot on,
but that’s just me. It’s pretty crazy how far afield this thread has
gotten from a simple “lets remove the stdio redirection” that it started
from :slight_smile:

I always thought that one of the benefits of SDL was that it provides a
thin layer between the underlying OS’s video, sound, threading, input,
etc… That’s the attraction of SDL for me, I don’t need to spend hours
pouring over the documentation of X11, or OSX figuring out how to use
the respective libraries. So why would people have such a big problem
with wanting an API that gives a uniform method of reporting error
conditions to users? The actual method can be different (ie stdio, gui
messagebox, file, etc), but wouldn’t it be beneficial?

  • brian

Ryan C. Gordon wrote:>

Seriously, and I do mean this seriously: with the exception of Mac OS
X, I am 99% sure that every GUI environment out there could have a
message box function with a macro – what does this mean? It means
that it would add NOTHING to your program after linking, and like 15
or 20 lines of code to a single SDL header file. SORRY FOR BLOATING
YOUR APPLICATION SO MUCH

Could you explain what macro you plan to implement for the fbcon
target which has no window toolkit, no stdio, and no built-in fonts?
How about for the X11 target when the user runs the program remotely
and can’t get a connection? Will you be using a Qt message box on KDE
desktops and a GTK+ message box on Gnome desktops, even though the
same user on the same system with the same binaries of a given app
could be using either on a given run? What is the solution when a
given GUI toolkit isn’t on the system, or were you planning to
statically link with them all just in case, and additionally roll your
own in pure Xlib when none of them exist?

I’m not saying this isn’t a real issue, because it is, and any
solution on a Unix desktop is a total mess. But you aren’t the first
person to erroneously jump in without thinking this through, so don’t
feel too badly about it. Oh, which reminds me…

You aren’t the first person to erroneously make
these comparisons, so don’t feel to bad about it.

People would probably be more agreeable to your point of view if you
didn’t spend so much energy on belittling them. I think this is the
second time today I’m pointing this out on this mailing list. If you
aren’t intentionally being abrasive, please let me tell you that it is
perceived as such, and it’s a hinderance to your ability to
successfully express your point of view.

–ryan.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

[…]

So why would people have such a big problem with wanting an API that
gives a uniform method of reporting error conditions to users? The
actual method can be different (ie stdio, gui messagebox, file,
etc), but wouldn’t it be beneficial?

It would be “handy”, but since it’s only supposed to be used when the
application is unable to set up an SDL display, it won’t/shouldn’t be
used all that often, and it shouldn’t have to interact with SDL in
any way. So, it doesn’t really belong in the SDL core library.

Another issue is that some platforms simply don’t have a single
standard way of handling error messages. For example, “Un*x” has
multiple popular GUI toolkits and desktop environments, and many of
them just drop stderr and stdout unless you start the application
from a console, so you can’t rely on that either. You have to support
several GUI toolkits, and/or implement your own directly over Xlib -
and hope the machine is actually running something X11 compatible!

So, there’s just no solid, reliable, “works everywhere” solution, and
that takes away a great deal of the motivation to do anything at all.

Another motivation killer is that any “proper” solution will probably
be ignored by most programmers anyway. Those who care to do things
properly already have their own solutions for the platforms they
support, and most of the others will probably stick with stderr, if
they even bother implementing proper error handling.

In short, SDL can’t fix bad programmer habits; only support good ones.

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 21 March 2005 23.40, Brian Kropf wrote:

David Olofson wrote:

Another issue is that some platforms simply don’t have a single
standard way of handling error messages. For example, “Un*x” has

I’ve thought of making a minimal popup-box library that solves the GUI
toolkit problem by having several “toolkit drivers” and having the lib
trying to dynamically load each toolkit in turn, then pop up the box
once something inited successfully.

The advantages of this approach is that the main application wanting to
pop up these messages don’t have to be linked to anything special, but
simply takes advantage of what’s available on the system it’s currently
being run at (ie no extra dependencies). If nothing’s available it
could print the message to stderr and log it to a file.

There’s plenty of disadvantages as well, of course. Need ability to
dynload, load code for several GUIs may be considered bloat, several
GUIs may be available and the selected one may not be user’s choice (and
take time to load), etc, but I think this would be at least slightly
better than the alternatives I can think of at the moment. Thoughts ?

  • Gerry

You’ve spammed everyone on this list with a long, irrelevant flame. I
hesitate to waste anyone else’s time but yours and mine with the
response, but I personally feel that where I said nothing about you,
good bad or indifferent, you’ve said plenty about me, and I should
probably respond publicly.

Even though I’m apparently the one who’s only interested in "winning"
arguments, it is your email, Bob, that goes on and on about my attitude
(where you clearly “win”) as opposed to the content of my email. To me,
that sounds like what you’re accusing me of.

P.S.

Seriously Folks, in the future if you have something like Bob’s email
you want to send to me or anyone else, I hope you’ll send it privately
instead of spamming the entire list with it. If there is one redeeming
quality in this response to Bob that makes it fit for it to be seen
publicly, it’s seeing these sort of emails on the list is annoying, and
I hope you’ll all let Bob, myself, and anyone else know that privately.On Mar 21, 2005, at 2:34 PM, Bob Pendleton wrote:

Donny, considering the sehar volume of misinformation you have posted
since you started on this list it is very hard to take anything you say
the least bit seriously. AFAIK, I am the only person in the world
actively working on adding multi-window support to SDL. I believe that
working on that project has given me a moderate level of understanding
of the issues you are talking about. Something you have demonstrated
that you clearly do not have. Well, all I can say is that it is time
for
you to take a deep breath and spend some time thinking about what you
are saying. You appear to be much more interested in getting your own
way and “winning” the argument than in coming to a solution that will
work.

Seriously, take a deep breath, let it out slowly, and then spend a few
minutes trying to see the issue from all sides. Not just from yours.

  	Bob Pendleton

P.S.

Seriously Folks, this whole thread has turned into an exercise in
futility. Although it has been hilarious watching the people who
actually know what they are talking about poking holes in the self
important blowhards. It is just too painful to watch when the people
who
are being made fun of don’t even seem to understand they are being
egged
on for the shear humor of watching their blustering and strutting
reactions.

Donny Viszneki wrote:

You’ve spammed everyone on this list with a long, irrelevant flame. I
hesitate to waste anyone else’s time but yours and mine with the
response, but I personally feel that where I said nothing about you,
good bad or indifferent, you’ve said plenty about me, and I should
probably respond publicly.

Even though I’m apparently the one who’s only interested in "winning"
arguments, it is your email, Bob, that goes on and on about my attitude
(where you clearly “win”) as opposed to the content of my email. To me,
that sounds like what you’re accusing me of.

P.S.

Seriously Folks, in the future if you have something like Bob’s email
you want to send to me or anyone else, I hope you’ll send it privately
instead of spamming the entire list with it. If there is one redeeming
quality in this response to Bob that makes it fit for it to be seen
publicly, it’s seeing these sort of emails on the list is annoying, and
I hope you’ll all let Bob, myself, and anyone else know that privately.

Please try and live by your own rules.

  • Tom