Skip to content
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

Exporting Map as Godot 4 Scene segfaults #4108

Open
ghtyrant opened this issue Nov 29, 2024 · 2 comments
Open

Exporting Map as Godot 4 Scene segfaults #4108

ghtyrant opened this issue Nov 29, 2024 · 2 comments
Labels
bug Broken behavior. qt issue Qt related issue.

Comments

@ghtyrant
Copy link

Describe the bug
I try to export a simple map (one tileset, one layer, no objects) to TSCN via the Godot 4 Scene plugin. On doing so, Tiled crashes with a segfault. Using gdb I can get the following backtrace:

#0  0x00007ffff5909924 in QDirListingPrivate::advance (this=this@entry=0x0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/io/qdirlisting.cpp:329
#1  0x00007ffff590a275 in QDirListing::next (dirEntry=...)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/io/qdirlisting.cpp:805
#2  0x00007ffff590a320 in QDirListing::const_iterator::operator++
    (this=0x555557a42668, this=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/io/qdirlisting.h:122
#3  QDirIteratorPrivate::advance (this=0x555557a42660)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/io/qdiriterator.cpp:107
#4  QDirIterator::next (this=0x7fffffffbab0)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/io/qdiriterator.cpp:218
#5  0x00007fffe015dd78 in imageSourceToRes(Tiled::Tileset const*, QString&) ()
    at /usr/lib/tiled/plugins/libtscn.so
#6  0x00007fffe015f0d7 in collectAssetsRecursive(QList<Tiled::Layer*> const&, AssetInfo&) ()
    at /usr/lib/tiled/plugins/libtscn.so
#7  0x00007fffe01600bc in Tscn::TscnPlugin::write(Tiled::Map const*, QString const&, QFlags<Tiled::FileFormat::Option>) () at /usr/lib/tiled/plugins/libtscn.so
#8  0x00007ffff7a5313e in Tiled::MainWindow::exportMapAs(Tiled::MapDocument*) ()
    at /usr/lib/libtilededitor.so
#9  0x00007ffff59b2229 in QtPrivate::QSlotObjectBase::call
    (this=0x555555c22c30, r=0x7fffffffd550, a=0x7fffffffc3e0, this=<optimized out>, r=<optimized out>, a=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:486
#10 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4120

I don't know if this information helps, but both the map as well as the tileset are saved in a subfolder of the Godot project (the folder containing the .godot folder).

Specifications:

  • OS: Arch
  • Tiled Version: 1.11.0
@ghtyrant ghtyrant added the bug Broken behavior. label Nov 29, 2024
@bjorn
Copy link
Member

bjorn commented Nov 30, 2024

Hmm, looks like a regression in Qt 6.8, possibly related to qt/qtbase@94dfcaa. Seems like the advance method called by next might no longer deal with an empty list of files correctly.

Likely could be worked around by either checking hasNext(), even though the documentation for QDirIterator::next() indicates this is not necessary, or using QDirListing when Tiled is compiled against Qt 6.8 or later.

@bjorn
Copy link
Member

bjorn commented Nov 30, 2024

Ok, the regression was QTBUG-130142, fixed in qt/qtbase@c769184, so the issue will also go away with Qt 6.8.1.

@bjorn bjorn added the qt issue Qt related issue. label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior. qt issue Qt related issue.
Projects
None yet
Development

No branches or pull requests

2 participants