yangqiaosheng / libcitygml

Automatically exported from code.google.com/p/libcitygml
GNU Lesser General Public License v2.1
0 stars 0 forks source link

std::bad_alloc #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download and compile svn revision 97
2. Use the lib to open and parrse the PatrickTest.gml file

What is the expected output? What do you see instead?
I expect the gml file to be parsed, but I reveive the following output:

---
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
The program has unexpectedly finished.

---

What version of the product are you using? On what operating system?
- svn revision 97
- ubuntu 10.04 (32 bit)

Please provide any additional information below.
I only get this error when using the file PatrickTest.gml (I have added this 
file to the bugreport). Other (smaller/less complex) files have been parsed 
without an issue before and with the same program.

Of course, if I can be of any assistance then please contact me.

Original issue reported on code.google.com by hanckmann@gmail.com on 22 Sep 2010 at 3:33

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Patrick!
Your citygml file has an error inside Building#24 element.

l.284: <gml:posList>-37.5685768127441 -84.622688293457 15.1499996185303 
-37.5408935546875 F-94.8226547241211 (...)
the letter F should not be there.
Thus, there is an infinite loop (while stringstream is valid) created in the 
method parseVecList(strinstream, vector,GeoTransform) because stringstream is 
still valid but no double can be extracted...
Then vector is filled and bad::alloc occures!

A type-check could correct this but this may slow the parsing.

For the moment, you may just correct your citygml file :)

Thanks for the report!

Have a nice weekend.

Manuel

Original comment by garnier....@gmail.com on 25 Sep 2010 at 1:42

GoogleCodeExporter commented 9 years ago
Hello again!
I changed the way vectors of data were parsed. The condition prevents the 
parser from doing an infinite loop. There is also an error message shown and 
all extracted data during this method call is discarded.

Regards,
Manuel

Original comment by garnier....@gmail.com on 25 Sep 2010 at 2:48

GoogleCodeExporter commented 9 years ago
fixed in r98

Original comment by garnier....@gmail.com on 1 Oct 2010 at 9:13