Nikodemus Siivola | 1 Mar 2007 10:47
Gravatar

Re: float.pure.lisp / NAN-COMPARISONS failure on Linux/x86

Stefan Lang wrote:
>  Failure:             float.pure.lisp / NAN-COMPARISONS

> If this is expected after Nikodemus Siivola's last checkin,
> ignore this mail :-)

No, this is not expected. Thanks for the report!

What platform does this happen on, and can you send the output from

  sh run-tests.sh float.pure.lisp

?

Cheers,

   -- Nikodemus

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Stefan Lang | 1 Mar 2007 14:01
Picon
Picon

Re: float.pure.lisp / NAN-COMPARISONS failure on Linux/x86

On Thursday 01 March 2007 10:47, Nikodemus Siivola wrote:
> Stefan Lang wrote:
> >  Failure:             float.pure.lisp / NAN-COMPARISONS
> >
> > If this is expected after Nikodemus Siivola's last checkin,
> > ignore this mail :-)
>
> No, this is not expected. Thanks for the report!
>
> What platform does this happen on, and can you send the output from
>
>   sh run-tests.sh float.pure.lisp

$ uname -a
Linux linux-sl 2.6.13-15-default #1 Tue Sep 13 14:56:15 UTC 2005 i686 
i686 i386 GNU/Linux

$ sh run-tests.sh float.pure.lisp &> float.pure.out
Attachment (float.pure.out): text/x-objcsrc, 7936 bytes
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
(Continue reading)

Nikodemus Siivola | 2 Mar 2007 18:05
Gravatar

Re: float.pure.lisp / NAN-COMPARISONS failure on Linux/x86

Stefan Lang wrote:

>>>  Failure:             float.pure.lisp / NAN-COMPARISONS

Failure was due a bad test, fixed in 1.0.3.13. Thanks for the report!

Cheers,

   -- Nikodemus

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Mark W Johnson | 3 Mar 2007 08:27
Picon

sb-alien array allocation

I would like to be able to generate alien arrays whose length is determined at run time, but I am having trouble understanding how to do this using (sb-alien:with-alien () ) or make-alien.

My attempt at this, along the lines shown below, fails:

> This is SBCL 1.0.2, an implementation of ANSI Common Lisp.
> More information about SBCL is available at < http://www.sbcl.org/>.
> SBCL is free software, provided as is, with absolutely no warranty.
...

