Comments (9)
I'm also open to just using this and then opening up a more minor memory leak bug which I'm sure is sitting around somewhere in this hack and then just move on.
from notion.
apparently only you have the privilege of closing. Feel free to do that now that we have documented and opened up the more major and now less visible issue.
from notion.
I didn't catch the stacktrace but I confirm it crashed :(
Btw: the menuitem is called Untile
from notion.
This is super reproducible and I've been looking into it for a few days (I'm pretty lazy). The "bug" is in ops.c
FOR_ALL_MANAGED_BY_TILING(reg, tiling, tmp)
That for loop gets corrupted by this line:
reg2=group_do_attach(grp, ¶m, &data);
Which frees the tiling->managed_list object from underneath it and thus corrupts the pointers.
Here's a really reproducible version.
- do rm -fr ~/.notion
- start notion in the default tiled mode with 1 application window (such as xterm)
- right click on the title bar, go to "Tiling" => "Untile"
- enjoy your core.
Somehow the reparenting has to be done without the rug pull here. It has been there since at least 2014. I didn't follow the full path down though. I could bisect it if we really care.
ops.c may not be the fix point, it's just the first common parent between the defect and crash.
Here's some more details:
(gdb) b ops.c:135
(gdb) c
(gdb) watch tiling->managed_list
(gdb) c
Notice how you'll get something like this:
#0 0x000055cd3c8e4e0a in free_node (ptrlist=0x55cd3dfdb2d0, node=0x55cd3e055210) at ptrlist.c:19
#1 0x000055cd3c8e53a0 in ptrlist_remove (ptrlist=0x55cd3dfdb2d0, ptr=0x55cd3df85180) at ptrlist.c:121
#2 0x00007f2656a257e1 in tiling_do_managed_remove (ws=0x55cd3dfdb210, reg=0x55cd3df85180) at tiling.c:673
#3 0x00007f2656a258f8 in tiling_managed_remove (ws=0x55cd3dfdb210, reg=0x55cd3df85180) at tiling.c:697
#4 0x000055cd3c8b33fe in region_managed_remove (mgr=0x55cd3dfdb210, reg=0x55cd3df85180) at region.c:234
#5 0x000055cd3c8b3b39 in region_detach_manager (reg=0x55cd3df85180) at region.c:576
#6 0x000055cd3c8b5641 in doit_reparent (mgr=0x55cd3e056ba0, par=0x55cd3df455a0, fp=0x7ffe1f188240, cont=0x55cd3c8ce580 <group_do_attach_final>, cont_param=0x7ffe1f1882b0, reg=0x55cd3df85180) at attach.c:86
#7 0x000055cd3c8b58f2 in region_attach_helper (mgr=0x55cd3e056ba0, par=0x55cd3df455a0, fp=0x7ffe1f188240, fn=0x55cd3c8ce580 <group_do_attach_final>, fn_param=0x7ffe1f1882b0, data=0x7ffe1f188290) at attach.c:171
#8 0x000055cd3c8ce96f in group_do_attach (ws=0x55cd3e056ba0, param=0x7ffe1f1882b0, data=0x7ffe1f188290) at group.c:729
#9 0x00007f2656a31cfb in mod_tiling_untile (tiling=0x55cd3dfdb210) at ops.c:148
That's where your memory corruption occurs. I don't know enough about the mechanics here. Maybe a simple copy of the ptr list and then a freeing at the end of the loop would do it?
from notion.
back. did the git bisect. defect came in at 8d3f262, it's the rug pull as theorized. It's in tiling_managed_remove
right at splittree_remove
, author is @raboof .
I'll look into it more.
from notion.
Ouch, sorry about that. Before 8d3f262 that splittree_remove was already there, but perhaps triggered under different/fewer conditions. That if(!reused)
that got removed looks potentially relevant I guess...
I'll look into it more
Thanks!
from notion.
it's calling ptrlist_remove(&(ws->managed_list), reg);
in tiling_do_managed_remove
which we identified from above as the issue here.
Here's a really cheap solution
a/mod_tiling/ops.c b/mod_tiling/ops.c
index 0bd21912..bc5059d9 100644
--- a/mod_tiling/ops.c
+++ b/mod_tiling/ops.c
@@ -147,13 +147,20 @@ bool mod_tiling_untile(WTiling *tiling)
reg2=group_do_attach(grp, ¶m, &data);
+ // See #334: tiling->unsplit from the context menu crashes notion
+ if(tiling->managed_list == NULL) {
+ break;
+ }
+
if(reg2==NULL)
warn(TR("Unable to move a region from tiling to group."));
}
tiling->batchop=FALSE;
- region_dispose((WRegion*)tiling);
+ if(tiling->managed_list != NULL) {
+ region_dispose((WRegion*)tiling);
+ }
return TRUE;
}
we can probably do better than that
from notion.
I merged #357 - do you want to keep this issue open to keep looking for a clearer solution or rather close it?
from notion.
no ... let me handle that
from notion.
Related Issues (20)
- OpenSnitch prompt not nicely positioned
- compile error - libtu/locale.h:20:10: fatal error: 'libintl.h' file not found HOT 7
- Fresh install startup errors "Could not convert keysym to keycode" HOT 14
- How to change tiled-alt config? HOT 1
- Hide scratchpad when switching window to full-screen HOT 8
- __pthread_tpp_change_priority: Assertion failed HOT 10
- mod_dock: width of the *dock* area HOT 8
- EXTRA_LIBS doesn't work anymore HOT 14
- mod_notionflux: fchmod of socket always fails on FreeBSD HOT 2
- mod_xkb/xkbion: Per-window num/caps/scroll-lock?
- What exactly is mod_mgmtmode? HOT 1
- A more proper fix for the tiling->unsplit bug (#334)
- Strange behavior with Ghidra HOT 3
- Kludges for Gimp dialogs suggestions needed HOT 1
- Layout is not being saved HOT 3
- [notionwm.net] Links to Arch and Nix packages broken HOT 1
- What determines if a look is hidpi? HOT 1
- ioncore.goto_next directionals not really working in floating
- Clients mapped in fullscreen state get additional WGroupCW when switched to windowed state
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notion.