This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with gsl_multifit_fdfsolver_alloc().


Hello.

 The manual says that the function gsl_multifit_fdfsolver_alloc() should
return a null pointer if there's no memory available and invoke the error
handler. But apparently, the function does _not_ return a null pointer,
and only invokes the error handler.

I'm sending attached the example in the manual slightly modified to show
this problem. Right after it tries to allocate memory for the solver I put
the condition:

if (s == NULL)
  exit(1);

But if I put a large value for N (18000 is enough in my machine) the error
handler is called but the program doesn't exit and segfaults later. Using
GDB I saw that the value for 's' wasn't null after the function failed to
allocate memory.

Is there something I'm missing or is this a bug?

-- 

    Tiago

Attachment: test.c
Description: Binary data

Attachment: msg00131/pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]