Philippe Mechaï | 11 Apr 2007 22:03
Picon
Favicon

Reading special file blocks forever

Hi,

I am fairly new to Lisp so maybe I'm doing something wrong but I can't
tell what.

I have the following piece of code:
------------------------------------------
(with-open-file (in "/proc/asound/cards")
  (with-standard-io-syntax
    (do ((line (read-line in nil)
               (read-line in nil)))
        ((null line))
      (print line))))
------------------------------------------

When I load it in SBCL (v1.0 on Ubuntu x86) the program blocks forever.
I pasted below a backtrace I got after pressing CTRL-C to see what was
going on but I can't tell what the problem is.

This code works for other files, but seems to block on this file which
is a special file.

Thanks in advance for your answers.

Regards,
Philippe Mechaï

PS: the exact same code works fine in CLISP.

------------------------------------------------------------------------
(Continue reading)

Markus Grueneis | 11 Apr 2007 23:03
Picon
Picon

sbcl/win32 + slime + asdf

Hi!

I'm experiencing some problems when using SBCL on WinXP + SLIME + ASDF  
(with patch from lichtblau to support .lnk files like symlinks).

When I'm using unpatched asdf.lisp/fasl as delivered with sbcl-1.0.2.msi  
 from sourceforge, Gnu Emacs + SLIME + SBCL works like a charm (but the  
symlink part of asdf...).  When using lichtblau's patch, which does it's  
work correctly, I cannot start SLIME anymore, with an error occuring when  
trying to compile swank-sbcl.lisp (see below).  If I then try another time  
to startup, I get an error about incorrect fasl type (something like 'got  
#(0 0 0 0 0)'), which seems quite understandable given the fasl file has  
something about 0 kiB.\

Manually deleting the file works without problems, I tried to deactivate  
usual suspects (antivirus, indexing service, tortoisesvn cache), but that  
didn't help.  I'm quite puzzled, as I cannot understand the connection  
between a slightly modified asdf and a file-access error.

As somebody on #lisp pointed out, on Windows files cannot be deleted as  
long as somebody has an open handle to it (that was the part I knew), but  
on POSIX this is possible (that was what I did not know).  As I'm workin  
with an admin account, the 'permission denied' error probably has its root  
in this issue.

I'll be glad to help, but would kindly request some guidance in the  
process.

Best regards and thx,
Markus
(Continue reading)

jjmccaw | 12 Apr 2007 00:16
Picon
Favicon

Requesting to join your mailing list

thanks.

-------------------------------------------------------------------------
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
Luis Oliveira | 12 Apr 2007 06:11
Picon
Gravatar

Re: Requesting to join your mailing list

<jjmccaw <at> UDel.Edu> writes:
> thanks.

<https://lists.sourceforge.net/lists/listinfo/sbcl-help>

--

-- 
Luís Oliveira
http://student.dei.uc.pt/~lmoliv/

-------------------------------------------------------------------------
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
jjmccaw | 12 Apr 2007 21:46
Picon
Favicon

Socket-send pre .9.12

Hello everyone.  I am trying to send information over a TCP connection.  I have the socket and stream setup but
am having difficulties sending data over it.  Upon researching, i found the Sb-bsd-sockets:socket-send
would suit my needs.  I then discovered that this became available in .9.12 and since i am running a Sparc
machine with solaris, i am limited to only .9.11.  So, i downloaded the sbcl .9.14 source code and attempted
to compile it's sb-bsd-socket:socket-send function.  I  copied that into a file and made it a normal
function instead of  being part of the library (made it a defun).  I then copied over many other functions
that are called by it directly or indirectly.  When i go to run the function though, i am told that
(sockint::sendto()) is an undefined function.  I attempted to require that library but that did not find
anything.  so my questions are as follows:

1.  Is there another way to send data over the stream that does not use sb-bsd-sockets:socket-send (i assume
there has to be) 
OR
2.  Does sockint::sendto belong to a library and if so, what is it?

thank you,
John

-------------------------------------------------------------------------
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
Eli Naeher | 15 Apr 2007 19:00
Picon

Type checking

Hello,

According to the manual, type declarations (for type specifiers which
do not use satisfies) are treated as assertions, in function
declarations and structure slots. Apparently this is not true of class
slots. (With (declare (optimize (safety 3))), I can cause a type error
during make-instance when an initform is not of the specified type for
the slot, but not when setting slot values after the object is
initialized.) Is there any way I can coerce SBCL into doing strict
type checks whenever a slot value is updated?

Thanks,

--Eli

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Juho Snellman | 15 Apr 2007 21:47
Picon
Picon
Favicon

Re: Type checking

"Eli Naeher" <enaeher <at> gmail.com> writes:

> Hello,
> 
> According to the manual, type declarations (for type specifiers which
> do not use satisfies) are treated as assertions, in function
> declarations and structure slots. Apparently this is not true of class
> slots. (With (declare (optimize (safety 3))), I can cause a type error
> during make-instance when an initform is not of the specified type for
> the slot, but not when setting slot values after the object is
> initialized.) Is there any way I can coerce SBCL into doing strict
> type checks whenever a slot value is updated?

To catch all writes to the slot you must use a (SAFETY 3) compilation
policy both at the location of the the class definition and at the
location where you're writing to the slot. Just doing a global
(declaim (optimize safety)) should be sufficient.

(Thanks for noting that the current state of type checking of CLOS
slots isn't correctly documented).

--

-- 
Juho Snellman

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
(Continue reading)

Jonathon McKitrick | 17 Apr 2007 15:14

Stopping all threads before saving image

This is the way I've been stopping threads before saving an image:

  (dolist (thread (sb-thread:list-all-threads))
    (unless (eq thread sb-thread:*current-thread*)
      (sb-thread:terminate-thread thread)))

it works fine on OSX Intel (with experimental threads), and used to work on debian linux.  Now, though, when saving the image I get this error, as if I had not stopped the threads:

---
debugger invoked on a SIMPLE-ERROR in thread #<THREAD "initial thread" {A7447A9}>:
  Cannot save core with multiple threads running.
---

Has something changed in the internals that would change how I would close down the threads?

I'm running 1.0.2 on linux, 1.0.4 on OSX Intel.


--
Jonathon McKitrick



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sbcl-help mailing list
Sbcl-help <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help
Nikodemus Siivola | 17 Apr 2007 15:30
Gravatar

Re: Stopping all threads before saving image

Jonathon McKitrick wrote:
> This is the way I've been stopping threads before saving an image:
> 
>   (dolist (thread (sb-thread:list-all-threads))
>     (unless (eq thread sb-thread:*current-thread*)
>       (sb-thread:terminate-thread thread)))
> 
> it works fine on OSX Intel (with experimental threads), and used to work 
> on debian linux.  Now, though, when saving the image I get this error, 
> as if I had not stopped the threads:

Note that TERMINATE-THREAD may return before the thread has exited, and the
thread may refuse do die or even spin a new thread as it dies:

  (defun horror () (unwind-protect (loop) (make-thread 'horror) (horror)))

  (make-thread 'horror :name "have luck killing me!")

Assuming that all your threads are willing to die nicely (not that
TERMINATE-THREAD is ever quite safe), you should do JOIN-THREAD after
the termination call to ensure the thread has finished.

Also, do you possibly have something in *SAVE-HOOKS* that spins a new thread?

Cheers,

  -- Nikodemus Siivola

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Johan Ur Riise | 17 Apr 2007 15:49
Picon

Re: Socket-send pre .9.12

On Thu, 2007-04-12 at 15:46 -0400, jjmccaw <at> UDel.Edu wrote:
> Hello everyone.  I am trying to send information over a TCP connection.  I have the socket and stream setup
but am having difficulties sending data over it.  Upon researching, i found the
Sb-bsd-sockets:socket-send would suit my needs.  I then discovered that this became available in .9.12
and since i am running a Sparc machine with solaris, i am limited to only .9.11.  So, i downloaded the sbcl
.9.14 source code and attempted to compile it's sb-bsd-socket:socket-send function.  I  copied that into
a file and made it a normal function instead of  being part of the library (made it a defun).  I then copied over
many other functions that are called by it directly or indirectly.  When i go to run the function though, i am
told that (sockint::sendto()) is an undefined function.  I attempted to require that library but that did
not find anything.  so my questions are as follows:
> 
> 1.  Is there another way to send data over the stream that does not use sb-bsd-sockets:socket-send (i
assume there has to be) 
> OR
> 2.  Does sockint::sendto belong to a library and if so, what is it?
> 

I think the normal way to use a socket in tcp-mode is to get the stream
with (sb-bsd-sockets:socket-make-stream ...), then to use the normal
stream functions like read-char, write-sequence etc.

socket-send is good if you use udp, although from the documentation it
can also be used for tcp (I never tried that).

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Gmane