Nikodemus Siivola | 1 Nov 2011 10:08
Gravatar

Re: BUG: unknown SC to SC-CASE for TN: DESCRIPTOR-REG

On 31 October 2011 22:37, Eric Marsden <eric.marsden <at> free.fr> wrote:
> Hi,
>
> The following error occurs on Sparc64/Linux:

Logged as https://bugs.launchpad.net/sbcl/+bug/884646, thanks!

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Nikodemus Siivola | 1 Nov 2011 10:09
Gravatar

Re: BUG: incorrect double-float member types on Sparc

On 31 October 2011 22:23, Eric Marsden <eric.marsden <at> free.fr> wrote:
> Hi,
>
> On Sparc64/Linux:

Logged as https://bugs.launchpad.net/sbcl/+bug/884650. Thank you!

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Deepak Surti | 1 Nov 2011 16:37
Picon
Gravatar

Tracing internal SBCL packages

Hi,


I tried to trace an internal SBCL package.

(trace "SB-IMPL")

It gives control stack overflow error.

INFO: Control stack guard page unprotected
CORRUPTION WARNING in SBCL pid 22057(tid 2953318400):

Alternatively, I tried redefining internal SBCL package functions
after unlocking package. It causes binding stack exhausted error.

Next option I tried is to add trace statements to lambda-guts
inside code/defboot.lisp. This is something I tried

Changed from:
---------------------
(lambda-guts `(,args
                          , <at> decls
                          (block ,(fun-name-block-name name)
                            , <at> forms)))

to:
---

(lambda-guts `(,args
                          , <at> decls
                          (block ,(fun-name-block-name name)
                            ;insert trace statement here
                            , <at> forms)))

where trace-statement is either a print, format or /show0 call
but all result in failed builds.

Really appreciate if someone can help about tracing internal sbcl packages?

I have tried the SBCL build process pdf (C Rhodes) and reading through 
compier internals docs, but could not find the solution.

Thanks in advance.

--
http://deepaksurti.com
To see a miracle, be the miracle.
------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Stas Boukarev | 1 Nov 2011 17:03
Picon

Re: Tracing internal SBCL packages

Deepak Surti <dmsurti <at> gmail.com> writes:

> Hi,
>
> I tried to trace an internal SBCL package.
>
> (trace "SB-IMPL")
>
> It gives control stack overflow error.
Why do you want to trace internal packages?

It doesn't work because tracing is implemented using internal
functionality, so you get a circular dependency, you can trace the
tracer with itself.

--

-- 
With best regards, Stas.

------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
Nikodemus Siivola | 1 Nov 2011 16:59
Gravatar

Re: Tracing internal SBCL packages

On 1 November 2011 17:37, Deepak Surti <dmsurti <at> gmail.com> wrote:

> Really appreciate if someone can help about tracing internal sbcl packages?

Tracing all functions in an SBCL internal package isn't going to work
reliably out of the box, ever.

Tracing selected functions works as long as they aren't ones used to
implement parts of TRACE, and with the proviso that many functions
used by SBCL are inlined or open coded, in which case they are
invisible to TRACE.

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Deepak Surti | 1 Nov 2011 17:38
Picon
Gravatar

Re: Tracing internal SBCL packages

Thanks a ton for the detailed info.


I now understand that if I trace functions that meet criteria you mention, 
things should work fine.

On Tue, Nov 1, 2011 at 9:29 PM, Nikodemus Siivola <nikodemus <at> random-state.net> wrote:
On 1 November 2011 17:37, Deepak Surti <dmsurti <at> gmail.com> wrote:

> Really appreciate if someone can help about tracing internal sbcl packages?

Tracing all functions in an SBCL internal package isn't going to work
reliably out of the box, ever.

Tracing selected functions works as long as they aren't ones used to
implement parts of TRACE, and with the proviso that many functions
used by SBCL are inlined or open coded, in which case they are
invisible to TRACE.

