Scripting CustomObjectMgr.addCustomObject() crash in CustomObject::getNameI18n()

Bug #1722527 reported by Matt P on 2017-10-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stellarium
Medium
Alexander Wolf

Bug Description

Tried 0.15.1 on Windows and Ubuntu binary 0.16.1.

Launch, hit F12.

Type:
core.moveToRaDec(0,0)
CustomObjectMgr.addCustomObject("Marker",0,0,true)

Both versions crash.

On Linux, the backtrace is shown below:

#0 0x00007ffff655cb01 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#1 0x00007ffff6567c3f in QString::arg(QString const&, int, QChar) const () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#2 0x00000000006d88e7 in CustomObject::getNameI18n() const ()
#3 0x00000000006d86b3 in CustomObject::draw(StelCore*, StelPainter*) ()
#4 0x00000000006da5b9 in CustomObjectMgr::draw(StelCore*) ()
#5 0x000000000060b11a in StelApp::draw() ()
...

Code in github looks like:
QString CustomObject::getNameI18n() const
{
 QString r = designation;
 if (isMarker)
 {
  QStringList cod = designation.split(" ");
  r = QString("%1 %2").arg(q_(cod.at(0))).arg(cod.at(1));
 }
 return r;
}

So I tried again on Windows with "Marker 1" instead of "Marker". It doesn't crash.

Related branches

Changed in stellarium:
status: New → Confirmed
milestone: none → 0.17.0
assignee: nobody → Alexander Wolf (alexwolf)
importance: Undecided → Medium
Alexander Wolf (alexwolf) wrote :

A fix has been committed as revision 9870 of the trunk branch in Stellarium's Bazaar repository at Launchpad: http://bazaar.launchpad.net/~stellarium/stellarium/trunk/revision/9870

Thanks for report!

Changed in stellarium:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers