Re: Problem with a C predicate and write on the output

From: Andrew Cheadle <>
Date: Wed 01 Jun 2005 11:57:12 AM GMT
Message-ID: <>
Hi Ludovic

It's exceptionally hard to diagnose your problem from your description.
The chances are however, that your C predicate is at fault here and is
corrupting memory (most likely on the stack) resulting in a segmentation
violation. You're just lucky that write/1 works. Can I suggest you examine
your C predicate. If you're really stuck can you send over the smallest
possible compilable code fragment that manifests the problem and I'll try
and take a look...



On Wed, 1 Jun 2005, ludovic picouays wrote:

> I wrote a C predicate, I call it when a variable is modified. There is
> no problem with that.
> When I want to print something on the output before calling this
> predicate, I must use write/1, otherwise it doesn't work.
> write("hello"),
> cumulativeflow(Ri,Pi,Di,NbTache,NbMachine),
> this works.
> (cumulativeflow is my C predicate, I export it by loading a module
> before execution.)
> but if I use writeln/1 or write/1 and ln just after :
> writeln("hello"),
> cumulativeflow(Ri,Pi,Di,NbTache,NbMachine),
> I have this error message :
> Segmentation violation - possible reasons are:
> - a faulty external C function
> - certain operations on circular terms
> - machine stack overflow
> - an internal error in ECLiPSe
> ECLiPSe may have become unstable, restart recommended
> I don't know what is the problem, but I need to see several terms so
> all of them on the same line is not really appropriate.
> If you had some solution...
> Best Regards
Received on Wed Jun 01 12:53:45 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:36 PM GMT GMT