> CL-USER> (defun my-func (a-seq)
>          (sb-alien:with-alien
>           ((x (array (sb-alien:unsigned 32)  (length a-seq)))) x))
>
>; in: LAMBDA NIL
>;     (WITH-ALIEN ((X (ARRAY (UNSIGNED 32) (LENGTH A-SEQ)))) X)
>;
>; caught ERROR:
>;   (in macroexpansion of (WITH-ALIEN # X))
>;   (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
>;   The first dimension is not a non-negative fixnum or NIL: (LENGTH A-SEQ)

>;     (SB-INT:NAMED-LAMBDA MY-FUNC (A-SEQ) (BLOCK MY-FUNC (WITH-ALIEN ((X #)) X)))
>; ==>
>;   #'(SB-INT:NAMED-LAMBDA MY-FUNC (A-SEQ) (BLOCK MY-FUNC (WITH-ALIEN ((X #)) X)))
>;
>; caught STYLE-WARNING:
>;   The variable A-SEQ is defined but never used.
>;
>; compilation unit finished
>;   caught 1 ERROR condition
>;   caught 1 STYLE-WARNING condition
...

I find I can only use a literal fixnum, not a symbol or form that evaluates to a fixnum, in the dimension specification for the array x.

A second attempt (which also includes a simple test):

> (defun my-func (a-seq)
>       (eval        
>        `(sb-alien:with-alien
>          ((x (array (sb-alien:unsigned 32)  ,(length a-seq))))
>          (loop for k below ,(length a-seq) do
>            (setf (sb-alien:deref x k) (elt ,a-seq k))
>            (format t "~d:~d~%" k (sb-alien:deref x k))))))
>MY-FUNC
>CL-USER> (my-func #(1 2 3 4 5 4 3 2 1))
>0:1
>1:2
>2:3
>3:4
>4:5
>5:4
>6:3
>7:2
>8:1
>NIL
>
appears to work, but seems awkward to me - as though I am missing something.  Is there a more straightforward way to go about this?
The point of converting to an alien array is for passing data to a linux kernel module.  At the moment I am using a solution (not shown) that simply hard-wires the array size to the maximum possible for the application, and this works, but I am hoping for something more efficient.

In case it matters, I am using sbcl 1.02 on
Linux 2.6.17-1.2174_FC5 #1 Tue Aug 8 15:30:55 EDT 2006 i686 i686 i386 GNU/Linux

Regards,
Mark

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Juho Snellman | 3 Mar 2007 10:06
Picon
Picon
Favicon

Re: sb-alien array allocation

"Mark W Johnson" <mwjohnson0 <at> gmail.com> writes:
> I would like to be able to generate alien arrays whose length is determined
> at run time, but I am having trouble understanding how to do this using
> (sb-alien:with-alien () ) or make-alien.

For MAKE-ALIEN you can specify the size dynamically with the optional
SIZE parameter. Just use a dummy value for the dimension in the
type. For example (make-alien (array (unsigned 32) 0) y).

--

-- 
Juho Snellman

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Mark W Johnson | 3 Mar 2007 22:34
Picon

Re: sb-alien array allocation

This is just what I needed.
Thank You.

Mark


On 03 Mar 2007 11:06:47 +0200, Juho Snellman <jsnell <at> iki.fi > wrote:
"Mark W Johnson" <mwjohnson0 <at> gmail.com > writes:
> I would like to be able to generate alien arrays whose length is determined
> at run time, but I am having trouble understanding how to do this using
> (sb-alien:with-alien () ) or make-alien.

For MAKE-ALIEN you can specify the size dynamically with the optional
SIZE parameter. Just use a dummy value for the dimension in the
type. For example (make-alien (array (unsigned 32) 0) y).

--
Juho Snellman


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Edi Weitz | 5 Mar 2007 13:04
Picon
Favicon

Useless backtraces / functions called NIL

I'm currently working on parts of a large project that I don't have
complete control of.  I don't even know all parts of it good enough
yet.  What I /do/ know, though, is that I sometimes (pretty often,
actually) get completely useless backtraces where the "interesting"
function calls are replaced with calls to functions named NIL.  I've
attached a part of such a backtrace below (some names modified because
the code is confidential).  The frames I'm interested in in this case
are #13 and #14 - note that they both start with NIL as well as the
one in frame #16.

When the functions appearing in frames 13 to 16 where compiled (with
ASDF), SB-C::*POLICY* looked like this

  ((SB-EXT:INHIBIT-WARNINGS . 1)
   (SPEED . 1)
   (SAFETY . 3)
   (COMPILATION-SPEED . 1)
   (SPACE . 1)
   (DEBUG . 3))

which I think is not a very aggressive setting.  So, what could be the
reason for this behaviour?  Any other settings that might affect this?
I skimmed the list archives a bit, but I didn't really know what to
search for.

I suppose/hope it is not expected that I see these "NIL frames" and
that I can make them go away somehow.

Thanks in advance for your help,
Edi.

  7: (SB-KERNEL::ODD-KEY-ARGS-ERROR-HANDLER
      #<unavailable argument>
      #<unavailable argument>
      #<unavailable argument>
      #<unavailable argument>)
  8: (SB-KERNEL:INTERNAL-ERROR
      #.(SB-SYS:INT-SAP #XF63C3EDC)
      #<unavailable argument>)
  9: ("foreign function: call_into_lisp")
  10: ("foreign function: funcall2")
  11: ("foreign function: interrupt_internal_error")
  12: ("foreign function: sigtrap_handler")
  13: (NIL :PARTS)
  14: (NIL
       #<FOO-OBJECT>
       #<BAR-OBJECT>
       #<FROB-OBJECT>
       :SOME-KEYWORD)
  15: (DO-SOMETHING
       #<QUUX-OBJECT>
       NIL)
  16: (NIL FROB-TEST)
  17: (SB-INT:SIMPLE-EVAL-IN-LEXENV
       (RUN-TEST 'FROB-TEST)
       #<NULL-LEXENV>)
  18: (SWANK::EVAL-REGION
       "(run-test 'frob-test)
  "
       T)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Juho Snellman | 5 Mar 2007 14:59
Picon
Picon
Favicon

Re: Useless backtraces / functions called NIL

Edi Weitz <edi <at> agharta.de> writes:
> I'm currently working on parts of a large project that I don't have
> complete control of.  I don't even know all parts of it good enough
> yet.  What I /do/ know, though, is that I sometimes (pretty often,
> actually) get completely useless backtraces where the "interesting"
> function calls are replaced with calls to functions named NIL.

SBCL almost always stores enough debug information to show at least
the name of the function, regardless of the compiler policy. The only
circumstance I know of where NIL shows up as the function name in a
backtrace is for anonymous functions compiled using (compile nil ...),
or some other construct that essentially boils down to that. For
example (eval '(foo)) -> (funcall (compile nil '(lambda () (foo)))).

But it shouldn't really be happening for named functions, or when
using file compilation.

> I suppose/hope it is not expected that I see these "NIL frames" and
> that I can make them go away somehow.

Hard to say without seeing an example. The attached patch fixes the
issue I described above, but might not help if it's something else.

Index: src/compiler/main.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/compiler/main.lisp,v
retrieving revision 1.124
diff -u -r1.124 main.lisp
--- src/compiler/main.lisp	4 Mar 2007 23:47:58 -0000	1.124
+++ src/compiler/main.lisp	5 Mar 2007 13:53:12 -0000
 <at>  <at>  -976,7 +976,8  <at>  <at> 
     (let* ((locall-fun (let ((*allow-instrumenting* t))
                          (funcall #'ir1-convert-lambdalike
                                   definition
-                                  :source-name name)))
+                                  :source-name name
+                                  :debug-name definition)))
            (debug-name (debug-name 'tl-xep name))
            ;; Convert the XEP using the policy of the real
            ;; function. Otherwise the wrong policy will be used for

--

-- 
Juho Snellman
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Christophe Rhodes | 5 Mar 2007 15:33
Favicon

Re: float.pure.lisp / NAN-COMPARISONS failure on Linux/x86

Nikodemus Siivola <nikodemus <at> random-state.net> writes:

> Stefan Lang wrote:
>
>>>>  Failure:             float.pure.lisp / NAN-COMPARISONS
>
> Failure was due a bad test, fixed in 1.0.3.13. Thanks for the report!

I'm still getting failures on x86-64/linux, 1.0.3.30:

  (sb-int:with-float-traps-masked (:invalid) 
    (funcall (lambda () (>= 1.0 (/ 0.0 0.0)))))

returns T, whereas 

  (sb-int:with-float-traps-masked (:invalid) 
    (eval '(>= 1.0 (/ 0.0 0.0))))

returns NIL.

Furthermore, I think there are more problems lurking; for instance,

  (lambda (x) (= x x))

will bogusly return T on a NaN argument, given the transform's use of
REFLEXIVE-P (src/compiler/srctran.lisp).  (Similarly, (/= x x)
probably should return T for x being NaN...)

Cheers,

Christophe

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
Edi Weitz | 5 Mar 2007 15:48
Picon
Favicon

Re: Useless backtraces / functions called NIL

On 05 Mar 2007 15:59:09 +0200, Juho Snellman <jsnell <at> iki.fi> wrote:

> SBCL almost always stores enough debug information to show at least
> the name of the function, regardless of the compiler policy. The
> only circumstance I know of where NIL shows up as the function name
> in a backtrace is for anonymous functions compiled using (compile
> nil ...), or some other construct that essentially boils down to
> that. For example (eval '(foo)) -> (funcall (compile nil '(lambda ()
> (foo)))).
>
> But it shouldn't really be happening for named functions, or when
> using file compilation.

In my case these were named functions defined with DEFUN and compiled
with COMPILE-FILE (from ASDF)... :(

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

Gmane