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

Assertion failure when adding duplicate "spawnflags" key and trying to edit spawnflags. #1253

Closed
ericwa opened this issue Mar 9, 2016 · 1 comment
Assignees
Labels
Type:Bug Errors and problems

Comments

@ericwa
Copy link
Collaborator

ericwa commented Mar 9, 2016

Tested on fc9908f / OS X.
Steps to reproduce:

  1. Create a New map, choose quake

  2. Copy and paste at original position:

    {
    "spawnflags" "0"
    "classname" "misc_model"
    "origin" "-16 -864 32"
    "angle" "-0"
    "_shadow" "1"
    }
    
  3. select the entities tab. Click + to add a new key and type "spawnflags" + enter. The new key is merged with the existing "spawnflags" key.

  4. Double-click on the value box for "spawnflags". An assertion fails:

Assertion failed: (matches.size() == 1), function findAttribute, file /Users/ericwa/dev/TrenchBroom/common/src/Model/EntityAttributes.cpp, line 280.

(lldb) bt
* thread #1: tid = 0x16748, 0x00007fff919f6002 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00007fff919f6002 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x000000010331244e libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff838c36e7 libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff8388adf8 libsystem_c.dylib`__assert_rtn + 321
  * frame #4: 0x0000000100170e3a TrenchBroom`TrenchBroom::Model::EntityAttributes::findAttribute(this=0x00006130003beb88, name="spawnflags") const + 234 at EntityAttributes.cpp:280
    frame #5: 0x0000000100170d1f TrenchBroom`TrenchBroom::Model::EntityAttributes::hasAttribute(this=0x00006130003beb88, name="spawnflags") const + 47 at EntityAttributes.cpp:206
    frame #6: 0x000000010011888f TrenchBroom`TrenchBroom::Model::AttributableNode::hasAttribute(this=0x00006130003beb00, name="spawnflags") const + 47 at AttributableNode.cpp:127
    frame #7: 0x00000001005282d7 TrenchBroom`TrenchBroom::View::SmartSpawnflagsEditor::getFlagValue(this=0x000060f000099790, attributable=0x00006130003beb00) const + 55 at SmartSpawnflagsEditor.cpp:190
    frame #8: 0x00000001005281ae TrenchBroom`TrenchBroom::View::SmartSpawnflagsEditor::getFlagValues(this=0x000060f000099790, attributables=size=1, setFlags=0x00007fff5fbfe5c0, mixedFlags=0x00007fff5fbfe5bc) const + 126 at SmartSpawnflagsEditor.cpp:182
    frame #9: 0x0000000100527cd2 TrenchBroom`TrenchBroom::View::SmartSpawnflagsEditor::doUpdateVisual(this=0x000060f000099790, attributables=size=1) + 210 at SmartSpawnflagsEditor.cpp:132
    frame #10: 0x0000000100515682 TrenchBroom`TrenchBroom::View::SmartAttributeEditor::updateVisual(this=0x000060f000099790, attributables=size=1) + 50 at SmartAttributeEditor.cpp:86
    frame #11: 0x0000000100515646 TrenchBroom`TrenchBroom::View::SmartAttributeEditor::update(this=0x000060f000099790, attributables=size=1) + 70 at SmartAttributeEditor.cpp:48
    frame #12: 0x000000010051841d TrenchBroom`TrenchBroom::View::SmartAttributeEditorManager::updateEditor(this=0x0000618000057880) + 189 at SmartAttributeEditorManager.cpp:136
    frame #13: 0x0000000100518132 TrenchBroom`TrenchBroom::View::SmartAttributeEditorManager::switchEditor(this=0x0000618000057880, name="spawnflags", attributables=size=1) + 130 at SmartAttributeEditorManager.cpp:54
    frame #14: 0x00000001003ac8a7 TrenchBroom`TrenchBroom::View::EntityAttributeEditor::OnEntityAttributeSelected(this=0x0000618000058c80, command=0x00007fff5fbfe918) + 215 at EntityAttributeEditor.cpp:48
    frame #15: 0x0000000100914fc9 TrenchBroom`wxEvtHandler::SearchDynamicEventTable(wxEvent&) + 185
    frame #16: 0x0000000100914d3b TrenchBroom`wxEvtHandler::ProcessEventLocally(wxEvent&) + 59
    frame #17: 0x0000000100914c4b TrenchBroom`wxEvtHandler::ProcessEvent(wxEvent&) + 187
    frame #18: 0x00000001003af530 TrenchBroom`TrenchBroom::View::EntityAttributeGrid::fireSelectionEvent(this=0x0000618000058480, row=0, col=1) + 288 at EntityAttributeGrid.cpp:98
    frame #19: 0x00000001003af405 TrenchBroom`TrenchBroom::View::EntityAttributeGrid::OnAttributeGridSelectCell(this=0x0000618000058480, event=0x00007fff5fbfeb10) + 101 at EntityAttributeGrid.cpp:60
....

The assertion fails because matches.size() is actually 2.

@kduske kduske added Type:Bug Errors and problems Platform:All labels Mar 9, 2016
@kduske kduske added this to the TrenchBroom 2.0.0 milestone Mar 9, 2016
@kduske kduske self-assigned this Mar 9, 2016
@kduske
Copy link
Collaborator

kduske commented Mar 9, 2016

Fixed in adf2f66.

@kduske kduske closed this as completed Mar 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Errors and problems
Projects
None yet
Development

No branches or pull requests

2 participants