Navigation Menu

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

Crash when applying AD1.5 FGD without enabling the mod #1525

Closed
ericwa opened this issue Dec 6, 2016 · 3 comments
Closed

Crash when applying AD1.5 FGD without enabling the mod #1525

ericwa opened this issue Dec 6, 2016 · 3 comments
Labels
Prio:1 Highest priority: Crash or crippling bugs, features that enable new ways of working Type:Bug Errors and problems

Comments

@ericwa
Copy link
Collaborator

ericwa commented Dec 6, 2016

This may be a duplicate of #1522 but my stack trace / explanation are a bit different.

Tested on a debug build of 6156a72 and macOS 10.12.

  1. Download AD1.5 from https://twitter.com/SimsOCallaghan/status/805343155092680704 and extract in your quake directory
  2. Open maps/ad_magna.map. Choose Valve format. The map should open successfully.
  3. On the entity inspector, browse for an external entity definition. Open ad_quake.fgd
  4. Click "OK" to accept the Absolute path type, and TB will crash with the attached stack trace.
  5. However, if you enable the AD directory in the Mods panel of TB before loading the FGD, the FGD will load without crashing.
(lldb) bt
* thread #1: tid = 0x51867, 0x0000000100374852 TrenchBroom`TrenchBroom::Renderer::VertexArray::vertexCount(this=0x0000610000840ab0) const + 66 at VertexArray.cpp:58, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xc)
  * frame #0: 0x0000000100374852 TrenchBroom`TrenchBroom::Renderer::VertexArray::vertexCount(this=0x0000610000840ab0) const + 66 at VertexArray.cpp:58
    frame #1: 0x00000001003747f5 TrenchBroom`TrenchBroom::Renderer::VertexArray::empty(this=0x0000610000840ab0) const + 21 at VertexArray.cpp:50
    frame #2: 0x00000001003749d9 TrenchBroom`TrenchBroom::Renderer::VertexArray::setup(this=0x0000610000840ab0) + 25 at VertexArray.cpp:72
    frame #3: 0x000000010036c8b9 TrenchBroom`TrenchBroom::Renderer::TexturedIndexRangeRenderer::render(this=0x0000610000840ab0) + 25 at TexturedIndexRangeRenderer.cpp:43
    frame #4: 0x00000001002f58e9 TrenchBroom`TrenchBroom::Renderer::EntityModelRenderer::doRender(this=0x000000010411ab68, renderContext=0x00007fff5fbf9ea0) + 1497 at EntityModelRenderer.cpp:136
    frame #5: 0x0000000100349c4f TrenchBroom`TrenchBroom::Renderer::Renderable::render(this=0x000000010411ab68, renderContext=0x00007fff5fbf9ea0) + 47 at Renderable.cpp:29
    frame #6: 0x000000010033b0e6 TrenchBroom`TrenchBroom::Renderer::RenderBatch::renderRenderables(this=0x00007fff5fbf9e50, renderContext=0x00007fff5fbf9ea0) + 182 at RenderBatch.cpp:143
    frame #7: 0x000000010033afad TrenchBroom`TrenchBroom::Renderer::RenderBatch::render(this=0x00007fff5fbf9e50, renderContext=0x00007fff5fbf9ea0) + 77 at RenderBatch.cpp:100
    frame #8: 0x000000010055be11 TrenchBroom`TrenchBroom::View::MapViewBase::doRender(this=0x0000000104163800) + 1473 at MapViewBase.cpp:874
    frame #9: 0x000000010055c389 TrenchBroom`non-virtual thunk to TrenchBroom::View::MapViewBase::doRender(this=0x0000000104163800) + 25 at MapViewBase.cpp:839
    frame #10: 0x00000001005a2ba6 TrenchBroom`TrenchBroom::View::RenderView::render(this=0x0000000104163800) + 38 at RenderView.cpp:126
    frame #11: 0x00000001005a2a95 TrenchBroom`TrenchBroom::View::RenderView::OnPaint(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 149 at RenderView.cpp:56
    frame #12: 0x00000001029522b2 libwx_baseu-3.1.dylib`wxAppConsoleBase::HandleEvent(this=0x00000001035009a0, handler=0x0000000104163800, func=00 2a 5a 00 01 00 00 00 00 00 00 00 00 00 00 00, event=0x00007fff5fbfa4a8)(wxEvent&), wxEvent&) const + 130 at appbase.cpp:657
    frame #13: 0x0000000102952355 libwx_baseu-3.1.dylib`wxAppConsoleBase::CallEventHandler(this=0x00000001035009a0, handler=0x0000000104163800, functor=0x000061000023de80, event=0x00007fff5fbfa4a8) const + 149 at appbase.cpp:669
    frame #14: 0x0000000102ab983c libwx_baseu-3.1.dylib`wxEvtHandler::ProcessEventIfMatchesId(entry=0x00006100004290c0, handler=0x0000000104163800, event=0x00007fff5fbfa4a8) + 220 at event.cpp:1381
    frame #15: 0x0000000102abba26 libwx_baseu-3.1.dylib`wxEvtHandler::SearchDynamicEventTable(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 310 at event.cpp:1831
    frame #16: 0x0000000102abb81d libwx_baseu-3.1.dylib`wxEvtHandler::TryHereOnly(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 77 at event.cpp:1574
    frame #17: 0x0000000102abb58d libwx_baseu-3.1.dylib`wxEvtHandler::TryBeforeAndHere(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 77 at event.h:3656
    frame #18: 0x0000000102abb5cf libwx_baseu-3.1.dylib`wxEvtHandler::ProcessEventLocally(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 47 at event.cpp:1511
    frame #19: 0x0000000102abb46a libwx_baseu-3.1.dylib`wxEvtHandler::ProcessEvent(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 314 at event.cpp:1484
    frame #20: 0x0000000102abbbe0 libwx_baseu-3.1.dylib`wxEvtHandler::SafelyProcessEvent(this=0x0000000104163800, event=0x00007fff5fbfa4a8) + 32 at event.cpp:1602
    frame #21: 0x0000000102145bf5 libwx_osx_cocoau_core-3.1.dylib`wxWindowBase::HandleWindowEvent(this=0x0000000104163800, event=0x00007fff5fbfa4a8) const + 37 at wincmn.cpp:1534
    frame #22: 0x0000000101ee0aab libwx_osx_cocoau_core-3.1.dylib`wxWindow::MacDoRedraw(this=0x0000000104163800, time=0) + 1467 at window_osx.cpp:1998
    frame #23: 0x0000000101ffd1e8 libwx_osx_cocoau_core-3.1.dylib`wxWidgetCocoaImpl::drawRect(this=0x0000610000870380, rect=0x00007fff5fbfaab0, slf=0x0000610000179980, (null)=2001-01-01 00:00:00 UTC) + 1400 at window.mm:1630
    frame #24: 0x0000000101ffb420 libwx_osx_cocoau_core-3.1.dylib`wxOSX_drawRect(self=0x0000610000179980, _cmd="drawRect:", rect=(origin = (x = 0, y = 0), size = (width = 1182, height = 693))) + 704 at window.mm:1122
    frame #25: 0x00007fff7da42634 AppKit`-[NSView _drawRect:clip:] + 2276
    frame #26: 0x00007fff7da9230a AppKit`-[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 1753
    frame #27: 0x00007fff7da92775 AppKit`-[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] + 2884
    frame #28: 0x00007fff7da4016d AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 837
    frame #29: 0x00007fff7da40d6c AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3908
    frame #30: 0x00007fff7da40d6c AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3908
    frame #31: 0x00007fff7da40d6c AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3908
    frame #32: 0x00007fff7da40d6c AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3908
    frame #33: 0x00007fff7da40d6c AppKit`-[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 3908
    frame #34: 0x00007fff7da3f94b AppKit`-[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:] + 334
    frame #35: 0x00007fff7da3dd73 AppKit`-[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 2452
    frame #36: 0x00007fff7da39662 AppKit`-[NSView displayIfNeeded] + 1748
    frame #37: 0x00007fff7da38f73 AppKit`-[NSWindow displayIfNeeded] + 230
    frame #38: 0x00007fff7e123c2f AppKit`___NSWindowGetDisplayCycleObserver_block_invoke.6219 + 277
    frame #39: 0x00007fff7da38a51 AppKit`__37+[NSDisplayCycle currentDisplayCycle]_block_invoke + 454
    frame #40: 0x00007fff857a01ba QuartzCore`CA::Transaction::run_commit_handlers(CATransactionPhase) + 46
    frame #41: 0x00007fff858a7e10 QuartzCore`CA::Context::commit_transaction(CA::Transaction*) + 160
    frame #42: 0x00007fff8579ed55 QuartzCore`CA::Transaction::commit() + 475
    frame #43: 0x00007fff7dd0ec69 AppKit`__37+[NSDisplayCycle currentDisplayCycle]_block_invoke.31 + 323
    frame #44: 0x00007fff7fc83ec7 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #45: 0x00007fff7fc83e37 CoreFoundation`__CFRunLoopDoObservers + 391
    frame #46: 0x00007fff7fc64d79 CoreFoundation`__CFRunLoopRun + 873
    frame #47: 0x00007fff7fc647b4 CoreFoundation`CFRunLoopRunSpecific + 420
    frame #48: 0x00007fff7f200fbc HIToolbox`RunCurrentEventLoopInMode + 240
    frame #49: 0x00007fff7f200cf9 HIToolbox`ReceiveNextEventCommon + 184
    frame #50: 0x00007fff7f200c26 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
    frame #51: 0x00007fff7d8eab79 AppKit`_DPSNextEvent + 1093
    frame #52: 0x00007fff7e0001c3 AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1637
    frame #53: 0x00007fff7d8df53d AppKit`-[NSApplication run] + 926
    frame #54: 0x0000000101fcd2b3 libwx_osx_cocoau_core-3.1.dylib`wxGUIEventLoop::OSXDoRun(this=0x00006000000a4e60) + 163 at evtloop.mm:300
    frame #55: 0x0000000102a89167 libwx_baseu-3.1.dylib`wxCFEventLoop::DoRun(this=0x00006000000a4e60) + 39 at evtloop_cf.cpp:310
    frame #56: 0x000000010299ce54 libwx_baseu-3.1.dylib`wxEventLoopBase::Run(this=0x00006000000a4e60) + 228 at evtloopcmn.cpp:76
    frame #57: 0x0000000102950f5d libwx_baseu-3.1.dylib`wxAppConsoleBase::MainLoop(this=0x00000001035009a0) + 189 at appbase.cpp:380
    frame #58: 0x00000001029509d9 libwx_baseu-3.1.dylib`wxAppConsoleBase::OnRun(this=0x00000001035009a0) + 25 at appbase.cpp:301
    frame #59: 0x000000010200963b libwx_osx_cocoau_core-3.1.dylib`wxAppBase::OnRun(this=0x00000001035009a0) + 59 at appcmn.cpp:311
    frame #60: 0x0000000101f3b0b5 libwx_osx_cocoau_core-3.1.dylib`wxApp::OnRun(this=0x00000001035009a0) + 37 at app.cpp:365
    frame #61: 0x00000001003809af TrenchBroom`TrenchBroom::View::TrenchBroomApp::OnRun(this=0x00000001035009a0) + 31 at TrenchBroomApp.cpp:410
    frame #62: 0x00000001029df89f libwx_baseu-3.1.dylib`wxEntry(argc=0x0000000102bb7c20, argv=0x0000600000000660) + 319 at init.cpp:503
    frame #63: 0x00000001029dfa8c libwx_baseu-3.1.dylib`wxEntry(argc=0x00007fff5fbff6a8, argv=0x00007fff5fbff6d0) + 60 at init.cpp:515
    frame #64: 0x000000010000e186 TrenchBroom`main(argc=1, argv=0x00007fff5fbff6d0) + 38 at Main.cpp:23
    frame #65: 0x00007fff94dd1255 libdyld.dylib`start + 1
@kduske kduske added this to the TrenchBroom 2.0.0 milestone Dec 6, 2016
@kduske kduske added Type:Bug Errors and problems Platform:All Prio:1 Highest priority: Crash or crippling bugs, features that enable new ways of working labels Dec 6, 2016
@kduske
Copy link
Collaborator

kduske commented Dec 6, 2016

Does this happen with this mod only?

@ericwa
Copy link
Collaborator Author

ericwa commented Dec 6, 2016

Hmm.. I can get some weird behaviour with quoth, though not a crash.

  1. paste this into a new Quake map (no mod or Quoth entity definitions enabled):
{
"classname" "item_flashlight"
"origin" "-8 -8 24"
"angle" "-0"
}
  1. Double click on Quoth2.fgd from the list of builtin entity definitions.

At this point the 3d view will no longer update. If I resize the window, I get this:
screen shot 2016-12-05 at 10 32 30 pm

If you enable Quoth.fgd before pasting the flashlight, it's fine.

@ericwa
Copy link
Collaborator Author

ericwa commented Dec 6, 2016

Investigating my last comment a bit: setting a breakpoint in Xcode for exceptions being thrown and caught, I think I see what's happening.

  • FileSystem::openFile is throwing a FileSystemException when being asked to load flashlight.mdl
  • The stack trace looks OK down to EntityModelManager::model(const IO::Path&), which is going to rethrow a GameException. The next stack frames down the stack, EntityModelManager::renderer, EntityModelRenderer::updateEntity, andEntityModelRenderer::updateEntities do not handle the GameException. The exception is caught in CommandProcessor::doCommand, but I am assuming by this point the application is in an invalid state.

My guess is EntityModelManager::model(const IO::Path&) should return NULL at EntityModelManager.cpp:92 instead of rethrowing the GameException. Quickly testing this, it seems to fix the quoth flashlight issue as well as ad_magna.map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:1 Highest priority: Crash or crippling bugs, features that enable new ways of working Type:Bug Errors and problems
Projects
None yet
Development

No branches or pull requests

2 participants