Cheers,

 -- Nikodemus



--
http://deepaksurti.com
To see a miracle, be the miracle.
------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Deepak Surti | 1 Nov 2011 17:39
Picon
Gravatar

Re: Tracing internal SBCL packages

I wanted to understand how SBCL internals work. Hence 

I thought I would trace internal packages. 

Thanks for the circular dependency info. Helps a lot.

On Tue, Nov 1, 2011 at 9:33 PM, Stas Boukarev <stassats <at> gmail.com> wrote:
Deepak Surti <dmsurti <at> gmail.com> writes:

> Hi,
>
> I tried to trace an internal SBCL package.
>
> (trace "SB-IMPL")
>
> It gives control stack overflow error.
Why do you want to trace internal packages?

It doesn't work because tracing is implemented using internal
functionality, so you get a circular dependency, you can trace the
tracer with itself.

--
With best regards, Stas.



--
http://deepaksurti.com
To see a miracle, be the miracle.
------------------------------------------------------------------------------
RSA&reg; Conference 2012
Save &#36;700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
Faré | 1 Nov 2011 21:29
Picon
Gravatar

Re: Windows SBCL annoyances

Dear Anton,

thanks a lot for maintaining that SBCL branch with improved Windows support.

>> 1- Can we skip the Kitten of Death message, at least when --noinform
>> was passed?
>
> You're probably aware of it, but..
> <http://github.com/akovalenko/sbcl-win32-threads/wiki> is where you get
> SBCL with kitten of death suppressed by --noinform. I've also taken some
> steps to make _real_ kitten of death not so annoying. For example:
>
Indeed, your branch fixes this particular problem. Thanks a lot!

How is the merge going along?
Maybe instead of trying to acheive a complete merge
in N perfectly separated patches,
you could try do one patch at once, get it merged,
then work on the next patch?

>> 2- Can there be a way for run-program to pass arguments unescaped to
>> cmd.exe and other programs that do not follow the standard argument
>> parsing convention? Being able to issue system commands via cmd.exe
>> would really be nice.
>
> That's probably a misdiagnosed problem: you attribute a problem in
> MSVCRT spawn implementation to non-standard argument parsing of cmd.exe.
> Please provide an example which doesn't work, so I'll know what to test.
>
No, no. I'm using xcvb-driver:run-program/read-output-string,
which does about the same as you do below, except somewhat portably.
It works well with CCL or Allegro (thanks to a bug (858) in CCL, at that!):

ccl --load driver.lisp --eval "(progn (princ
(xcvb-driver:run-program/read-output-string "cmd /c echo \"a b c\""))
(terpri) (quit))"
==>
"a b c"

i.e. the command line is passed as is for cmd to interpret.

The closest I can do with sbcl is

ccl --load driver.lisp --eval "(progn (princ
(xcvb-driver:run-program/read-output-string '("cmd" "/c" "echo \"a b
c\""))) (terpri) (quit))"
==>
\"a b c\"

i.e. sbcl will escape the quotes, as it MUST indeed do when invoking a program
that follows the normal argument passing convention (such as SBCL itself
or any regular C program using main()).

I'm not disputing this escaping, which seems to happen correctly in
the main line
as well as in your branch.
I'm calling for the ability to specify directly the string to pass to
CreateProcess,
just like CCL and Allegro do, so that SBCL can access more Windows functionality
than is available without this ability.

Then again, maybe I can just wait for Windows to die and/or
for IOLib to grow Windows support.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
Nostalgia isn’t what it used to be.

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
David Lichteblau | 1 Nov 2011 21:44
Gravatar

Re: Windows SBCL annoyances

Quoting Far? (fahree <at> gmail.com):
> Indeed, your branch fixes this particular problem. Thanks a lot!
> 
> How is the merge going along?

Anton is doing an excellent job of merging changes from upstream into
his tree.  I would recommend use of his tree (or even binaries) over
upstream SBCL to any Windows SBCL user.

