Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-22 Thread Eric Marsden
 jgr == Juan Jose Garcia-Ripoll juanjose.garciarip...@googlemail.com 
 writes:

  jgr Here is the problem: char in Linux is signed char, while in OS X it
  jgr seems to default to unsigned char. I have changed ECL so that BASE-CHAR
  jgr objects are unboxed using the explicit C type unsigned char to avoid 
such
  jgr ambiguities. ASA I get to a non-firewalled computer I will upload the 
fix.

  Thanks for the fix. Here is another bug which is possibly related
  (still on Linux/AMD64). 

,
| ECL (Embeddable Common-Lisp) 11.1.1 
(git:78442fa7bcb4ef486b704e16d0e7cefbd4bf7680)
| Top level.
|  (lambda (a) (declare (type (eql b) a)) (eql b a))
| #bytecompiled-closure #bytecompiled-function 03cc6e10
|  (compile nil *)
| ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
| ;;;
| ;;; End of Pass 1.
| #compiled-function 03fc6980
| NIL
| NIL
|  (funcall * b)
| Condition of type: TYPE-ERROR
| b is not of type (EQL b).
`

-- 
Eric Marsden


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-22 Thread Stas Boukarev
Eric Marsden eric.mars...@free.fr writes:

 jgr == Juan Jose Garcia-Ripoll juanjose.garciarip...@googlemail.com 
 writes:

   jgr Here is the problem: char in Linux is signed char, while in OS X it
   jgr seems to default to unsigned char. I have changed ECL so that 
 BASE-CHAR
   jgr objects are unboxed using the explicit C type unsigned char to avoid 
 such
   jgr ambiguities. ASA I get to a non-firewalled computer I will upload the 
 fix.

   Thanks for the fix. Here is another bug which is possibly related
   (still on Linux/AMD64). 

 ,
 | ECL (Embeddable Common-Lisp) 11.1.1 
 (git:78442fa7bcb4ef486b704e16d0e7cefbd4bf7680)
 | Top level.
 |  (lambda (a) (declare (type (eql b) a)) (eql b a))
 | #bytecompiled-closure #bytecompiled-function 03cc6e10
 |  (compile nil *)
 | ;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
 | ;;;
 | ;;; End of Pass 1.
 | #compiled-function 03fc6980
 | NIL
 | NIL
 |  (funcall * b)
 | Condition of type: TYPE-ERROR
 | b is not of type (EQL b).
 `
I don't see how that's a bug, b isn't required to be EQL to b. It
can be, especially when coalesced by the compiler, but the reader
usually constructs a new string each time.

-- 
With best regards, Stas.

--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-22 Thread Juan Jose Garcia-Ripoll
On Tue, Nov 22, 2011 at 10:47 AM, Stas Boukarev stass...@gmail.com wrote:

 I don't see how that's a bug, b isn't required to be EQL to b. It
 can be, especially when coalesced by the compiler, but the reader
 usually constructs a new string each time.


