You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Shubhangi Garg (JIRA)" <ji...@apache.org> on 2013/02/04 13:24:12 UTC
[jira] [Updated] (HDFS-4467) Segmentation fault in libhdfs while
connecting to HDFS in an application populating Hive Tables
[ https://issues.apache.org/jira/browse/HDFS-4467?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shubhangi Garg updated HDFS-4467:
---------------------------------
Summary: Segmentation fault in libhdfs while connecting to HDFS in an application populating Hive Tables (was: Segmentation fault in libhdfs while connecting to HDFS in an application running a Hive Query)
> Segmentation fault in libhdfs while connecting to HDFS in an application populating Hive Tables
> ------------------------------------------------------------------------------------------------
>
> Key: HDFS-4467
> URL: https://issues.apache.org/jira/browse/HDFS-4467
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: libhdfs
> Affects Versions: 1.0.4
> Environment: Ubuntu 12.04 (32 bit), application in C++, hadoop 1.0.4
> Reporter: Shubhangi Garg
>
> Connecting to HDFS using the libhdfs compiled library gives a segmentation vault and memory leaks; easily verifiable by valgrind.
> Even a simple application program given below has memory leaks:
> #include "hdfs.h"
> #include <iostream>
> int main(int argc, char **argv) {
> hdfsFS fs = hdfsConnect("localhost", 9000);
> const char* writePath = "/tmp/testfile.txt";
> hdfsFile writeFile = hdfsOpenFile(fs, writePath, O_WRONLY|O_CREAT, 0, 0, 0);
> if(!writeFile) {
> fprintf(stderr, "Failed to open %s for writing!\n", writePath);
> exit(-1);
> }
> char* buffer = "Hello, World!";
> tSize num_written_bytes = hdfsWrite(fs, writeFile, (void*)buffer, strlen(buffer)+1);
> if (hdfsFlush(fs, writeFile)) {
> fprintf(stderr, "Failed to 'flush' %s\n", writePath);
> exit(-1);
> }
> hdfsCloseFile(fs, writeFile);
> }
> shell>valgrind --leak-check=full ./sample
> ==12773== LEAK SUMMARY:
> ==12773== definitely lost: 7,893 bytes in 21 blocks
> ==12773== indirectly lost: 4,460 bytes in 23 blocks
> ==12773== possibly lost: 119,833 bytes in 121 blocks
> ==12773== still reachable: 1,349,514 bytes in 8,953 blocks
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira