public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* Siman!!!
@ 2000-07-04  6:01 Francisco Frutos
  2000-07-04 11:38 ` Siman!!! Brian Gough
  0 siblings, 1 reply; 4+ messages in thread
From: Francisco Frutos @ 2000-07-04  6:01 UTC (permalink / raw)
  To: gsl-discuss

Hi!

My code had an error. Now using 

gsl_siman_solve(r, x_init, Energy, Step, Metric, Print, M * N * 
sizeof(double), params);

I get good values!

I'm using gsl_multiroot in my program too und my program crashed most of
the time if I use both subroutines??? Do the gsl_siman_solve need one
"gsl_free" for the memory or something like that?  

Thanks in advance!

Greetings from Katlenburg-Lindau!

Tschuessele!

Francisco
Max Planck Institut fuer Aeronomie

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Siman!!!
  2000-07-04  6:01 Siman!!! Francisco Frutos
@ 2000-07-04 11:38 ` Brian Gough
  2000-07-17  7:52   ` Memory! Francisco Frutos
  0 siblings, 1 reply; 4+ messages in thread
From: Brian Gough @ 2000-07-04 11:38 UTC (permalink / raw)
  To: Francisco Frutos; +Cc: gsl-discuss

You need to be careful about memory allocation when using GSL.

I recommend compiling your program and the library with "checkergcc",
which automatically checks memory accesses for you. It is very useful.

Francisco Frutos writes:
 > 
 > Hi!
 > 
 > My code had an error. Now using 
 > 
 > gsl_siman_solve(r, x_init, Energy, Step, Metric, Print, M * N * 
 > sizeof(double), params);
 > 
 > I get good values!
 > 
 > I'm using gsl_multiroot in my program too und my program crashed most of
 > the time if I use both subroutines??? Do the gsl_siman_solve need one
 > "gsl_free" for the memory or something like that?  
 > 
 > Thanks in advance!
 > 
 > Greetings from Katlenburg-Lindau!
 > 
 > Tschuessele!
 > 
 > Francisco
 > Max Planck Institut fuer Aeronomie
 > 
 > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Memory!
  2000-07-04 11:38 ` Siman!!! Brian Gough
@ 2000-07-17  7:52   ` Francisco Frutos
  2000-07-17 14:51     ` Memory! Brian Gough
  0 siblings, 1 reply; 4+ messages in thread
From: Francisco Frutos @ 2000-07-17  7:52 UTC (permalink / raw)
  To: bjg; +Cc: gsl-discuss

Hi Brian!

I'm using the Sun cc and not gcc. Because of the XForms, I cannot compile
my program with gcc and if I try it, then I get a lot of error messages
and no executable. How kann I check memory accesses without checkergcc?

I'm using gsl_multiroot subroutines in the following form:

F.f = &function; 
F.n = 2;
F.params = 0; 

and then I got by compiling with cc such warnings:

./rootfinder.c", line 175: warning: assignment type mismatch:
        pointer to function(pointer to const struct gsl_vector_struct
{uint size, uint stride, pointer to double data, pointer to st... "="
pointer to function(pointer to struct gsl_vector_struct {uint size, uint
stride, pointer to double data, pointer to struct g...

I don't know if that could create memory problems!

Thanks in advance!

Greetings from katlenburg-Lindau!

Francisco 
Max Planck Institut fuer Aeronomie



 On Tue, 4 Jul 2000, Brian Gough wrote:

> You need to be careful about memory allocation when using GSL.
> 
> I recommend compiling your program and the library with "checkergcc",
> which automatically checks memory accesses for you. It is very useful.
> 
> Francisco Frutos writes:
>  > 
>  > Hi!
>  > 
>  > My code had an error. Now using 
>  > 
>  > gsl_siman_solve(r, x_init, Energy, Step, Metric, Print, M * N * 
>  > sizeof(double), params);
>  > 
>  > I get good values!
>  > 
>  > I'm using gsl_multiroot in my program too und my program crashed most of
>  > the time if I use both subroutines??? Do the gsl_siman_solve need one
>  > "gsl_free" for the memory or something like that?  
>  > 
>  > Thanks in advance!
>  > 
>  > Greetings from Katlenburg-Lindau!
>  > 
>  > Tschuessele!
>  > 
>  > Francisco
>  > Max Planck Institut fuer Aeronomie
>  > 
>  > 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Memory!
  2000-07-17  7:52   ` Memory! Francisco Frutos
@ 2000-07-17 14:51     ` Brian Gough
  0 siblings, 0 replies; 4+ messages in thread
From: Brian Gough @ 2000-07-17 14:51 UTC (permalink / raw)
  To: Francisco Frutos; +Cc: gsl-discuss

Francisco Frutos writes:
 > ./rootfinder.c", line 175: warning: assignment type mismatch:
 >         pointer to function(pointer to const struct gsl_vector_struct
 > 
 > I don't know if that could create memory problems!

It's very likely to be the sign of a problem that would cause a
segmentation fault.  The prototypes of the functions in the assignment
should match correctly.

I don't know of any other tool which checks both the stack AND the
heap apart from checkergcc. There are libraries like Electric Fence
which check the heap only, but that doesn't always help.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-07-17 14:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-04  6:01 Siman!!! Francisco Frutos
2000-07-04 11:38 ` Siman!!! Brian Gough
2000-07-17  7:52   ` Memory! Francisco Frutos
2000-07-17 14:51     ` Memory! Brian Gough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).