René's URL Explorer Experiment


Title: Bonsai: type thumbnail generation crashes Blender by starting threaded preview jobs during authoring · Issue #10138 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: Bonsai: type thumbnail generation crashes Blender by starting threaded preview jobs during authoring · Issue #10138 · IfcOpenShell/IfcOpenShell

X Title: Bonsai: type thumbnail generation crashes Blender by starting threaded preview jobs during authoring · Issue #10138 · IfcOpenShell/IfcOpenShell

Description: Bug Description bim.load_type_thumbnails calls Object.asset_generate_preview() once per type on the current Type Manager page. That function queues a threaded icon render job, and the job calls DEG_graph_build_from_view_layer() on a work...

Open Graph Description: Bug Description bim.load_type_thumbnails calls Object.asset_generate_preview() once per type on the current Type Manager page. That function queues a threaded icon render job, and the job calls DEG...

X Description: Bug Description bim.load_type_thumbnails calls Object.asset_generate_preview() once per type on the current Type Manager page. That function queues a threaded icon render job, and the job calls DEG...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/10138

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bonsai: type thumbnail generation crashes Blender by starting threaded preview jobs during authoring","articleBody":"## Bug Description\n\n`bim.load_type_thumbnails` calls `Object.asset_generate_preview()` once per type on the\ncurrent Type Manager page. That function queues a **threaded** icon render job, and the job\ncalls `DEG_graph_build_from_view_layer()` on a worker thread. While those jobs are in flight,\nany authoring on the main thread can free or rebuild the objects, meshes and materials they are\nwalking, and Blender segfaults.\n\nBecause `bim.load_type_thumbnails` is also fired from property update callbacks\n(`update_ifc_class`, `update_type_page`, `update_search_name`) and thumbnails are invalidated\nby `mark_thumbnail_for_update` after parametric edits, this happens repeatedly during ordinary\nmodelling rather than only when the Type Manager is opened.\n\nI have hit this three times on two different projects and two different Blender versions. All\nthree crash reports show `bim.load_type_thumbnails()` in the operator log shortly beforehand.\n\n**Crash 1 — Blender 5.2.1**, in the outliner, reading a null `Collection` while rebuilding the\nview layer tree:\n\n```\nTreeDisplayViewLayer::add_layer_collections_recursive   \u003c- read at 0x10\nTreeDisplayViewLayer::add_view_layer / build_tree\noutliner_build_tree -> draw_outliner -> ED_region_do_draw -> wm_draw_update\n```\n\n**Crash 2 — Blender 5.2.1**, in `context.selected_objects` from a viewport draw handler,\nreading a garbage `Base`:\n\n```\nBKE_base_is_visible                                     \u003c- read at 0x26\nscreen_ctx_selected_objects -> ed_screen_context -> CTX_data_get\npyrna_struct_getattro -> ... -> cb_region_draw -> view3d_main_region_draw\n```\n\n**Crash 3 — Blender 5.1.2**, the decisive one: inside the preview job itself, on the job\nthread:\n\n```\nDepsgraphNodeBuilder::build_materials                   \u003c- read at 0x0\nDepsgraphNodeBuilder::build_object / build_view_layer\nDEG_graph_build_from_view_layer\nobject_preview_render\nicon_preview_startjob_all_sizes\ndo_job_thread\n```\n\nOperator log immediately before crash 3:\n\n```\nbpy.ops.bim.reassign_class()        # rebuilds the object\nbpy.ops.bim.load_type_thumbnails()  # queues N threaded preview jobs\nbpy.ops.bim.load_type_thumbnails()\nbpy.ops.bim.hotkey(hotkey=\"S_A\")\nbpy.ops.bim.create_instance()       # creates objects, meshes, materials\nbpy.ops.bim.add_occurrence()\n\u003ccrash on the job thread>\n```\n\nCrashes 1 and 2 are consistent with the same race — `BKE_layer_collection_sync` rebuilds both\n`layer_collections` and `object_bases`, and each crash is a main-thread consumer walking one of\nthose halves — but only crash 3 proves the job can die on its own.\n\n### Why `asset_generate_preview()` is the threaded one\n\nOn blender/blender#105325, Philipp Oeser diagnosed it (comment 893982): \"this is indeed\ncaused by the fact that `ED_asset_generate_preview` calls `UI_icon_render_id` as a job, whereas\n`previews_id_ensure` doesnt\". The reporter there also found that `preview_ensure()` in a loop\ndid not crash where `asset_generate_preview()` did. Bonsai already calls `obj.preview_ensure()` immediately before, but that only allocates\nthe preview; `asset_generate_preview()` queues the render that actually draws thumbnails for\nobjects with mesh data, so it cannot simply be deleted without losing those thumbnails.\n\n### To reproduce\n\nNot reliably reproducible on demand — it is a race, and it took three occurrences over six\nweeks of normal use. It needs a project with enough element types that a Type Manager page\nholds several mesh-backed types, then: edit a type's geometry (invalidating its thumbnail),\nchange selection so a property callback re-fires `bim.load_type_thumbnails`, and immediately\nkeep authoring (`reassign_class`, `create_instance`, `add_occurrence`).\n\n### Suggested fix\n\nDo not start these jobs while the scene is being mutated. Since Python cannot cancel an\nin-flight preview job, the achievable approach is to queue the renders and start them one at a\ntime once the scene has settled — tracked with a `depsgraph_update_post` timestamp and a\n`bpy.app.timers` drain. This removes the \"N jobs in flight while authoring\" condition that all\nthree crashes share. It narrows the window rather than closing it completely; closing it needs\nthe upstream fix.\n\nI have a patch doing exactly that and will open a PR.\n\n## Attachments\n\nFull crash reports for all three available on request.\n\n## Debug and Error Output\n\n- Bonsai: 0.8.6a / 0.9.0a (both affected; the call is identical in each)\n- Blender: 5.1.2 (`ec6e62d40fa9`) and 5.2.1 (`9e2066aef7ef`)\n- OS: Windows 10\n- Relevant code: `tool/model.py` `Model.update_thumbnail_for_element`, and\n  `bim/module/model/product.py` `LoadTypeThumbnails.execute`\n- Related: #6839 (thumbnails don't render — the fix that introduced the current\n  `preview_ensure()` + `asset_generate_preview()` pairing, `c333535ae5`),\n  blender/blender#105325, blender/blender#140903\n- Upstream report for the underlying threaded-depsgraph race, now filed:\n  https://projects.blender.org/blender/blender/issues/166210\n\n","author":{"url":"https://github.com/theoryshaw","@type":"Person","name":"theoryshaw"},"datePublished":"2026-11-05T23:44:04Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/10138"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b2a13a02-8f72-e248-0b16-2b04daab72ee
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBB84:3D1C6E:C19EA:112362:6B04638E
html-safe-nonce1de250ab21bf5a72caee5d7fd3b6b85a8e037df965731f2a1a9cb11499a63c05
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQjg0OjNEMUM2RTpDMTlFQToxMTIzNjI6NkIwNDYzOEUiLCJ2aXNpdG9yX2lkIjoiNzkzODc2NTg1MzIwMDUwNzc5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac680c7d3b8106af892d9e871a3f0efc0d3155ef08be255846c26eb25da4fa1ff0
hovercard-subject-tagissue:6233713123
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/10138/issue_layout
twitter:imagehttps://opengraph.githubassets.com/83aed4429e093cca160b591c8118f47a9d38b3e14284463bd3ea8de6481b5b41/IfcOpenShell/IfcOpenShell/issues/10138
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/83aed4429e093cca160b591c8118f47a9d38b3e14284463bd3ea8de6481b5b41/IfcOpenShell/IfcOpenShell/issues/10138
og:image:altBug Description bim.load_type_thumbnails calls Object.asset_generate_preview() once per type on the current Type Manager page. That function queues a threaded icon render job, and the job calls DEG...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametheoryshaw
hostnamegithub.com
expected-hostnamegithub.com
None2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release03e114520787ad27289207f153520ef97461127c
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/10138#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10138
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F10138
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10138
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10138
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10138
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests936 (936)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10138
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10138
#10139https://github.com/IfcOpenShell/IfcOpenShell/pull/10139
Bonsai: type thumbnail generation crashes Blender by starting threaded preview jobs during authoringhttps://github.com/IfcOpenShell/IfcOpenShell/issues/10138#top
#10139https://github.com/IfcOpenShell/IfcOpenShell/pull/10139
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
https://github.com/theoryshaw
theoryshawhttps://github.com/theoryshaw
on Nov 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10138#issue-6233713123
Thumbnails don't seem to render anymore #6839https://github.com/IfcOpenShell/IfcOpenShell/issues/6839
https://projects.blender.org/blender/blender/issues/166210https://projects.blender.org/blender/blender/issues/166210
theoryshawhttps://github.com/theoryshaw
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Nov 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/10138#event-35298326455
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10138
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/10138
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.