Of course, those changes should absolutely end up in upstream SBCL
eventually, too.

But any delay in Windows merging is solely my fault, not Anton's.

> Maybe instead of trying to acheive a complete merge in N perfectly
> separated patches, you could try do one patch at once, get it merged,
> then work on the next patch?

Indeed, I not aiming for a complete patchset in one go.
The order will be roughly:
  - Safepoints (Status: Patch is done, just not pushed yet)
  - I/O refactoring (Status: not yet written at all, but internals will
    be based on existing code).  This is needed so that threading can
    just fall into place afterwards.
  - Threading (Status: Stand-alone patch partly done)
  - AMD 64 support (Status: Patch review not started except for minor
    backend stuff)

d.

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
Anton Kovalenko | 2 Nov 2011 01:09
Favicon

Re: Windows SBCL annoyances

Faré <fahree <at> gmail.com> writes:

> How is the merge going along?

Better than it used to be. David Lichteblau is working on merge, and he
already made some non-revolutionary IO-related things into 1.0.52. That
is, "merge bandwidth" is now greater than "feature creep bandwidth",
which is a great improvement.

> Maybe instead of trying to acheive a complete merge in N perfectly
> separated patches, you could try do one patch at once, get it merged,
> then work on the next patch?

That's how I expected it to be done. Though there are some large
logically inseparable chunks, many things can be separated, and I'm
normally ready to do it when I have time. The latest big thing was a
support for file names longer than MAX_PATH on unicode windows, and I've
backported everything (i.e. cherry-picked with some minor modifications)
to a separate branch [lfn-upstream] that stays ready for merge until it
becomes stale.

The problem here is that I can't really know what can be accepted soon,
which SBCL developers have time to review patches and what areas should
I focus on. Keeping outstanding pieces prepared for integration takes
some resources, and I'm not yet ready to do it on /everything/ just in
case someone suddenly agrees to accept /something/. Discussing things
here does not help /this/ problem too much: I've got some very useful
feedback on long file names, for example, but my impression that it
has good chances to be integrated soon was incorrect.

Since August 2011, SBCL/windows doesn't help me to pay my bills any
longer, so I have to allocate my time more conservatively. I'm
determined to keep it from bit rot no matter what, making a buildable
tree of non-stale SBCL/windows available. Of course, things may change
to the better at any time, as I started to accept donations for ongoing
SBCL/Windows work: <http://www.siftsoft.com/support-sbcl-windows.html>.
I'm kind of skeptical here, 'cause in all my life it never worked for
/windows-specific software/, but users of portable, unix-centric Lisp
implementation are not just a typical group of "Windows people", so
there's some hope. 

>>> 2- Can there be a way for run-program to pass arguments unescaped to
>>> cmd.exe and other programs that do not follow the standard argument
>>> parsing convention? Being able to issue system commands via cmd.exe
>>> would really be nice.

>> That's probably a misdiagnosed problem: you attribute a problem in
>> MSVCRT spawn implementation to non-standard argument parsing of cmd.exe.
>> Please provide an example which doesn't work, so I'll know what to test.

> No, no. I'm using xcvb-driver:run-program/read-output-string,
> which does about the same as you do below, except somewhat portably.
> It works well with CCL or Allegro (thanks to a bug (858) in CCL, at that!):
>
> ccl --load driver.lisp --eval "(progn (princ
> (xcvb-driver:run-program/read-output-string "cmd /c echo \"a b c\""))
> (terpri) (quit))"
> ==>
> "a b c"
>
> i.e. the command line is passed as is for cmd to interpret.

[...]

It's a big can of worms, really, with all parties doing their fair share
of bugs and confusion. I'll try to explain (non-exhaustively) what's
going on in SBCL/Windows, both mainline and patched.

