
Well, you are absolutely right. The weird thing is that I tried to catch exceptions within my execute method, but for some reason it wasn't catching anything; however, now that I tried the stripped down code that I replied with to John Maddock, and added a catch, I get the error that you also found. Now that my problem has finally been isolated, do you know what this exception means? I didn't think that the regex was that complicated, and it works fine for other regex's that are very similar. What specifically is search depth? Also, following up on your introduction to your answer, can you expand on the problems you had compiling, and any general problems you found with my code? I am only 18, and I've just started getting into C++, so I am trying to learn as much as possible from people who know what they are talking about. It is obvious that I have made many mistakes, as you point out, so any expansion on these would be extremely helpful. I am running GCC 2.96 with -Wall, and I didn't have any warnings or errors compiling, so how did you have so many problems with GCC 3.2? It doesn't seem too backwards- compatabile if I am not having problems and you are. A few questions on only the comments that you included: 2: Where did you have to include <iostream>? 3: Again, where did you have to add using directives? 4: Do default values only have to be in the declaration? 5: Can you expand further on these unmentioned warnings? Thank you VERY much for all your help, I learn something new everyday. Kevin --- In Boost-Users@y..., Stephen Jackson <stephen.jackson@s...> wrote:
eydelber wrote:
Code is here:
http://www.myplaceonline.com/code/code.htm
Just compile everything together and run ./try.cgi, and from
there
enter an sql string similar to (you'll also have to create a table first like this: "create table test (one int)"):
insert into test (lkfsdjlkafdjklfsdajflkjfdklsjfsdlkjsfldkjfskldaj) values (1);
With some difficulty, I have reproduced your problem with GCC 3.2 on Red Hat 8.0.
The difficulties were mainly non-conforming code: 1. Get James Clark's expat parser. 2. Include <iostream> where necessary. 3. Add further using directives where necessary. 4. Remove the non-conforming duplication of default parameter values in the headers and the implementation files. 5. There are further warnings which matter but are irrelevant to this exercise.
In the general case, if a C++ program compiled with GCC prints "Aborted" and exits, this is caused by an unhandled exception.
In this case, you promise that textdb::TextDB::execute will only throw TextDBException. However, RegEx::Match is thowing a different exception. You are not handling this exception in textdb::TextDB::execute, and you have promised not to leak it; the result is that GCC causes your program to abort.
By removing the throw specification from your function and adding extra catches in main(), I can tell you that RegEx::Match is throwing an exception whose what() reports "Max regex search depth exceeded."
I hope this helps.
Regards,
Stephen Jackson -- stephen.jackson@s... http://www.scribitur.com/spj/