Debarshi's den

Archive for the ‘C’ Category

MALLOC_PERTURB_

with 4 comments

MALLOC_PERTURB_ is a useful thing. If you are developing on glibc-based systems, I encourage you to put this snippet in your ~/.bash_profile:

MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
export MALLOC_PERTURB_

I have been using it for the last six years on all my computers (3 laptops running every Fedora x86_64 build released since then), and while things haven’t exploded, it has helped uncover the odd bug every once in a while. One such occasion presented itself this week.

I was busy following Ondrej’s hint, debugging why Eye of GNOME was taking so long to open a file from ownCloud. Imagine my shock when it would just crash after showing the window. The same optimization was working just fine on the gnome-3-18 branch, while master was crashing even without any changes. How could that happen? Obviously, while it was failing for me, it was working fine for all those who run unstable GNOME versions via jhbuild, gnome-continous, Fedora rawhide, etc.. Otherwise we would have been debugging this crash, and not a performance issue.

I guess, most of them didn’t have MALLOC_PERTURB_.

Here is another such story.

In case you were wondering, there is already an update on its way to Fedora 24 address the crash.

Written by Debarshi Ray

9 April, 2016 at 02:28

The goats have strayed into GNOME

with 3 comments

Here is a glimpse of what I have been doing lately.

gnome-photos-editing-crop

gnome-photos-editing-filters

The screenshots feature the photo please wait… by Garrett LeSage available under a Creative Commons Attribution-ShareAlike license.

Written by Debarshi Ray

27 November, 2015 at 20:28

Posted in Blogroll, C, Fedora, GNOME, Photos

RIP DMR

with 3 comments

The first thing I came to know (from Ashish) when I woke up this morning was that Dennis MacAlistair Ritchie had passed away. Not an untimely death, I suppose, but still, a very sad day. He will be missed.

Photograph taken from Wikipedia: http://en.wikipedia.org/wiki/File:Dennis_MacAlistair_Ritchie_.jpg

Written by Debarshi Ray

13 October, 2011 at 11:12

Posted in C, UNIX

C: passing a char ** to a const char **

leave a comment »

This is meant as some sort of note to myself, but someone might find it useful.

In short, the ISO C standard does not allow assigning a char ** to const char **. Here is why.

Many thanks to Olivier Gay for the link.

Written by Debarshi Ray

5 May, 2011 at 23:40

Posted in C

Follow

Get every new post delivered to your Inbox.

Join 31 other followers