Windows is a non-Unix in this department: it has a real notion of
unparsed command line, and that's what is passed to child processes on
the lowest level where it makes sense (kernel32:CreateProcess). On top
of that, Windows has a convention of breaking command line into argv[]:
CommandLineToArgvW is a "reference implementation"; some runtime
libraries and even some programs opted out to roll their own equivalent,
but, with very rare exceptions, any divergence from CommandLineToArgvW
is considered a bug in a program or a runtime library. 

ECHO built-in command of cmd.exe is the worst thing we could choose for
"typical example": it's one of those rarest exceptions that doesn't work
on argv[], but rather on raw command line:

$ echo "off"
"off"
$ echo off

(in an interactive session, the /prompt/ disappears here, but line input
 is still visible, because it's required for consoles' "cooked" mode
 equivalent).

Hence you have to use some other program to test how your parameters are
likely to be interpreted. Some cat.exe [kittens of death again] from
MSYS, or cygwin, or GnuWin32 is helpful here: given a non-existent file
name, it says /which/ file is not found.

CMD /C has some obscure heuristics inside to make it "work" in more
cases. Unless you explicitly want to be able to run built-in commands,
you don't really want to introduce CMD /C into picture.
I believe, however, that for any program which /can/ be found, the
following things are equivalent:

(run-program "cmd" `("/c" ,program , <at> args) :search t)
(run-program program args :search t)

(Though they will escape some args differently in mainline SBCL and in
my fork, these two calls will be bug-for-bug compatible nevertheless).

CommandLineToArgvW convention is documented and well-known, but it's
definitely not what you expect until you read about it. Trivial cases
are unix-shell-style, of course:

two words       => {"two","words"}
"one word"      => {"one word"}
"one""word"     => {"oneword"}

Single-quotes are not special, however:

'single-quoted' => {"'single-quoted'"}
"join"'pieces'  => {"join'pieces'"}

Microsoft had to provide some way for embedding double-quotes into
arguments. The obvious Unix-like choice of backslash escaping was
obviously wrong on a system where \ is a filename separator, but when
did it prevent Microsoft from doing anything? So they decided to use \
as a single-escape character and throwed in some additional rules to
keep \-separated filenames usable. Backslashes are only special before
double-quotes; if there is a group of 2n backslashes there, they denote
n "real" backslashes, and 2n+1 backslashes denote n backslashes and
prevent special interpretation of the following double-quote. All other
backslashes denote themselves and don't escape anything. 

SB-IMPL::MSWIN-ESCAPE-COMMAND-ARGUMENT in my fork tries to reflect this
logic accurately (it works on a single argument and surrounds it with
double-quotes when it has spaces... wait, there seems to be a subtle bug
here, so I have to look deeper. For "double-quoted-spaceless-word",
quotes will mysteriously disappear in final argv). SB-IMPL::ESCAPE-ARG
from SBCL doesn't do any more than adding double-quotes. There is a
reason for it: underlying primitive used for RUN-PROGRAM on windows is
MSVCRT's _spawnv or _spawnvp, and it pretends to accept argv array, not
a command line.  Why escaping is needed at all here?

The problem: spawnvp and spawnv make a command line by throwing in
spaces as argument separators, but they don't apply escaping to
arguments themselves. This behavior is actually /documented/, but you
have to follow a link to _spawn on MSDN: the description of spawnv and
spawnvp contains no such information.

I decided to get rid of spawn* altogether by switching to CreateProcess,
and done it in my fork. In the context of above description, it's easy
to understand why I don't want any more of "native" command-line
construction and interpretation layers than absolutely necessary.

All this experience made me believe that both RUN-PROGRAM and
RUN-SHELL-COMMAND should be provided by implementation, the first
working on argv-style lists and the second on text command line.

--

-- 
Regards, Anton Kovalenko <http://github.com/akovalenko/sbcl-win32-threads>
+7(916)345-34-02 | Elektrostal' MO, Russia

------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sbcl-devel mailing list
Sbcl-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-devel

Gmane