{"id":1253,"date":"2008-11-08T08:50:36","date_gmt":"2008-11-07T22:50:36","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=1253"},"modified":"2009-02-21T13:34:45","modified_gmt":"2009-02-21T03:34:45","slug":"libmallocfail","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2008\/11\/08\/libmallocfail\/","title":{"rendered":"libmallocfail"},"content":{"rendered":"<p><a href=\"https:\/\/code.launchpad.net\/libmallocfail\">Bazaar branches of libmallocfail<\/a><\/p>\n<p>Simple LD_PRELOAD library that will take parameters via environment variables and cause malloc() to occationally fail.<\/p>\n<p>Aim was to use this to test bits of MySQL\/Drizzle although since their libtool based stuf, the binary in tree is a libtool shell script, and I haven&#8217;t found a way to LD_PRELOAD only for mysqld and not the shell script and the other processes spawned by it.<\/p>\n<p>I have found a bug in libc though :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bazaar branches of libmallocfail Simple LD_PRELOAD library that will take parameters via environment variables and cause malloc() to occationally fail. Aim was to use this to test bits of MySQL\/Drizzle although since their libtool based stuf, the binary in tree &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2008\/11\/08\/libmallocfail\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[76,75,14],"tags":[633,48],"class_list":["post-1253","post","type-post","status-publish","format-standard","hentry","category-code","category-drizzle-work-et-al","category-mysql","tag-code","tag-fail"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-kd","jetpack-related-posts":[{"id":2289,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/02\/08\/timing-queries-in-the-21st-century-with-ld_preload-and-sed\/","url_meta":{"origin":1253,"position":0},"title":"Timing queries in the 21st century (with LD_PRELOAD and sed)","author":"Stewart Smith","date":"2011-02-08","format":false,"excerpt":"So... Baron blogged about wanting higher precision timers from the mysql binary and that running sed on the binary wasn't cutting it. However... I am not one to give up that easily! This is what LD_PRELOAD was made for! Evil nasty hacks to make your life easier! By looking at\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1395,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/02\/12\/performance-schema-show-me-the-code\/","url_meta":{"origin":1253,"position":1},"title":"Performance Schema: Show me the code","author":"Stewart Smith","date":"2009-02-12","format":false,"excerpt":"For such a long worked on feature, with such potential - I find the resistence to publishing a source tree curious (my comments on the topic have been moderated away but others have asked too). I could go and grep through the commits list searching for things (hint: look for\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":706,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/05\/31\/davem-on-ingos-smp-lock-validator\/","url_meta":{"origin":1253,"position":2},"title":"DaveM on Ingo&#8217;s SMP lock validator","author":"Stewart Smith","date":"2006-05-31","format":false,"excerpt":"DaveM talks about Ingo's new SMP lock validator for linux kernel A note reminding me to go take a look and see what can be ripped out and placed into various bits of MySQL and NDB. Ideally, of course, it could be turned into a LD_PRELOAD for pthread mutexes. Anybody\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1587,"url":"https:\/\/www.flamingspork.com\/blog\/2009\/04\/08\/using-dtrace-to-find-out-why-solaris-is-so-slow-and-if-its-actually-solaris\/","url_meta":{"origin":1253,"position":3},"title":"Using Dtrace to find out if the hardware or Solaris is slow (but really just working around the problem)","author":"Stewart Smith","date":"2009-04-08","format":false,"excerpt":"A little while ago, I was the brave soul tasked with making sure Drizzle was working properly and passing all tests on Solaris and OpenSolaris. Brian recently blogged about some of the advantages of also running on Solaris and the SunStudio compilers - more warnings from the compiler is a\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":939,"url":"https:\/\/www.flamingspork.com\/blog\/2007\/11\/27\/libeatmydata\/","url_meta":{"origin":1253,"position":4},"title":"libeatmydata","author":"Stewart Smith","date":"2007-11-27","format":false,"excerpt":"Following my successful linux.conf.au talk \"Eat My Data: How Everybody Gets POSIX File I\/O Wrong\", I started to feel the need to easily be able to have my data eaten. Okay, not quite. However, when you've written your software properly, so it uses fsync() correctly, opening files with O_SYNC or\u2026","rel":"","context":"In &quot;life, the universe and everything&quot;","block_context":{"text":"life, the universe and everything","link":"https:\/\/www.flamingspork.com\/blog\/category\/life-the-universe-and-everything\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1928,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/05\/25\/nocache-ld_preload\/","url_meta":{"origin":1253,"position":5},"title":"nocache LD_PRELOAD","author":"Stewart Smith","date":"2010-05-25","format":false,"excerpt":"Want to do something like \"cp big_file copy_of_big_file\" or \"tar xfz big_tarball.tar.gz\" but without thrashing your cache? Enrico Zini has a nice little LD_PRELOAD called nocache. $ nocache tar xfz foo.tar.gz Goes well with libeatmydata. A pair of tools for compensating for your Operating System casually hating you. I imagine\u2026","rel":"","context":"In &quot;General&quot;","block_context":{"text":"General","link":"https:\/\/www.flamingspork.com\/blog\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":2,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"predecessor-version":[{"id":1456,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1253\/revisions\/1456"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}