Closed deepayan closed 10 years ago
A little more detail: The error obviously happens in
void SmokeMethod::invoke(SmokeObject *obj, Smoke::Stack stack) {
if (!obj && !isStatic() && !isConstructor()) {
qCritical("'obj' is NULL but %s is not a class method\n", name());
setLastError(InvocationFailed);
return;
}
and the calls leading upto that is QMetaObject *MocClass::findMetaObject()
which calls
binding.invoke(NULL, items);
which calls DynamicBinding::invoke
.
Something might be getting corrupted in the metadata. That method definition lacks not only the static flag, but also the name is empty, as you can see from the error message. You could check in the generated smokedata.cpp to ensure that the info is correct. For example, I have:
{155, 18851, 0, 0, Smoke::mf_const|Smoke::mf_static|Smoke::mf_attribute, 2374, 34}, //5269 QDoubleSpinBox::staticMetaObject() const
But that will vary in some aspects, depending on the configuration.
On Sun, Feb 2, 2014 at 11:29 PM, deepayan notifications@github.com wrote:
A little more detail: The error obviously happens in
void SmokeMethod::invoke(SmokeObject *obj, Smoke::Stack stack) { if (!obj && !isStatic() && !isConstructor()) { qCritical("'obj' is NULL but %s is not a class method\n", name()); setLastError(InvocationFailed); return; }
and the calls leading upto that is QMetaObject *MocClass::findMetaObject()which calls
binding.invoke(NULL, items);
which calls DynamicBinding::invoke.
Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17#issuecomment-33929326 .
That particular line for me is
{185, 20594, 0, 0, Smoke::mf_const|Smoke::mf_static|Smoke::mf_attribute, 2718, 34}, //6030 QDoubleSpinBox::staticMetaObject() const
but I don't know if that's different enough. By the way, QDoubleSpinBox is not special, everything I have tried fails in the same way.
I have uploaded my smokedata.cpp at
http://www.isid.ac.in/~deepayan/tmp/smokedata.cpp
and the full qtbase directory at
That looks fine. Others have now reported this issue. It's probably because you guys have more modules installed than I do.
Debugging SmokeClass::findIndex might help. You could at least check that it is returning the correct method index. SmokeMethod::findMethod() will default to an empty definition if the index is out of range. Actually, it looks like Smoke::Index is typedef'd to a short, so if you have more than 32768 methods, there could be overflow. Which would be hilarious somehow.
On Mon, Feb 3, 2014 at 9:28 AM, deepayan notifications@github.com wrote:
That particular line for me is
{185, 20594, 0, 0, Smoke::mf_const|Smoke::mf_static|Smoke::mf_attribute, 2718, 34}, //6030 QDoubleSpinBox::staticMetaObject() const
but I don't know if that's different enough. By the way, QDoubleSpinBox is not special, everything I have tried fails in the same way.
I have uploaded my smokedata.cpp at
http://www.isid.ac.in/~deepayan/tmp/smokedata.cpp
and the full qtbase directory at
http://www.isid.ac.in/~deepayan/tmp/qtbase.tar.gz [35M]
Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17#issuecomment-33978129 .
On Tue, Feb 4, 2014 at 10:28 AM, Deepayan Sarkar deepayan.sarkar@gmail.comwrote:
On Tue, Feb 4, 2014 at 3:18 AM, lawremi notifications@github.com wrote:
That looks fine. Others have now reported this issue. It's probably because
you guys have more modules installed than I do.
Debugging SmokeClass::findIndex might help. You could at least check that it is returning the correct method index. SmokeMethod::findMethod() will default to an empty definition if the index is out of range. Actually, it looks like Smoke::Index is typedef'd to a short, so if you have more than 32768 methods, there could be overflow. Which would be hilarious somehow.
I tried the other obvious thing, which is to change smoke.h
- typedef short Index;
- typedef int Index;
and now everything seems to work. Is that a safe change?
-Deepayan
It seems my first response got lost somehow, so for the record:
SmokeClass::findIndex() seems to find the right index in the examples I tried. However, looking at the smokedata.cpp file, the index definitely exceeds 32768 (although marginally). This happens at the end, with a few static methods, and the rest all enums.
//32768 Qt::mightBeRichText(const QString&)
//32769 Qt::convertFromPlainText(const QString&, Qt::WhiteSpaceMode)
//32770 Qt::convertFromPlainText(const QString&)
//32771 Qt::codecForHtml(const QByteArray&)
//32772 Qt::CaseInsensitive (enum)
//32773 Qt::CaseSensitive (enum)
...
//33862 Qt::Uninitialized (enum)
And as I wrote earlier, redefining Index to int fixes things.
I ran into the same problem (couldn't find smoke symbols). Changing the type of "Index" to a type wider than "short" also helped. Thanks.
However, the width of C data types is implementation-specific, such that on some platforms/compilers both "short" and "int" can be too short to store 32768 (C laguage only defines that both "short" and "int" are at least 16 bits in size). Therefore, I would go for "long", which, by definition, must be at least 32 bits in size.
Or just rely on Qt and use qint32. Sometimes long is too long ;)
On Tue, Feb 4, 2014 at 2:50 AM, Tomas Sieger notifications@github.comwrote:
I ran into the same problem (couldn't find smoke symbols). Changing the type of "Index" to a type wider than "short" also helped. Thanks.
However, the width of C data types is implementation-specific, such that on some platforms/compilers both "short" and "int" can be too short to store 32768 (C laguage only defines that both "short" and "int" are at least 16 bits in size). Therefore, I would go for "long", which, by definition, must be at least 32 bits in size.
Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17#issuecomment-34048519 .
Deepayan, please go ahead and push the fix, and mention this issue in the commit to close it. Thanks!
Just substituting qint32
doesn't work, not even if I #include <QtGlobal>
. Go for long
then?
You mean the symbol is not found? That's strange. I guess long then, if we can't figure it out.
On Wed, Feb 5, 2014 at 11:59 AM, deepayan notifications@github.com wrote:
Just substituting qint32 doesn't work, not even if I #include
. Go for long then? Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17#issuecomment-34231075 .
The problem is not that the symbol is not found.
It seems that #include <QtCore/QtCore>
from kdebindings/smoke/smoke.h
results in "adding" (how?) the "Rf_" prefix to some method names, which results in:
In file included from /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/QtCore:116:0,
from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/../inst/local/include/smoke.h:8,
from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/SmokeObject.hpp:5,
from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/convert.hpp:11,
from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/init.cpp:1:
/opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h: In member function 'bool QBitArray::Rf_isNull() const':
/opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h:76:46: error: 'const class QByteArray' has no member named 'Rf_isNull'
Note that /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h
is original, containing no "Rf_" prefixes, i.e. no QBitArray::Rf_isNull()
method, but QBitArray::isNull()
.
Maybe, smoke is causing this, and we shall rather #include "qt/qt_includes.h"
instead?
In that case, however, we would need to add some more Qt include directories, because #include "qt/qt_includes.h"
results in:
In file included from /tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/../../smoke/smoke.h:9:0,
from /tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/smokebase.cpp:3:
/tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/../../smoke/qt/qt_includes.h:3:31: fatal error: QtWidgets/QtWidgets: No such file or directory
(Just few observations from my side - have no time to go any deeper, sorry.)
This is just a consequence of breaking the fragile #include order by having smoke.h include Qt headers, which it otherwise does not. All Qt headers must be included before the R headers, otherwise the R #defines break things. In situations where this order is not feasible, I just add #undef isNull after including the R headers.
Perhaps there is a bigger issue though. While qtbase obviously depends on Qt, smoke does not; it's generic C++. Thus, there is some tiny desire to keep it that way. So maybe "long" is the best idea. Do you agree Deepayan? Please just push that.
On Wed, Feb 5, 2014 at 11:37 PM, Tomas Sieger notifications@github.comwrote:
The problem is not that the symbol is not found.
It seems that #include <QtCore/QtCore> from kdebindings/smoke/smoke.hresults in "adding" (how?) the "Rf_" prefix to some method names, which results in:
In file included from /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/QtCore:116:0, from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/../inst/local/include/smoke.h:8, from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/SmokeObject.hpp:5, from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/convert.hpp:11, from /tmp/RtmpNdovNs/Rbuild164d2113aae4/qtbase/src/init.cpp:1: /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h: In member function 'bool QBitArray::Rf_isNull() const': /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h:76:46: error: 'const class QByteArray' has no member named 'Rf_isNull'
Note that /opt/Qt5.2.0-final/5.2.0/gcc/include/QtCore/qbitarray.h is original, containing no "Rf_" prefixes, i.e. no QBitArray::Rf_isNull()method, but QBitArray::isNull().
Maybe, smoke is causing this, and we shall rather #include "qt/qt_includes.h" instead? In that case, however, we would need to add some more Qt include directories, because #include "qt/qt_includes.h" results in:
In file included from /tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/../../smoke/smoke.h:9:0, from /tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/smokebase.cpp:3: /tmp/RtmpxSFEU8/Rbuild1f8a32a300cc/qtbase/kdebindings/generator/smokebase/../../smoke/qt/qt_includes.h:3:31: fatal error: QtWidgets/QtWidgets: No such file or directory
(Just few observations from my side - have no time to go any deeper, sorry.)
Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17#issuecomment-34299100 .
Yes, better to keep our changes to a minimum when we are changing other people's code. Presumably we'll move to a new upstream smoke at some point.
For the record, we do have the most up-to-date smoke, or at least the last time I checked a few months ago.
On Thu, Feb 6, 2014 at 4:55 AM, deepayan notifications@github.com wrote:
Closed #17 https://github.com/ggobi/qtbase/issues/17.
Reply to this email directly or view it on GitHubhttps://github.com/ggobi/qtbase/issues/17 .
This doesn't seem related to the other problems, so I'm starting a new issue.
I installed Qt 5.2.0 in /opt/Qt5.2. After setting
export PATH=/opt/Qt5.2/5.2.0/gcc_64/bin:$PATH export LD_LIBRARY_PATH=/opt/Qt5.2/5.2.0/gcc_64/lib:$LD_LIBRARY_PATH
qtbase installs and loads, but I can't create any objects.
I traced the error through to
but don't understand what's happening after that.