Arto Bendiken | 15 Oct 16:45 2014
Picon

Coverity Scan defect report for ECL

Good afternoon,

As noted to Matt in the other thread, I've registered the ECL project
with the Coverity Scan [1] static analysis cloud service—offered free
of charge to open-source projects—and have had them crunch through the
C portions of the code base.

Submitting a first build of HEAD to them yesterday, Coverity reported
639 defects [2]. I've triaged a number of the defects and thus far
eliminated or mitigated 23 of them through various means; see the
recent commits to HEAD. Note that in commit messages, CID means
Coverity ID—the identifier for a defect report in Coverity Scan.

The breakdown by category for the remaining 616 outstanding defect
reports is as follows:

• Control flow issues: 249
• API usage errors: 233
• Memory - illegal accesses: 83
• Uninitialized variables: 20
• Integer handling issues: 8
• Error handling issues: 8
• Code maintainability issues: 7
• Memory - corruptions: 3
• Insecure data handling: 1
• Null pointer dereferences: 1
• Incorrect expression: 1
• Security best practices violations: 1
• Resource leaks: 1

(Continue reading)

Matthew Mondor | 15 Oct 00:44 2014
Picon

NUL-termination bug in SOCKET-BIND and SOCKET-CONNECT


> Fixed a NUL-termination bug in SOCKET-BIND and SOCKET-CONNECT. by Arto Bendiken http://sourceforge.net/p/ecls/ecl/ci/fa48714dd86d4bf2c3c1f0210cca3e7875771e92/
>
> http://sourceforge.net/p/ecls/ecl/ci/fa48714dd86d4bf2c3c1f0210cca3e7875771e92/tree/contrib/sockets/sockets.lisp?diff=633c3a5f63a602ce18c54bfe88922d8644cbe619
>
> The backslash in '\0' got lost on the way to the generated C file
> (build/ext/sockets.c). There may be more of these issues elsewhere
> in the code base.
> This resolves CIDs 66405 and 66413 (Buffer not null terminated).

Hmm this is quite peculiar...  it makes me wonder if it's not a
compiler issue.

I couldn't find bugs 66405/66413, where can I read these?  Thanks.

And thanks for working on improving ECL,
--

-- 
Matt

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Picon

Link .o or .so to a running ECL program

Hello all,

I am wondering if it is possible to link a pure C compiled file, in .o
or .so (or .dll) formats, into a running Lisp process and how I can do that.

The case is a am running ECL via Emacs+Slime and it would be very useful
to link some modules written in C to bind then via uffi or native ffi.

Regards,

JRM

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Arto Bendiken | 21 Sep 16:38 2014
Picon

Patch queue housecleaning

Howdy,

In preparation for submitting some ECL patches of my own, I triaged
each of the patches currently in open/accepted state over at
SourceForge's patch tracker:

https://sourceforge.net/p/ecls/patches/

Looks like the patch queue could use some housecleaning, as the oldest
ticket has been open since 2010. My conclusions are as follows:

Tickets that can be closed as wont-fix, lacking a response from the
submitter for the past two years:

https://sourceforge.net/p/ecls/patches/8/

Tickets that can be closed because their attached patches have already
been merged previously:

https://sourceforge.net/p/ecls/patches/29/
https://sourceforge.net/p/ecls/patches/30/
https://sourceforge.net/p/ecls/patches/31/
https://sourceforge.net/p/ecls/patches/34/

Patches that ought to be merged, being trivial and obviously correct:

https://sourceforge.net/p/ecls/patches/33/
https://sourceforge.net/p/ecls/patches/37/

Patches that probably ought to be merged, but I'm not qualified to say:
(Continue reading)

daiyanh | 18 Sep 09:42 2014
Picon

Runtime bug in compiled code

ECL version: GIT of sometime in July, 2014
Platform: Windows 8.1, MSVC 2010 compiler, EMACS 24.3, SLIME 2014-8-1

