GNOME Bugzilla – Bug 743367
Duplicate attribute (target="_top" target="_top") generated in .SVG files
Last modified: 2018-02-03 13:18:05 UTC
Created attachment 295212 [details] Screen cap of bug in Firefox, tersed config, subdirectory with SVG files. OVERVIEW Doxygen generates SVG files, which I think are used to display call and caller graphs, will contain two or more target="_top" attributes in the XML. STEPS TO REPRODUCE This is occurring in a huge Visual C++ project with hundreds of thousands of lines of code and comments. I have not seen this in smaller projects. I cannot provide a compile-ready repro for disclosure reasons. I have attempted to isolate a module with no dependencies that generates the error by having Doxygen only build using that module and its header, but that also fails to generate the error. To test proposed fixes, contact me through my bugzilla email address. ACTUAL RESULTS Some files ending with _icgraph.svg and _cgraph.svg will contain two or target="_top" attributes in the same XML statement. EXPECTED RESULT No duplicate attributes. PLATFORM Windows 7 SP1 Tested on Doxygen 1.8.9.1. and 1.8.8 Tested on Firefox 34.0.5, IE 10.0.9200 and Chrome 40.0.2214.91 m NOTE: The bug appears different in IE - a blank graph is shown with the error message. ADDITIONAL INFORMATION Attached is a zip with a Doxygen generated directory of which 49 or 51 files ending with _icgraph.svg or _cgraph.svg are bad, a config tersed -s -u, and a Firefox screen cap of the failing page (since with the provided subdirectory, you cannot properly view the error). I believe I have seen this bug before, that it had been fixed, and I suspect I am reporting a regression. I tried searching Bugzilla, but could not find the bug report.
For quick reference the bug in SVG file XML looks like this: <use xlink:href="#rim" target="_top" target="_top" target="_top" target="_top" target="_top" target="_top" target="_top" target="_top" target="_top" fill="#404040"> and this: <a xlink:href="../../d0/dfc/class_c_imaging_state.html#a1e370b00d63383812f53751ec00c5492" target="_top" target="_top" xlink:title="CImagingState::GetImageCollection\lDirectory">
Thanks for the report, and the image does show the problem you have, it is a bit hard to reproduce the problem without source (and the html 'd80' is a bit incomplete). Can you please attach a (small) self-contained example (source+config file in a tar or zip) that allows us to reproduce the problem?
I've tried to reproduce the problem with a codebase that I have but have not been able to reproduce the problem. So my question about the example / additional information remains. At first I missed the remark in the STEPS TO REPRODUCE, which I can fully understand. Sorry for that.
Yes, it is a proprietary big system. The key here word is BIG. And it doesn't happen in mere 100,000 line code projects. Have you tried using my config against something like PAINTLIB? I don't know what your code looks like, but if you want to put some debugging / tracing code in a module and have me run that version of Doxy against my code, I would be more than happy to do so. Other than that, I can only point out that it only manifests itself in whatever generates the target="_top code" in the _icgraph.svg and _cgraph.svg files, but not other .SVG file. Again, just ask and I can help on my side. I am in Los Angeles PST.
OVERVIEW I can now reproduce the multiple attribute symptom at will *and* prevent it from happening. STEPS TO REPRODUCE Delete the generated HTML folder output from the previous Doxygen compilation and run Doxygen. The symptom disappears. Doxygen a second time with existing HTML output. The symptom occurs. I did some regression testing to see if I could help discover when the problem started. (Very smart thinking to keep all the old distributable available for download!) Doxygen fails starting with release 1.7.5.1. Release 1.7.4.1 does not generate the symptom. ADDITIONAL INFORMATION The symptom appears related to Doxygen's reuse of previously compiled HTML output. The number of extra target="_top" attributes added to the .SVG files seems proportional to the number of recompiles done using the old output. Unfortunately, generating the symptom still appears to be related to the actual size of the project. I cannot make the symptom appear in my smaller projects. As a quick workaround, may I suggest a config option to always delete the HTML output before running the compile? FYI: My project causes Doxygen to generate 36,000 files and folders for 550MB.
This looks like some important information, the multiple runs of doxygen. I think The fact that it does appear after 1.7.4 is due to the fact that the INTERACTIVE_SVG possibility has been added at that time, as a reference see the release notes of v1.7.5: New option INTERACTIVE_SVG which when set to YES in combination with DOT_IMAGE_FORMAT=svg will make doxygen generate interactive SVG diagrams that support zooming and panning via the mouse (only for large graphs). The adding of the target="_top" is done in the DotFilePatcher::run of dot.cpp where replaceRef is called. The DotFilePatcher::run is called (as far as I can see) from the DotManager::run and giving a message like "Patching output file". The patcher is also called from writeDotImageMapFromFile, but without message. I've now seen the same problem in my codebase, though I have to make one remark that in my case some of the images were not generated in the first "round" and where generated in the second and third "round". Further investigations are required, but is it possible that a class is defined in more than one place (cpp file). In my case it looks like I have this as multiple programs are defined in the code base and I run doxygen in one go over the entire code base.
Hi, I know this is an "old" bug report but I am running the latest doxygen 1.8.13 and I get this double attribute error when having .dot graphs generated for my documentation. What I noticed is that this happens only when I support external Qt documentation via TAGFILES, i.e. TAGFILES = qtcore.tags=http://doc.qt.io/qt-5.9/. Once I clear the TAGFILES setting, the dot graphs are shown correctly and the problem disappears. Is there a fix for this bug available or can I workaround this somehow? Thanks
Btw. this is on Windows 10 64-Bit
@SamK It looks like it happens only under some rare circumstances. Can you add a small example showing the problem, so we can try to reproduce the problem?
Hi Albert, by example do you mean my .cfg file I am using? Or what do you need exactly? The issue I get is happening with a big proprietary project so there is no way for me to extract anything from it (but I could give out the .cfg file of course)
@SamK I mean a small project. I.e. configuration file (Doxyfile), source files (minimal / stripped down), tag files, other files to reproduce the problem. To summarize the files so that we only have to start doxygen to reproduce the bug (and can search for the problem). I do understand the problem with the propriety code. What I always do in such a case is to reduce the number of files (till I have a minimal set, preferably only 1 or 2 source files). In the remaining files I start to strip away as much as possible of the remaining code and comments again till a small minimal example and afterwards I do, when necessary, some name mangling. This all is a bit tedious of course and can take quite a bit of time but most of the time necessary .
Sure, I have just made such a minimal project where it can be easily reproduced. Where can I send it?
Best is to attach it to this bug report otherwise (and just in this case when this is not possible) send it to me.
Created attachment 360583 [details] Duplicate attributes Using TAGFILES to support Qt documentation and having the class DoxyGenClassA being inherited from Qt's QObject is making the svg dot graphs not showable in Firefox with the duplicate attribute (target="") error. Fixed by either removing TAGFILES or not inheriting from QObject. doxygen.exe etc. not included but folder still there. Also link to graphviz needs to be adapted in the config file of course.
Thank Albert, I have just attached it.
Oh one more, it contains a solution for VS2013
When running the example I get the message (dots are mine): XML Parsing Error: duplicate attribute Location: file:///..../doxygenBug/html/class_doxy_gen_class_a__inherit__graph.svg Line Number 32, Column 181:<g id="a_node2"><a target="_blank" doxygen="..../doxygenBug/qt/qtcore.tags:http://doc.qt.io/qt-5.9/" xlink:href="http://doc.qt.io/qt-5.9/qobject.html" target="_top" xlink:title="QObject"> Removing one of the targets does solve the problem (not really feasible for the user), have to check the code.
Yep, that's exactly the error I get. It can be solved by manually removing one of the target tag's from the svg but as you say, that's not feasible for the end-user. It should work straight out of the box. Thanks!
Problem can be overcome, as a workaround, by setting the configuration option EXT_LINKS_IN_WINDOW to NO so the external references will come in the current tab instead of a new tab. I just pushed a proposed patch to github (pull request 606) (took a bit of time today as first the regression, pull request 605, had to be solved to properly see the results.
Changes have been integrated into the master branch on github.
This bug was previously marked ASSIGNED, which means it should be fixed in doxygen version 1.8.14. Please verify if this is indeed the case. Reopen the bug if you think it is not fixed and please include any additional information that you think can be relevant (preferably in the form of a self-contained example).
This breaks links from tagfiles, see Bug 792415.