getElements().begin causes seg fault

View: New views
3 Messages — Rating Filter:   Alert me  

getElements().begin causes seg fault

by Angus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have this problem where as soon as I call begin() on the array returned by getElements() I register a segmentation fault. Here's my code:
int main(int argc, const char *argv[]) {
        int nReturn = EXIT_FAILURE;
        try {
                {
                        Cgicc cgi;
                        for(const_form_iterator iter = cgi.getElements().begin(); iter != cgi.getElements().end(); ++iter) {

and that's all there is to it. Valgrind registers a bunch of "conditional jump or move depends on uninitialized values"s and then finally an "invalid read". I've got what appears to be the latest cgicc (3.2.7). What am I doing wrong?

Re: getElements().begin causes seg fault

by Angus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I should further point out that the encoding type for the submitted form is "multipart/form-data". I'm sure that has something to do with it, but I'm still at a loss as to what to do about it.

Re: getElements().begin causes seg fault

by Igor-7 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Angus,

Monday, November 24, 2008, 8:36:02 PM, you wrote:

   cgicc library has built in debug facilities. Turn them on to see
   what happens. It cannot crash at begin. It might crash
   at Cgicc constructor though. At the time cgi object is constructed
   all the form data is processed. If it crashes at begin then it is most
   probably some linkage problem.
   
   You can all so save form data that crashes cgicc and then load it
   and find out the problem.

A> I have this problem where as soon as I call begin() on the array returned by
A> getElements() I register a segmentation fault. Here's my code:
A> int main(int argc, const char *argv[]) {
A>         int nReturn = EXIT_FAILURE;
A>         try {
A>                 {
A>                         Cgicc cgi;
A>                         for(const_form_iterator iter = cgi.getElements().begin(); iter !=
A> cgi.getElements().end(); ++iter) {

A> and that's all there is to it. Valgrind registers a bunch of "conditional
A> jump or move depends on uninitialized values"s and then finally an "invalid
A> read". I've got what appears to be the latest cgicc (3.2.7). What am I doing
A> wrong?



--
Best regards,
 Igor                            mailto:sprog@...



_______________________________________________
help-cgicc mailing list
help-cgicc@...
http://lists.gnu.org/mailman/listinfo/help-cgicc