The following code converts SRT subtitle file to SAMI format.
It works when eval'ed as is in the REPL or C-x C-e.
However, when (compile 'baz), it gives STORAGE-EXHAUSTED error
and stops.

(defun baz (f &key (format :iso-8859-1) (left 29) (right 29) (size 24) (align :center) (font "Meiryo") (weight :bold) (color :white) &aux p)
  (labels ((tr (c &aux (b (char-code c)))
      (if (< b 128) c (format nil "&#x~x;" b)))
    (tx (s)
      (setq s (mapcar (lambda (s) (format nil "~{~a~}" (map 'list #'tr s))) s))
      (apply
       #'concatenate 'string
       (mapl (lambda (s) (if (cdr s) (rplacd s (push "<br>" (cdr s))))) s)))
    (foo (x) (if x (+ (car x) (* 60 (foo (cdr x)))) 0))
    (ms (s) (round (foo (reverse (read-from-string s))) 1/1000))
    (bar (r &aux b e x)
      (setq r (cdr (reverse r)))
      (setq x (tx (cdr r)))
      (setq b (substitute #\space #\: (car r)))
      (setq b (substitute #\. #\, b))
      (setq e (format nil "(~a)" (subseq b (1+ (position #\> b)))))
      (setq b (format nil "(~a)" (subseq b 0 (position #\- b))))
      (format nil "<SYNC START=~a>~%<P CLASS=SUBTTL>~a~%<SYNC START=~a>~%" (ms b) x (ms e))))
    (with-open-file (s (format nil "../../desktop/~a.srt" f))
      (setf (stream-external-format s) format)
      (do ((l (read-line s) (read-line s nil))) ((not l) (setq p (reverse p)))
 (do ((m l (read-line s nil)) q)
     ((zerop (length m)) (if q (push (bar q) p)))
   (push m q)))))
  (push (format nil "<SAMI>~%<HEAD>~%<STYLE TYPE=\"Text/css\">~%<!--~%P {margin-left: ~dpt; margin-right: ~dpt; font-size: ~dpt; text-align: ~a; font-family: ~a; font-weight: ~a; color: #FFFFFF; background-color: #000000;}~%.SUBTTL {Name: 'Subtitles'; Lang: ja; SAMIType: CC;}~%-->~%</STYLE>~%</HEAD>~%<BODY>~%" left right size align font weight color) p)
  (rplacd (last p) (list (format nil "</BODY>~%</SAMI>~%")))
  ;;(rplacd (cdddr p) nil)
  (with-open-file (s (format nil "../../desktop/~a.smi" f) :direction :output)
    ;;(setf (stream-external-format s) '(:utf-8 :crlf))
    (format s "~{~a~}" p)))

Sent from Windows Mail

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Morgon Kanter | 11 Sep 22:36 2014
Picon

Stack saving: any interest?

I've been working on a resource project for developing lightweight ("green") threads in Common Lisp, without needing ahead-of-time code walking like in the green-threads library. Part of the project has necessitated adding the ability to save and restore the stack as part of the underlying Common Lisp implementation. I've chosen to use ECL for the project as it is a small and more easily understood codebase.

My question is -- would there be any interest in merging this functionality back into ECL proper once I've completed it? The proposed interface is simply:

(mp:save-stack) -- returns a stack object (can be used as a first-class lisp variable, garbage collected normally, etc.).
(mp:restore-stack stack-object) -- restores the stack to that given by stack-object. This function does not return.

Cheers,
-- Morgon
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
cm | 1 Sep 03:39 2014
Picon

new Ecl 13.5.1 crash when build

Hello
I build the Ecl 13.5.1 with  msvc 2012 on Win7 SP1. 
It report a error info:

        date /t > BUILD-STAMP
        set ECLDIR=./
        ecl_min < compile.lsp
NMAKE : fatal error U1077: 'ecl_min' : return code '0xc00000fd'
Stop.

Thank for some help!
------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Colin Gilbert | 24 Aug 22:44 2014
Picon

C standard in use?

Hi,

I was wondering as to which standard of C that ECL conforms. Does it make use of any extensions such as Gnu-C or specific coding styles that may interrupt a compiler? When I generate code to embed, will it require any specific options? I checked the FAQ and docs, but to no avail.

Thanks,
Colin

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Ecls-list mailing list
Ecls-list@...
https://lists.sourceforge.net/lists/listinfo/ecls-list
Fausto Saporito | 14 Aug 11:37 2014
Picon

Re: quite successfull build Tru64 (ev68) 5.1 with gcc 4.2.3

Hello all,

eventually I completed the build.

In order to avoid some arbitrary change in the code, I adopted a
different solution.
So, just to recap:

1) build gmp outside the process (using native compiler but using the
source provided in the package). I found some asm errors compiling
within the building process. So I preferred to build separately with
the Compaq CC.

2) some missing definition : UULONG_MAX, etc. I added in src/c/main.d
the following lines (borrowed by INTERNET ... if I remember well they
are from Bruno Haible)

# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))

# define TYPE_MAXIMUM(t) \
    ((t) (! TYPE_SIGNED (t) \
      ? (t) -1 \
     : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))

# ifndef ULONG_LONG_MAX
#  define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long)
# endif
# ifndef LONG_LONG_MAX
#  define LONG_LONG_MAX TYPE_MAXIMUM (long long int)
# endif
# ifndef LONG_LONG_MIN
#  define LONG_LONG_MIN TYPE_MINIMUM (long long int)
# endif

3) setup these env variable, before to run configure:

   a) LIBS="-lpthread -lrt"
   b) CFLAGS="-D_POSIX_PII_SOCKET -DAF_LOCAL=AF_UNIX"

then I used this parameters to configure:

./configure --without-x --disable-shared --enable-c99complex

The item 2) should be fixed in a different way, but I don't know how
to do this... i.e. create a new include file ? or modify source.d in a
permanent way with some #ifdef.

regards,
Fausto

2014-08-13 21:31 GMT+02:00 Fausto Saporito <fausto.saporito@...>:
> Hello all,
>
> just to say I was quite able to build ecl-13.5.1
>
> some changes to the standard build process:
>
> 1) build gmp outside the process (using native compiler but using the
> source provided in the package). I found some asm errors compiling
> within the building process. So I preferred to build separately with
> the Compaq CC.
>
> 2) ecl_min building: is missing -lpthread and -lrt otherwise we have
> undefined symbols
>
> 3) some missing definition : UULONG_MAX, etc. I added in src/c/main.d
> the following lines (borrowed by INTERNET ... if I remember well they
> are from Bruno Haible)
>
> # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
>
> # define TYPE_MAXIMUM(t) \
>     ((t) (! TYPE_SIGNED (t) \
>       ? (t) -1 \
>      : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
>
> # ifndef ULONG_LONG_MAX
> #  define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long)
> # endif
> # ifndef LONG_LONG_MAX
> #  define LONG_LONG_MAX TYPE_MAXIMUM (long long int)
> # endif
> # ifndef LONG_LONG_MIN
> #  define LONG_LONG_MIN TYPE_MINIMUM (long long int)
> # endif
>
> quite at end I have a serious error, compiling ext/socket.c
> complaining that socklen_t is not defined... so I added
>
> typedef unsigned long socklen_t; /* 64-bits */ in ecl-cmp.h
>
> but now, running again the make I have an error:
>
> ;;; Compiling #<concatenated stream 0000000144c36e60>
> (compile-file "ext:sockets;sockets.lisp" :output-file
> #P"BUILD:EXT;SOCKETS.O.NEWEST" :SYSTEM-P T :C-FILE T :DATA-FILE T
> :H-FILE T)
> ;;;
> ;;; Compiling EXT:SOCKETS;SOCKETS.LISP.
> ;;; OPTIMIZE levels: Safety=2, Space=1, Speed=1, Debug=1
> ;;;
>
> Condition of type: SIMPLE-PACKAGE-ERROR
> There exists no package with name "SB-BSD-SOCKETS"
>
> Should I delete build directory and make again everything ?
>
> I used --without-x and --enable-c99complex options, the other ones are
> the default ones.
>
> regards
> Fausto

------------------------------------------------------------------------------
Fausto Saporito | 13 Aug 21:31 2014
Picon

quite successfull build Tru64 (ev68) 5.1 with gcc 4.2.3

Hello all,

just to say I was quite able to build ecl-13.5.1

some changes to the standard build process:

1) build gmp outside the process (using native compiler but using the
source provided in the package). I found some asm errors compiling
within the building process. So I preferred to build separately with
the Compaq CC.

2) ecl_min building: is missing -lpthread and -lrt otherwise we have
undefined symbols

3) some missing definition : UULONG_MAX, etc. I added in src/c/main.d
the following lines (borrowed by INTERNET ... if I remember well they
are from Bruno Haible)

# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))

# define TYPE_MAXIMUM(t) \
    ((t) (! TYPE_SIGNED (t) \
      ? (t) -1 \
     : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))

# ifndef ULONG_LONG_MAX
#  define ULONG_LONG_MAX TYPE_MAXIMUM (unsigned long long)
# endif
# ifndef LONG_LONG_MAX
#  define LONG_LONG_MAX TYPE_MAXIMUM (long long int)
# endif
# ifndef LONG_LONG_MIN
#  define LONG_LONG_MIN TYPE_MINIMUM (long long int)
# endif

quite at end I have a serious error, compiling ext/socket.c
complaining that socklen_t is not defined... so I added

typedef unsigned long socklen_t; /* 64-bits */ in ecl-cmp.h

but now, running again the make I have an error:

;;; Compiling #<concatenated stream 0000000144c36e60>
(compile-file "ext:sockets;sockets.lisp" :output-file
#P"BUILD:EXT;SOCKETS.O.NEWEST" :SYSTEM-P T :C-FILE T :DATA-FILE T
:H-FILE T)
;;;
;;; Compiling EXT:SOCKETS;SOCKETS.LISP.
;;; OPTIMIZE levels: Safety=2, Space=1, Speed=1, Debug=1
;;;

Condition of type: SIMPLE-PACKAGE-ERROR
There exists no package with name "SB-BSD-SOCKETS"

Should I delete build directory and make again everything ?

I used --without-x and --enable-c99complex options, the other ones are
the default ones.

regards
Fausto

------------------------------------------------------------------------------
Gergely Buday | 17 Jul 14:40 2014
Picon

saving the state of the compiler

Hi there,

I am new to lisp in general. By accident and because it works well
with the archaic theorem prover nqthm, I chose ECL.

I have an 1500 line long nqthm proof script that I need to evaluate on
every start. I look for a function that saves the state of the
compiler after this evaluation so that I can load the image upon
startup in seconds. I could not find such a function here:

http://ecls.sourceforge.net/new-manual/

I thought that ECL has this feature as Standard ML of New Jersey has it:

"Exporting Heaps"

http://www.cs.cmu.edu/afs/cs/local/sml/common/smlguide/smlnj.htm#export

How can I do this in ECL?

- Gergely

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds

Gmane