{"id":63,"date":"2009-03-08T02:13:10","date_gmt":"2009-03-08T10:13:10","guid":{"rendered":"http:\/\/blog.danielparnell.com\/?p=63"},"modified":"2009-03-08T02:27:27","modified_gmt":"2009-03-08T10:27:27","slug":"freetds-and-my-new-mac-pro","status":"publish","type":"post","link":"https:\/\/blog.danielparnell.com\/?p=63","title":{"rendered":"FreeTDS and my new Mac Pro"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\" style=\"word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; \">I&#8217;ve been having some &#8220;fun&#8221; with my new Mac Pro. &nbsp;In order for me to be able to use it for my daily work I need to be able to connect to a Microsoft SQL Server instance from the Rails app I&#8217;m working on at my day job. &nbsp;Normally this is just a simple matter of installing FreeTDS, Ruby-ODBC and the Ruby DBI and DBD packages. &nbsp;When I did this, as soon as I tried to make a connection to the SQL Server instance my application would crash with a bus error! &nbsp;After a bit of digging around with gdb I discovered that the application was crashing when FreeTDS was trying to deallocate a string using the standard C library memory function <b>free<\/b>. &nbsp;The really weird thing is that the string was pointing to a valid string. &nbsp;I dug a little further and found that if I changed the code that was allocating the string to use <b>malloc<\/b> and <b>strcpy<\/b> instead of <b>strdup<\/b> it worked! &nbsp;If anybody out there knows why this might make a difference I&#8217;d really like to hear from them about it.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been having some &#8220;fun&#8221; with my new Mac Pro. &nbsp;In order for me to be able to use it for my daily work I need to be able to connect to a Microsoft SQL Server instance from the Rails app I&#8217;m working on at my day job. &nbsp;Normally this is just a simple matter &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.danielparnell.com\/?p=63\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;FreeTDS and my new Mac Pro&#8221;<\/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":[3,2,12,36],"tags":[],"class_list":["post-63","post","type-post","status-publish","format-standard","hentry","category-mac-os-x","category-programming","category-ruby","category-sql-server","entry"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p561S3-11","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/posts\/63","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=63"}],"version-history":[{"count":1,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=\/wp\/v2\/posts\/63\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=63"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=63"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.danielparnell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=63"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}