-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stackoverflow if WSDL file includes recursively #83
Comments
Gererated stub code: wsdl_media.h
wsdl_media.cpp
wsdl_media.cpp
|
Step 1: TT_Transport has a QSharedDataPointer of type PrivateDPtr, new PrivateDPtr is made in ctor. I wonder how many more years until KDAB is going to respond. |
Nope, I'm always happy to review patches, so it's not abandonware :-) |
You mean I'm the one who's going to fix it. ;-) |
That's how opensource works ;) I'm taking a look at how to add media.wsdl to the onvif.org unittest but this raises another issue, being able to parse two WSDL files at the same time to avoid duplication of xsd-generated classes. I'm actually surprised that mTunnel isn't an optional member, there were commits to better support that... |
For me wsdl_media.cpp says the following:
Are you sure you retested with a recent version of KDSoap? |
No, I'll upgrade to 1.6 next week and I'll retest it then. |
DRFrederik, I am the release manager for KDSoap. When I release a new version (1.6.0 was released in early May) I send an announcement email to the kdsoap-interest mailing list. I suggest you join that list. It is very, very low volume |
My colleague had just retested with 1.6 and he has the same generated code as I've posted before. |
Did he completely clean out the build directory so that the wsdl-generated files get regenerated with the new KDSoap? |
He did setup a new test project using the latest code. Can you tell us which version of kdwsl2cpp you've used to generate your code? We could check if it's equal to yours. |
kdwsdl2cpp isn't versioned separately, what matters is the KDSoap release that it's from. Using the binary from a 1.6.0 build, I do |
We've tested the command on Jessie (using Qt 5.3.2) and we have seen both versions (yours and mine) coming out of kdwsdl2cpp ... |
You made me wonder if there was some uninitialized variable in there, but no, valgrind says kdwsdl2cpp is clean. My only hypothesis is that you're sometimes picking up the wrong version of kdwsdl2cpp. |
My colleague got it working when he doesn't use a namespace. |
Hi, I am said colleague. I just created a pull request with my fix for the issue. Kind Regards |
Could you please take a look at my fix ? |
Sorry I was on vacations the last 2.5 weeks. I'm back now. The fix looks OK and doesn't break any existing unittests, but it's missing a unittest for the actual fix. I'm setting that up now. |
What do you find strange in the references to isElementPolymorphic? We want to use a pointer if 1) inheritance is used or 2) the element is optional and used "inside itself". isElementPolymorphic is about case 1, your fix is about case 2. |
I might have drawn to that conclusion too fast. But the debug print should probably say "Making element optional", which threw me off a bit. |
It's already optional (it would use a "bool isnil" otherwise), but I see your point, I'll adjust the debug to "Using pointer for optional element used inside itself" instead. If you don't mind I'll create a single commit with your fix and my unittest. |
No problem, though i'd loose my first contribution to an open source project. Just a question, why at all use 2 different ways of implementing optional arguments ? Why not just default to a pointer ? |
That commit fixed namespace handling in typename comparison for optional element used inside itself. When using the kdwsdl2cpp option "-namespace", the check that prevents a value used inside itself (infinite recursion) was failing, it must use the qualified name instead of the unqualified name. Investigation and fix by github user RMesotten, unittest by me. Fixes github issue #83
OK I merged your commit and put my changes on top, so your contribution isn't lost ;-) The reason for not using a pointer everywhere is historical. At the time I realized the missing support for optional types, existing applications were using values already, and changing it all to pointers would have broken them (since this is about the generated API, not just the internal implementation). |
That commit fixed namespace handling in typename comparison for optional element used inside itself. When using the kdwsdl2cpp option "-namespace", the check that prevents a value used inside itself (infinite recursion) was failing, it must use the qualified name instead of the unqualified name. Investigation and fix by github user RMesotten, unittest by me. Fixes github issue KDAB#83
This allows to remove onvif_org_media which has restrictive licensing for the WSDL file.
Example:
when using onvif media:
http://www.onvif.org/onvif/ver10/media/wsdl/media.wsdl
Function GetStreamUri requires StreamSetup which requires Transport which requires Tunnel ... and Tunnel requires Tunnel ...
This causes the recursive creation of Tunnel objects on the stack when making a Tunnel instance resulting in runtime errors.
Using a pointer to Tunnel instead of an object instance would solve this issue.
The text was updated successfully, but these errors were encountered: