bakkeby / dmenu-flexipatch

A dmenu build with preprocessor directives to decide which patches to include during build time
MIT License
183 stars 78 forks source link

XResources Patch - munmap_chunck(): Invalid Pointer #2

Closed Kemmojo closed 3 years ago

Kemmojo commented 3 years ago

Hey bakkeby. Actually i don´t think this is bug, but it comes down to asking if xresources is initialized or not.

The Issue: If you have the XRESOURCES Patch activated and you run dmenu without ever ( in the current X session ) having called xrdb with a corresponding .xresources, you get an munmap_chunck(): Invalid Pointer and dmenu stops running.

EDIT: .xresource file can be totally empty or have everything commented.

Can you confirm this?

Maybe i´m totally misunderstanding something in case there is a reason behind this situation.

Have a good one.

bakkeby commented 3 years ago

Right, so to replicate all you need to do is to do this:

$ xrdb -remove
$ ls | dmenu
bakkeby commented 3 years ago

I don't really understand why exactly, but when xresources are not available the freeing of the fonts and colors is what is causing the munmap_chunk() error.

Without attempting to free the data it works just fine.

As the extra memory consumption, if any, likely doesn't make a world of difference I figure we can just leave these out.

Kemmojo commented 3 years ago

Mmh, I'm curious about what happened here. Unfortunately i´m not a c programmer, so can´t really help you here.

But thanks, that acutally solved the issue for me. Closing.