I agree. Compare that with

 (lambda (a) (declare (type (eql #1=foo) a)) (eql '#1# a))

#bytecompiled-closure #bytecompiled-function 000103cbfa00
 (compile 'foo *)

;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=0
;;;
;;; End of Pass 1.
FOO
NIL
NIL
 (foo 'foo)

T

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-22 Thread Eric Marsden
 jgr == Juan Jose Garcia-Ripoll juanjose.garciarip...@googlemail.com 
 writes:

  jgr I agree. Compare that with

  Indeed, insufficient thinking on my part, sorry.
  
-- 
Eric Marsden


--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-18 Thread Juan Jose Garcia-Ripoll
On Sun, Nov 13, 2011 at 7:18 PM, Eric Marsden eric.mars...@free.fr wrote:

 ,
 |  (disassemble '(lambda (p1 p2) (declare (optimize (safety 0)) (type
 (member #\U00FE) p2)) (equalp p1 p2)))
 |
 | ;;; Compiling (DEFUN C::GAZONK ...).
 | ;;; Emitting code for C::GAZONK.
 | /*function definition for GAZONK*/
 | /*optimize speed 3, debug 0, space 0, safety 0  */
 | static cl_object L1c__gazonk(cl_object V1, cl_object V2)
 | { VT2 VLEX2 CLSR2 STCK2
 |   const cl_env_ptr cl_env_copy = ecl_process_env();
 |   cl_object value0;
 |   char V3;
 |   V3= CHAR_CODE(V2);


Here is the problem: char in Linux is signed char, while in OS X it
seems to default to unsigned char. I have changed ECL so that BASE-CHAR
objects are unboxed using the explicit C type unsigned char to avoid such
ambiguities. ASA I get to a non-firewalled computer I will upload the fix.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
--
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-14 Thread Eric Marsden
 jgr == Juan Jose Garcia-Ripoll juanjose.garciarip...@googlemail.com 
 writes:

  jgr This will give us a clue about the quality of the generated code -- I am
  jgr asking because in my OS X it looks just fine.

  Here is the result of attaching gdb.
  
,
| Program received signal SIGSEGV, Segmentation fault.
| [Switching to Thread 0x7f256ac2c700 (LWP 27462)]
| ecl_char_upcase (code=-2) at /usr/local/src/ecl/src/c/char_ctype.d:171
| 171   if (c[0] == 1) {
| (gdb) print c[0]
| Cannot access memory at address 0x3f8
| (gdb) disassemble
| Dump of assembler code for function ecl_char_upcase:
|0x7f256a61ccc0 +0:   push   %rbx
|0x7f256a61ccc1 +1:   mov%edi,%ebx
|0x7f256a61ccc3 +3:   callq  0x7f256a53f720 ucd_char_data@plt
| = 0x7f256a61ccc8 +8:   cmpb   $0x1,(%rax)
|0x7f256a61cccb +11:  jne0x7f256a61cce3 ecl_char_upcase+35
|0x7f256a61cccd +13:  movzbl 0x2(%rax),%edx
|0x7f256a61ccd1 +17:  movzbl 0x1(%rax),%ebx
|0x7f256a61ccd5 +21:  movzbl 0x3(%rax),%eax
|0x7f256a61ccd9 +25:  shl$0x8,%edx
|0x7f256a61ccdc +28:  add%edx,%ebx
|0x7f256a61ccde +30:  shl$0x10,%eax
|0x7f256a61cce1 +33:  add%eax,%ebx
|0x7f256a61cce3 +35:  mov%ebx,%eax
|0x7f256a61cce5 +37:  pop%rbx
|0x7f256a61cce6 +38:  retq   
| End of assembler dump.
`
  
-- 
Eric Marsden


--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-13 Thread Juan Jose Garcia-Ripoll
On Sat, Nov 12, 2011 at 12:47 PM, Eric Marsden eric.mars...@free.fr wrote:

 The following transcript illustrates a bug (on Linux/AMD64) when
 compiling code with low safety and type declarations involving unicode
 characters.


A few things would be helpful

- Configuration flags for ECL
- Value of *features*
- Output of DISASSEMBLE

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list


Re: [Ecls-list] BUG: SEGMENTATION-VIOLATION in code with DEFTYPE unicode char

2011-11-13 Thread Juan Jose Garcia-Ripoll
On Sun, Nov 13, 2011 at 7:06 PM, Eric Marsden eric.mars...@free.fr wrote:

 The bytecode disassembly of my function is below. However, the function
  works fine when byte-compiled, only segfaulting when using the C
  compiler. I haven't managed to obtain disassembly when compiled via C.


Sorry, what I meant was the C disassembly. You get it with

(require :cmp)
(disassemble '(lambda (...) ..))

This will give us a clue about the quality of the generated code -- I am
asking because in my OS X it looks just fine.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
--
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1___
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list