[FreeBSD - 2.69] Segfault whenever dynamic topology is enabled #39245

Closed
opened 2014-03-18 03:54:07 +01:00 by Mike Pelletier · 11 comments

System Information
FreeBSD 10 for amd64; uname -a:

FreeBSD igor.home.mkp.ca 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  

Graphics card identifies as "GeForce 210" at bootup.

Blender Version
Broken: "2.69.0 runknown" (as reported by splash screen)

Short description of error
blender-bin drops a .core file (ie crashes) from a segfault whenever I click the "Enable Dynamic" button in Sculpt Mode.

Exact steps for others to reproduce the error
Starting from any .blend file (or Ctrl N), switch to Sculpt Mode and click "Enable Dynamic". Blender crashes.

Additional info
Other reports of a crash at the same point suggest turning on VBO in User Preferences as a diagnostic. I've turned on VBO, loaded the default scene, converted the cube to triangles, scaled it up and down, poked at it a bit, and nothing weird happened.

Stack trace

I hope this is helpful.

(gdb) run
Starting program: /usr/local/bin/blender-bin
[New LWP 100541]
[New Thread 81a006400 (LWP 100541/blender-bin)]
Read new prefs: /home/mike/.config/blender/2.69/config/userpref.blend

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 81a006400 (LWP 100541/blender-bin)]

0x0000000001fb6624 in RangeTree::take (this=0x81cff3a80, t=0)

    at __tree:68

68 return __x == __x->_parent->_left;

Current language:  auto; currently c++
(gdb) where

#0 0x0000000001fb6624 in RangeTree::take (this=0x81cff3a80, t=0)

    at __tree:68

#1 0x0000000001fb642c in range_tree_uint_take_any (rt=0x81b7855e0)

    at range_tree.hh:113

#2 0x0000000001172578 in bm_log_assign_ids (bm=0x81aba7838, log=0x81a0aa078)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/bmesh/intern/bmesh_log.c:351

#3 0x0000000001171c2e in BM_log_create (bm=0x81aba7838)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/bmesh/intern/bmesh_log.c:463

#4 0x0000000000e81e15 in sculpt_dynamic_topology_enable (C=0x81a03f3f8)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4720

#5 0x0000000000e82903 in sculpt_dynamic_topology_toggle_exec (C=0x81a03f3f8,

    UNUSED_op=0x81cd8ed38)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4797

#6 0x0000000000e82856 in sculpt_dynamic_topology_toggle_invoke (C=0x81a03f3f8,

    op=0x81cd8ed38, UNUSED_event=0x81a7f0778)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4827

#7 0x0000000000959325 in wm_operator_invoke (C=0x81a03f3f8, ot=0x81a5c9f38,

    event=0x81a7f0778, properties=0x7fffffffcdc8, reports=0x0, poll_only=false)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:996

#8 0x0000000000952434 in wm_operator_call_internal (C=0x81a03f3f8, ot=0x81a5c9f38,

    properties=0x7fffffffcdc8, reports=0x0, context=1, poll_only=false)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1185

#9 0x0000000000953323 in WM_operator_name_call (C=0x81a03f3f8,

    opstring=0x21f37b4 "SCULPT_OT_dynamic_topology_toggle", context=1, 
    properties=0x7fffffffcdc8)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1234

#10 0x0000000000c6bf50 in ui_apply_but_funcs_after (C=0x81a03f3f8)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/interface/interface_handlers.c:499

#11 0x0000000000c71544 in ui_handler_region_menu (C=0x81a03f3f8, event=0x81cda90b8,

    UNUSED_userdata=0x81b67ebb8)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/interface/interface_handlers.c:7693

#12 0x0000000000958549 in wm_handler_ui_call (C=0x81a03f3f8, handler=0x81cd3d838,

    event=0x81cda90b8, always_pass=0)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:416

#13 0x0000000000957804 in wm_handlers_do_intern (C=0x81a03f3f8, event=0x81cda90b8,

    handlers=0x81a735448)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1868

#14 0x0000000000954525 in wm_handlers_do (C=0x81a03f3f8, event=0x81cda90b8,

    handlers=0x81a735448)
    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1947

#15 0x0000000000953da9 in wm_event_do_handlers (C=0x81a03f3f8)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:2193

#16 0x000000000094bb0e in WM_main (C=0x81a03f3f8)

    at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm.c:459

#17 0x0000000000947727 in main (argc=1, argv=0x7fffffffd2a8)

    at /usr/ports/graphics/blender/work/blender-2.69/source/creator/creator.c:1676
(gdb) 
**System Information** FreeBSD 10 for amd64; uname -a: ``` FreeBSD igor.home.mkp.ca 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC ``` Graphics card identifies as "GeForce 210" at bootup. **Blender Version** Broken: "2.69.0 runknown" (as reported by splash screen) **Short description of error** blender-bin drops a .core file (ie crashes) from a segfault whenever I click the "Enable Dynamic" button in Sculpt Mode. **Exact steps for others to reproduce the error** Starting from any .blend file (or Ctrl N), switch to Sculpt Mode and click "Enable Dynamic". Blender crashes. **Additional info** Other reports of a crash at the same point suggest turning on VBO in User Preferences as a diagnostic. I've turned on VBO, loaded the default scene, converted the cube to triangles, scaled it up and down, poked at it a bit, and nothing weird happened. **Stack trace** I hope this is helpful. ``` (gdb) run Starting program: /usr/local/bin/blender-bin [New LWP 100541] [New Thread 81a006400 (LWP 100541/blender-bin)] Read new prefs: /home/mike/.config/blender/2.69/config/userpref.blend Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 81a006400 (LWP 100541/blender-bin)] ``` 0x0000000001fb6624 in RangeTree<unsigned int>::take (this=0x81cff3a80, t=0) ``` at __tree:68 ``` 68 return __x == __x->__parent_->__left_; ``` Current language: auto; currently c++ (gdb) where ``` #0 0x0000000001fb6624 in RangeTree<unsigned int>::take (this=0x81cff3a80, t=0) ``` at __tree:68 ``` #1 0x0000000001fb642c in range_tree_uint_take_any (rt=0x81b7855e0) ``` at range_tree.hh:113 ``` #2 0x0000000001172578 in bm_log_assign_ids (bm=0x81aba7838, log=0x81a0aa078) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/bmesh/intern/bmesh_log.c:351 ``` #3 0x0000000001171c2e in BM_log_create (bm=0x81aba7838) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/bmesh/intern/bmesh_log.c:463 ``` #4 0x0000000000e81e15 in sculpt_dynamic_topology_enable (C=0x81a03f3f8) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4720 ``` #5 0x0000000000e82903 in sculpt_dynamic_topology_toggle_exec (C=0x81a03f3f8, ``` UNUSED_op=0x81cd8ed38) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4797 ``` #6 0x0000000000e82856 in sculpt_dynamic_topology_toggle_invoke (C=0x81a03f3f8, ``` op=0x81cd8ed38, UNUSED_event=0x81a7f0778) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/sculpt_paint/sculpt.c:4827 ``` #7 0x0000000000959325 in wm_operator_invoke (C=0x81a03f3f8, ot=0x81a5c9f38, ``` event=0x81a7f0778, properties=0x7fffffffcdc8, reports=0x0, poll_only=false) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:996 ``` #8 0x0000000000952434 in wm_operator_call_internal (C=0x81a03f3f8, ot=0x81a5c9f38, ``` properties=0x7fffffffcdc8, reports=0x0, context=1, poll_only=false) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1185 ``` #9 0x0000000000953323 in WM_operator_name_call (C=0x81a03f3f8, ``` opstring=0x21f37b4 "SCULPT_OT_dynamic_topology_toggle", context=1, properties=0x7fffffffcdc8) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1234 ``` #10 0x0000000000c6bf50 in ui_apply_but_funcs_after (C=0x81a03f3f8) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/interface/interface_handlers.c:499 ``` #11 0x0000000000c71544 in ui_handler_region_menu (C=0x81a03f3f8, event=0x81cda90b8, ``` UNUSED_userdata=0x81b67ebb8) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/editors/interface/interface_handlers.c:7693 ``` #12 0x0000000000958549 in wm_handler_ui_call (C=0x81a03f3f8, handler=0x81cd3d838, ``` event=0x81cda90b8, always_pass=0) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:416 ``` #13 0x0000000000957804 in wm_handlers_do_intern (C=0x81a03f3f8, event=0x81cda90b8, ``` handlers=0x81a735448) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1868 ``` #14 0x0000000000954525 in wm_handlers_do (C=0x81a03f3f8, event=0x81cda90b8, ``` handlers=0x81a735448) at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:1947 ``` #15 0x0000000000953da9 in wm_event_do_handlers (C=0x81a03f3f8) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm_event_system.c:2193 ``` #16 0x000000000094bb0e in WM_main (C=0x81a03f3f8) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/blender/windowmanager/intern/wm.c:459 ``` #17 0x0000000000947727 in main (argc=1, argv=0x7fffffffd2a8) ``` at /usr/ports/graphics/blender/work/blender-2.69/source/creator/creator.c:1676 (gdb) ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @nerdbeard

Added subscriber: @nerdbeard
Bastien Montagne changed title from Segfault whenever dynamic topology is enabled to [FreeBSD - 2.69] Segfault whenever dynamic topology is enabled 2014-03-18 08:05:43 +01:00

Added subscribers: @ideasman42, @mont29

Added subscribers: @ideasman42, @mont29

Hrrrm… issues are, that we do not support BSD (as in, we do not provide official builds, even though we try to keep Blender working on those OSs), and 2.69 is rather old, would need to test with 2.70.

Also, Geforce 210 is a very low-end GPU, and I’m not sure about BSD graphic drivers either. :/

Think we do have a few devs with FreeBSD on a VM, maybe they have more insight here?

Hrrrm… issues are, that we do not support BSD (as in, we do not provide official builds, even though we try to keep Blender working on those OSs), and 2.69 is rather old, would need to test with 2.70. Also, Geforce 210 is a very low-end GPU, and I’m not sure about BSD graphic drivers either. :/ Think we do have a few devs with FreeBSD on a VM, maybe they have more insight here?
Campbell Barton self-assigned this 2014-03-18 11:28:21 +01:00
Author

It's understandable that my configuration could be unsupported or just plain insufficient, but Blender should never segfault in the middle of a session. The objective here isn't necessarily to make dynamic topology to work, it's just to fix the segfault. The code path never seems to enter third party code between pressing the button and crashing.

Perhaps I should also report it to the FreeBSD port maintainer.

I'd try to compile 2.70 but I see there is a mess of patches for 2.69 for FreeBSD so I might be better off trying to run the official Linux build under linuxulation.

It's understandable that my configuration could be unsupported or just plain insufficient, but Blender should never segfault in the middle of a session. The objective here isn't necessarily to make dynamic topology to work, it's just to fix the segfault. The code path never seems to enter third party code between pressing the button and crashing. Perhaps I should also report it to the FreeBSD port maintainer. I'd try to compile 2.70 but I see there is a mess of patches for 2.69 for FreeBSD so I might be better off trying to run the official Linux build under linuxulation.
Author

Oh, my video driver is nvidia-driver-331.49, which was the latest available when I built everything a couple days ago.

Oh, my video driver is nvidia-driver-331.49, which was the latest available when I built everything a couple days ago.

This issue was referenced by blender/blender-addons-contrib@9bbb30bf03

This issue was referenced by blender/blender-addons-contrib@9bbb30bf03b21f4bc9d19250a9f9342157b19aac

This issue was referenced by 9bbb30bf03

This issue was referenced by 9bbb30bf03b21f4bc9d19250a9f9342157b19aac

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit 9bbb30bf03.

Closed by commit 9bbb30bf03.

This was a curious bug,

With libstdc++ (on all platforms from what I can tell) tested Linux Clang/GCC and MSVC there was iterator decrement being optimized out.

 void take(T t) {
	#if RANGE_TREE_DEBUG_PRINT_FUNCTION
	std::cout << __func__ << "(" << t << ")\n";
	#endif

	/* Find the range that includes 't' and its neighbors */
	TreeIter iter = tree.find(Range(t));
	assert(iter != tree.end());
	Range cur = *iter;
	TreeIter prev = iter;
	TreeIter next = iter;
	  - prev;
	++next;

	/* Remove the original range (note that this does not
	   invalidate the prev/next iterators) */
	tree.erase(iter);

	/* Construct two new ranges that together cover the original
	   range, except for 't' */
	if (t > cur.min)
		tree.insert(Range(cur.min, t - 1));
	if (t + 1 <= cur.max)
		tree.insert(Range(t + 1, cur.max));
 }

Checked the optimized asssembler output from GCC and these lines make no difference to the result.

	TreeIter prev = iter;
	TreeIter next = iter;
	  - prev;
	++next;

But on FreeBSD --prev; is crashing.

So removing these 4 lines fixes the crash.

This was a curious bug, With libstdc++ (on all platforms from what I can tell) tested Linux Clang/GCC and MSVC there was iterator decrement being optimized out. void take(T t) { #if RANGE_TREE_DEBUG_PRINT_FUNCTION std::cout << __func__ << "(" << t << ")\n"; #endif /* Find the range that includes 't' and its neighbors */ TreeIter iter = tree.find(Range(t)); assert(iter != tree.end()); Range cur = *iter; TreeIter prev = iter; TreeIter next = iter; - prev; ++next; /* Remove the original range (note that this does not invalidate the prev/next iterators) */ tree.erase(iter); /* Construct two new ranges that together cover the original range, except for 't' */ if (t > cur.min) tree.insert(Range(cur.min, t - 1)); if (t + 1 <= cur.max) tree.insert(Range(t + 1, cur.max)); } Checked the optimized asssembler output from GCC and these lines make no difference to the result. TreeIter prev = iter; TreeIter next = iter; - prev; ++next; But on FreeBSD `--prev;` is crashing. So removing these 4 lines fixes the crash.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39245
No description provided.