From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mark@markwitmer.com Newsgroups: gmane.lisp.guile.user Subject: Trouble w/sockets Date: Sat, 02 Mar 2013 22:38:12 -0500 Message-ID: <871ubxxie3.fsf@markwitmer.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1362281897 408 80.91.229.3 (3 Mar 2013 03:38:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 3 Mar 2013 03:38:17 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Mar 03 04:38:39 2013 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UBzl1-0007rA-12 for guile-user@m.gmane.org; Sun, 03 Mar 2013 04:38:39 +0100 Original-Received: from localhost ([::1]:54878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBzkf-0007Pz-MV for guile-user@m.gmane.org; Sat, 02 Mar 2013 22:38:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBzkW-0007OX-Fk for guile-user@gnu.org; Sat, 02 Mar 2013 22:38:10 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBzkV-0002Tk-GL for guile-user@gnu.org; Sat, 02 Mar 2013 22:38:08 -0500 Original-Received: from mail-ie0-x22f.google.com ([2607:f8b0:4001:c03::22f]:53144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBzkV-0002Tg-Bw for guile-user@gnu.org; Sat, 02 Mar 2013 22:38:07 -0500 Original-Received: by mail-ie0-f175.google.com with SMTP id c12so4909506ieb.20 for ; Sat, 02 Mar 2013 19:38:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:mime-version :content-type:x-gm-message-state; bh=9YfTrxJbsnu1lOd+7EBOvSUL8wkEpXZryW92lTeuB6w=; b=BCPi+bO8y3WVMmDhgss+bIFAyRcWKEA8XJGjhaEqaVVIiSuiLLLhIziIIFXQBT7ufm wJXjgUhcdKK25VILDm40aykcN5mxm7idAOaimlOVPa+FcIXx2b+tMmdtnGSN5S4yGJbL eLP39J+gzoHPRQydNEP3TR0rZ6T6ohkv7UmWJTguDlAQfBC9K5ZSQVezfXy19iQuOIgF iGstPKKQortItHFtaMzTnnSodG8ud2BjCGoXWfhPjaUvKShMSv5xuaxmYhN33vgoY+8o LYpau8WwebaMJWxGkyGF7vWs5lDWzUkNYVj1RuS49QY1jWGzb+FW25PTF13PieO2hzSR G8pw== X-Received: by 10.42.122.66 with SMTP id m2mr18825278icr.15.1362281886129; Sat, 02 Mar 2013 19:38:06 -0800 (PST) Original-Received: from localhost (cpe-184-58-115-186.woh.res.rr.com. [184.58.115.186]) by mx.google.com with ESMTPS id wx2sm5312081igb.4.2013.03.02.19.38.04 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 02 Mar 2013 19:38:05 -0800 (PST) X-Gm-Message-State: ALoCoQnT6V1khWkUN54fT0ZwlgrOMi/h+4wz7fL6mT9p/8tJUt29n1Fqv0FFJcfHWwyzBLBHoJmb X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c03::22f X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:10159 Archived-At: Hi all, I've made lots of progress on my Guile xcb code and it talks to the X server now, send requests, receive replies and so forth. However, if the X server requires authentication, there's trouble. I'm able to send the authentication method's name over the socket that connects to the X server, but as soon as I try to send the first byte of the authentication value, Guile crashes. This code should hopefully reproduce the issue (assuming you're on a little-endian system and have an X server listening at the given socket). The segment of data starting with 77 is the authentication method's name; then there's an equally long sequence of zeros and the remaining numbers are the authentication value and some more padding. (define sock (socket AF_UNIX SOCK_STREAM 0)) (connect sock (make-socket-address AF_UNIX "/tmp/.X11-unix/X0")) (for-each (lambda (b) (write-char (integer->char b) sock)) '(108 0 11 0 0 0 18 0 16 0 0 0 77 73 84 45 77 65 71 73 67 45 67 79 79 75 73 69 45 49 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 243 236 56 103 158 249 237 124 101 131 158 31 63 251 239 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)) This will obviously be the wrong authentication data for anyone else's X server; however, even if X closes the socket prematurely (not that it's supposed to, but it might), Guile shouldn't just crash, should it? Thanks -- Mark Witmer