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

Invalid null key and segmentation fault (Origin: bugzilla #719463) #5363

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity major in component general for ---
Reported in version 1.8.5-GIT on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2013-11-28 05:04:49 +0000, Orion Poplawski wrote:

I'm trying to build the plplot doxygen documentation on Fedora 20 with doxygen 1.8.5. I get the following:

Building group list...
Building directory list...
Building namespace list...
QGDict::hashAsciiKey: Invalid null key
QGDict::hashAsciiKey: Invalid null key
Building file list...
Building class list...
Associating documentation with classes...
Computing nesting relations for classes...
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/bindings/java/PLCallbackCT.java:5: warning: Internal inconsistency: scope for class plplot::core::PLCallbackCT not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/bindings/java/PLCallbackLabel.java:5: warning: Internal inconsistency: scope for class plplot::core::PLCallbackLabel not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/bindings/java/PLCallbackMapform.java:5: warning: Internal inconsistency: scope for class plplot::core::PLCallbackMapform not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/bindings/java/PLStream.java:32: warning: Internal inconsistency: scope for class plplot::core::PLStream not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/fedora/bindings/java/config.java:23: warning: Internal inconsistency: scope for class plplot::core::config not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/fedora/bindings/java/PLGraphicsIn.java:11: warning: Internal inconsistency: scope for class plplot::core::PLGraphicsIn not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/fedora/bindings/java/plplotjavac.java:11: warning: Internal inconsistency: scope for class plplot::core::plplotjavac not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/fedora/bindings/java/plplotjavacConstants.java:11: warning: Internal inconsistency: scope for class plplot::core::plplotjavacConstants not found!
/export/home/orion/fedora/plplot/plplot-5.9.9-svn12479/fedora/bindings/java/plplotjavacJNI.java:11: warning: Internal inconsistency: scope for class plplot::core::plplotjavacJNI not found!
Building example list...
Searching for enumerations...
Searching for documented typedefs...
Searching for members imported via using declarations...
Searching for included using directives...
Searching for documented variables...
error: NamespaceDef::insertMembers(): member _swig_property' with class scope ' inserted in namespace scope `plplotc'!
Building interface member list...
Building member list...
Searching for friends...
Searching for documented defines...
Computing class inheritance relations...
Computing class usage relations...

Program received signal SIGSEGV, Segmentation fault.
extractClassNameFromType (type=..., pos=@0x7fffffffd12c: 0, name=..., templSpec=..., lang=SrcLangExt_Fortran) at util.cpp:5865
5865 if (type.at(pos)==',') return -1;
(gdb) print pos
$1 = (int &) @0x7fffffffd12c: 0
(gdb) print type
$2 = (const QCString &) @0x7fffffffd130: {m_data = 0x0}
(gdb) bt

0 extractClassNameFromType (type=..., pos=@0x7fffffffd12c: 0, name=..., templSpec=..., lang=SrcLangExt_Fortran) at util.cpp:5865

1 0x0000000000424815 in findUsedClassesForClass (rootNav=rootNav@entry=0x169d190, context=context@entry=0x1f03550, masterCd=masterCd@entry=0x1f03550,

instanceCd=instanceCd@entry=0x1f03550, isArtificial=isArtificial@entry=true, actualArgs=actualArgs@entry=0x0, templateNames=templateNames@entry=0x0)
at doxygen.cpp:4151

2 0x00000000004421f5 in findUsedTemplateInstances () at doxygen.cpp:4957

3 parseInput () at doxygen.cpp:10910

4 0x000000000040b3a9 in main (argc=1, argv=0x7fffffffd7a8) at main.cpp:37

(gdb) print name
$1 = (QCString &) @0x7fffffffd150: {m_data = 0x0}
(gdb) print templSpec
$2 = (QCString &) @0x7fffffffd160: {m_data = 0x0}

There are a number of "Invalid null key" messages which may be related. They seem to come from:

Building group list...
Building directory list...
Building namespace list...

(gdb) bt

0 qWarning (msg=msg@entry=0xb0e3c8 "QGDict::hashAsciiKey: Invalid null key") at qglobal.cpp:410

1 0x00000000007622bb in QGDict::hashKeyAscii (this=this@entry=0x251be30, key=key@entry=0x0) at qgdict.cpp:128

2 0x00000000007631b9 in QGDict::look_ascii (this=0x251be30, key=0x0, d=d@entry=0x0, op=op@entry=0) at qgdict.cpp:399

3 0x000000000044ef28 in find (k=, this=) at ../qtools/qasciidict.h:66

4 find (this=, key=...) at sortdict.h:238

5 FileDef::addUsingDirective (this=this@entry=0x1125c70, nd=nd@entry=0x23e72d0) at filedef.cpp:1110

6 0x0000000000412c2c in findUsingDirectives (rootNav=0x14c2200) at doxygen.cpp:1946

7 0x0000000000412775 in findUsingDirectives (rootNav=0x14c2010) at doxygen.cpp:1960

8 0x0000000000412775 in findUsingDirectives (rootNav=0x165bba0) at doxygen.cpp:1960

9 0x0000000000412775 in findUsingDirectives (rootNav=rootNav@entry=0x10cad10) at doxygen.cpp:1960

10 0x0000000000441c0c in parseInput () at doxygen.cpp:10826

11 0x000000000040b3a9 in main (argc=1, argv=0x7fffffffd7a8) at main.cpp:37

5 FileDef::addUsingDirective (this=this@entry=0x1125c70, nd=nd@entry=0x23e72d0) at filedef.cpp:1110

1110 if (m_usingDirList->find(nd->qualifiedName())==0)
(gdb) print nd
$3 = (NamespaceDef *) 0x23e72d0
(gdb) print *nd
$4 = { = { = {_vptr.DefinitionIntf = 0x91a850 <vtable for NamespaceDef+16>}, m_impl = 0x23e73e0, m_name = {
m_data = 0x23a9570 "java::io::"}, m_isSymbol = true, m_symbolName = {m_data = 0x0}, m_defLine = 1, m_defColumn = 1}, visited = false, fileName = {
m_data = 0x23c3ca0 "namespacejava::io::"}, files = {<QList> = { = { = {_vptr.QCollection = 0x792c30 <vtable for QStrList+16>,
del_item = true}, firstNode = 0x0, lastNode = 0x0, curNode = 0x0, curIndex = -1, numNodes = 0, iterators = 0x0}, }, dc = true},
usingDirList = 0x0, usingDeclList = 0x0, m_innerCompounds = 0x23e7610, m_allMembersDict = 0x0, m_memberLists = { = { = {
_vptr.QCollection = 0x7950d0 <vtable for QList+16>, del_item = false}, firstNode = 0x0, lastNode = 0x0, curNode = 0x0, curIndex = -1,
numNodes = 0, iterators = 0x0}, }, memberGroupSDict = 0x23e76d0, classSDict = 0x23e7490, namespaceSDict = 0x23e7550, m_subGrouping = true,
m_type = NamespaceDef::NAMESPACE, m_isPublished = false}
(gdb) print nd->qualifiedName()
$5 = {m_data = 0x0}

On 2013-12-01 19:11:57 +0000, albert wrote:

Created attachment 263245
Small example describing the problem

I've downloaded plplot version 5.9.9 adjusted the Doxyfile.in to represent my directory structure and only used as INPUT the bindings directory with its subdirectories.

With the current git version in debug mode under Cygwin I get as stack trace:
(gdb) where

0 0x004af9c5 in extractClassNameFromType (type=..., pos=@0x28a9b0: 0, name=..., templSpec=...,

lang=SrcLangExt_Fortran) at util.cpp:5916

1 0x0041185a in findUsedClassesForClass (rootNav=0x802157c0, context=0x8027af50, masterCd=0x8027af50,

instanceCd=0x8027af50, isArtificial=true, actualArgs=0x0, templateNames=0x0) at doxygen.cpp:4158

2 0x00413bd9 in findUsedTemplateInstances () at doxygen.cpp:4964

3 0x0042abc3 in parseInput () at doxygen.cpp:10963

4 0x004011b4 in main (argc=4, argv=0x28ac20) at main.cpp:37

where the crash is at:
5916 if (type.at(pos)==',') return -1;
this is due to the fact that type is the null pointer.
looking in findUsedTemplateInstances reveals that type is set to the null pointer by normalizeNonTemplateArgumentsInString (and is not reset by typdef test or substitute test).

Enabling -d classes gives:
Usage: Class plplot :
Found variable C in class plplot

This "class" is actually a FORTRAN module plplot found in the file bindings/f95/sfstubsf95.f90 but it is also a module in d/plplot.d and this confuses doxygen.

Based on these observations it was possible to create the attached smaller example.

On 2013-12-01 19:16:37 +0000, Kevin McBride wrote:

Confirming and marking bug as described in comment 1.

On 2013-12-08 14:50:52 +0000, Dimitri van Heesch wrote:

I'll move the fortran specific section inside the "if (typeLen>0)" guard so the crash can be prevented.

On 2013-12-24 18:59:46 +0000, Dimitri van Heesch wrote:

This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.6. 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 (preferrably in the form of a self-contained example).

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment