Tag / bug fixing

  • I want to use this short article to point out a big problem in code that uses libdrm. This, or a variant of this, is lurking in a shocking amount of software:

    Stop doing this, it has always been a crash waiting to happen. drmEventContext is part of libdrm’s ABI and there are strict promises that the structure won’t be randomly re-ordered. However, it may grow as the need arises when new versions of libdrm offer functionality which didn’t exist before. libdrm 2.4.78 introduces another page flip handler, adding a new function pointer harmlessly at the end of the structure page_flip_handler2. It also bumps DRM_EVENT_CONTEXT_VERSION from 2 to 3, as that’s the current version of the structure in the header file. As a result, the code above crashes… sometimes. What went wrong? The Proper Way to Use drmEventContext DrmEventContext.version is intended to tell the library what version of the […]

    Read More
  • August 26, 2016 - Tom Hacohen

    Hunting Down Dirty Memory Pages

    I recently had to debug a complex issue with memory page usage in EFL; you will likely never encounter this issue because it’s only relevant for shared libraries developers, and even then, not always. However, I think I think it is beneficial for everyone to be familiar with how things work at a lower level, so I decided to write this post. A few weeks ago I got a report about an increase in private dirty pages from our libraries that essentially caused increased memory consumption for every application linking to EFL. The main culprit was the object system (Eo), which I maintain, so I decided to take a look. For my first step I performed a manual review which led me to a mistake in related code that I eventually fixed. My fix improved the situation a bit, but the dirty page issue was mostly unchanged, so I investigated […]

    Read More