hzheng created HDFS-10670:
-----------------------------

             Summary: memory leak in libhdfs
                 Key: HDFS-10670
                 URL: https://issues.apache.org/jira/browse/HDFS-10670
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: hdfs-client
    Affects Versions: 2.7.2, 2.4.1
         Environment: Linux debian 2.6.32-5-686 #1 SMP Thu Nov 3 04:23:54 UTC 
2011 i686 GNU/Linux

            Reporter: hzheng
            Priority: Critical


I tested the two versions(v2.7.2 & v2.4.1) of libhdfs by running the testcase 
"native/libhdfs/test_libhdfs_ops", and notice that the memory((e.g. VIRT, SWAP, 
DATA) usage is increasing as following:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  P SWAP CODE DATA 
WCHAN     COMMAND 
31982 sr_cloud  20   0  707m 120m  17m R 38.8 11.9   0:38.29 0 587m   52 683m - 
        test_libhdfs_op                     
31982 sr_cloud  20   0  714m 137m  17m R 41.2 13.6  35:26.91 0 577m   52 691m - 
        test_libhdfs_op
31982 sr_cloud  20   0 4152m 150m  17m R 12.5 14.9  12:07.47 0 3.9g   52 4.0g - 
        test_libhdfs_op 
31982 sr_cloud  20   0 4371m 151m  17m S 11.6 15.0  12:51.89 0 4.1g   52 4.2g - 
        test_libhdfs_op                     
31982 sr_cloud  20   0 4544m 152m  17m S 11.9 15.1  13:39.90 0 4.3g   52 4.4g - 
        test_libhdfs_op                   
31982 sr_cloud  20   0 6133m 160m  17m S 12.2 15.9  19:49.12 0 5.8g   52 6.0g - 
        test_libhdfs_op
31982 sr_cloud  20   0 9549m 175m  17m D 11.6 17.3  31:49.69 0 9.2g   52 9.3g - 
        test_libhdfs_op 

=========================================================================================================================================================
And then the following strings are outputted to the screen:

Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.
Java HotSpot(TM) Server VM warning: Attempt to allocate stack guard pages 
failed.

===============================================================================================================================================================
I suspect there is a memory leak, but I can't find any exceptions on the output 
of jstat, it looks that the Garbage collection works well.

sr_cloud@debian:~/dist/log$ jstat -gcutil 31982 1000  1000
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
  0.00   8.05  86.50   9.00  59.58   1157   37.342     7    2.077   39.419
  0.00   8.05  92.17   9.00  59.58   1157   37.342     7    2.077   39.419
  0.00   8.05  97.78   9.00  59.58   1157   37.342     7    2.077   39.419
  8.13   0.00   4.04   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  11.16   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  18.13   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  23.69   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  30.81   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  35.80   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  37.11   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  40.25   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  43.59   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  48.72   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  56.26   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  61.03   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  63.94   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  68.30   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  72.66   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  76.76   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  80.36   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  84.98   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  89.34   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  92.99   9.02  59.58   1158   37.379     7    2.077   39.456
  8.13   0.00  97.03   9.02  59.58   1158   37.379     7    2.077   39.456
  0.00   8.10   0.92   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10   4.59   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10   8.82   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10  12.56   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10  17.62   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10  22.12   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10  25.18   9.04  59.58   1159   37.420     7    2.077   39.497
  0.00   8.10  29.38   9.04  59.58   1159   37.420     7    2.077   39.497

================================================================================================================================================================
The hs_err logs as following:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 338056 bytes for 
Chunk::new
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (allocation.cpp:328), pid=28314, tid=2863938416
#
# JRE version: 7.0_25-b15
# Java VM: Java HotSpot(TM) Server VM (23.25-b01 mixed mode linux-x86 )
# Core dump written. Default location: 
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/libhdfs/core or core.28314
#

---------------  T H R E A D  ---------------

Current thread (0x082c5800):  JavaThread "C2 CompilerThread0" daemon 
[_thread_in_native, id=28321, stack(0xaaac3000,0xaab44000)]

Stack: [0xaaac3000,0xaab44000],  sp=0xaab41910,  free space=506k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x71ca19]  VMError::report_and_die()+0x199
V  [libjvm.so+0x2e5372]  report_vm_out_of_memory(char const*, int, unsigned 
int, char const*)+0x72
V  [libjvm.so+0x14c0c8]  Chunk::operator new(unsigned int, 
AllocFailStrategy::AllocFailEnum, unsigned int)+0x128
V  [libjvm.so+0x14c10c]  Arena::grow(unsigned int, 
AllocFailStrategy::AllocFailEnum)+0x2c
V  [libjvm.so+0x3d208a]  PhaseIFG::init(unsigned int)+0x1ca
V  [libjvm.so+0x2346df]  PhaseChaitin::Register_Allocate()+0x33f
V  [libjvm.so+0x29ef09]  Compile::Code_Gen()+0x399
V  [libjvm.so+0x2a1788]  Compile::Compile(ciEnv*, C2Compiler*, ciMethod*, int, 
bool, bool)+0xbc8
V  [libjvm.so+0x21d6b6]  C2Compiler::compile_method(ciEnv*, ciMethod*, 
int)+0x176
V  [libjvm.so+0x2a649a]  
CompileBroker::invoke_compiler_on_method(CompileTask*)+0x33a
V  [libjvm.so+0x2a7567]  CompileBroker::compiler_thread_loop()+0x417
V  [libjvm.so+0x6d8618]  compiler_thread_entry(JavaThread*, Thread*)+0x18
V  [libjvm.so+0x6df1d4]  JavaThread::thread_main_inner()+0xf4
V  [libjvm.so+0x6df361]  JavaThread::run()+0x161
V  [libjvm.so+0x5dc401]  java_start(Thread*)+0x111
C  [libpthread.so.0+0x5955]  start_thread+0xb5


Current CompileTask:
C2: 466808  428   !         org.apache.hadoop.fs.RawLocalFileSystem::listStatus 
(191 bytes)


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x085fa400 JavaThread "Thread-10253" [_thread_in_native, id=16823, 
stack(0xa975e000,0xa97af000)]
  0x08396800 JavaThread "process reaper" daemon [_thread_in_native, id=16059, 
stack(0xaa300000,0xaa311000)]
  0x08410000 JavaThread "RMI TCP Connection(idle)" daemon [_thread_blocked, 
id=31139, stack(0xa97af000,0xa9800000)]
  0x08743800 JavaThread "RMI TCP Connection(idle)" daemon [_thread_blocked, 
id=31080, stack(0xa9e0b000,0xa9e5c000)]
  0x08316400 JavaThread "RMI Scheduler(0)" daemon [_thread_blocked, id=30482, 
stack(0xa9ead000,0xa9efe000)]
  0x08311c00 JavaThread "RMI TCP Connection(idle)" daemon [_thread_blocked, 
id=30481, stack(0xaa03b000,0xaa08c000)]
  0x08686000 JavaThread "RMI TCP Connection(idle)" daemon [_thread_blocked, 
id=30478, stack(0xaa08c000,0xaa0dd000)]
  0xa9fa6000 JavaThread "process reaper" daemon [_thread_blocked, id=28329, 
stack(0xaa318000,0xaa329000)]
  0xaa229000 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=28326, 
stack(0xaa15e000,0xaa1af000)]
  0xaa217000 JavaThread "RMI TCP Accept-9999" daemon [_thread_in_native, 
id=28325, stack(0xaa1af000,0xaa200000)]
  0xaa4fbc00 JavaThread "RMI TCP Accept-0" daemon [_thread_in_native, id=28324, 
stack(0xaa329000,0xaa37a000)]
  0x082d2000 JavaThread "Service Thread" daemon [_thread_blocked, id=28323, 
stack(0xaa9f1000,0xaaa42000)]
  0x082c7400 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=28322, 
stack(0xaaa42000,0xaaac3000)]
=>0x082c5800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, 
id=28321, stack(0xaaac3000,0xaab44000)]
  0x082c4000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=28320, 
stack(0xaab44000,0xaab95000)]
  0x082c2400 JavaThread "Surrogate Locker Thread (Concurrent GC)" daemon 
[_thread_blocked, id=28319, stack(0xaab95000,0xaabe6000)]
  0x08283800 JavaThread "Finalizer" daemon [_thread_blocked, id=28318, 
stack(0xaade6000,0xaae37000)]
  0x08281c00 JavaThread "Reference Handler" daemon [_thread_blocked, id=28317, 
stack(0xaae37000,0xaae88000)]
  0x081f2800 JavaThread "main" [_thread_in_native, id=28314, 
stack(0xbfbce000,0xbfc1e000)]

Other Threads:
  0x0827c000 VMThread [stack: 0xaae88000,0xaaf09000] [id=28316]
  0xaa22a800 WatcherThread [stack: 0xaa0dd000,0xaa15e000] [id=28327]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 19648K, used 2808K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,  14% used [0xab980000, 0xabbfcb50, 0xaca90000)
  from space 2176K,  12% used [0xaca90000, 0xacad1520, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 6104K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)

Card table byte_map: [0xab93f000,0xab980000] byte_map_base: 0xab3e2400

Polling page: 0xb6c61000

Code Cache  [0xb3a42000, 0xb3c82000, 0xb6a42000)
 total_blobs=592 nmethods=424 adapters=120 free_code_cache=47740Kb 
largest_free_block=48858304

Compilation events (10 events):
Event: 377.336 Thread 0x082c5800 nmethod 424 0xb3b92bc8 code [0xb3b92d00, 
0xb3b9315c]
Event: 416.225 Thread 0x082c7400  425             
java.io.UnixFileSystem::parentOrNull (118 bytes)
Event: 416.257 Thread 0x082c7400 nmethod 425 0xb3b96d08 code [0xb3b96e20, 
0xb3b97330]
Event: 416.347 Thread 0x082c5800  426             
sun.reflect.ClassFileAssembler::append (30 bytes)
Event: 416.359 Thread 0x082c5800 nmethod 426 0xb3b9f988 code [0xb3b9fac0, 
0xb3b9fd24]
Event: 438.538 Thread 0x082c7400  427             
org.apache.hadoop.fs.FileSystem::listStatus (84 bytes)
Event: 438.609 Thread 0x082c7400 nmethod 427 0xb3ba0548 code [0xb3ba0700, 
0xb3ba0dc4]
Event: 443.069 Thread 0x082c5800  428   !         
org.apache.hadoop.fs.RawLocalFileSystem::listStatus (191 bytes)
Event: 443.084 Thread 0x082c7400  429             
org.apache.hadoop.conf.Configuration::get (64 bytes)
Event: 443.196 Thread 0x082c7400 nmethod 429 0xb3ba8748 code [0xb3ba88e0, 
0xb3ba92e4]

GC Heap History (10 events):
Event: 404.261 GC heap before
{Heap before GC invocations=83 (full 0):
 def new generation   total 19648K, used 17825K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K, 100% used [0xab980000, 0xaca90000, 0xaca90000)
  from space 2176K,  16% used [0xaccb0000, 0xacd08670, 0xaced0000)
  to   space 2176K,   0% used [0xaca90000, 0xaca90000, 0xaccb0000)
 concurrent mark-sweep generation total 43712K, used 5881K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13658K [0xaf980000, 
0xb0980000, 0xb3980000)
Event: 404.277 GC heap after
Heap after GC invocations=84 (full 0):
 def new generation   total 19648K, used 353K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,   0% used [0xab980000, 0xab980000, 0xaca90000)
  from space 2176K,  16% used [0xaca90000, 0xacae85d8, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 5903K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13658K [0xaf980000, 
0xb0980000, 0xb3980000)
}
Event: 412.332 GC heap before
{Heap before GC invocations=84 (full 0):
 def new generation   total 19648K, used 17825K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K, 100% used [0xab980000, 0xaca90000, 0xaca90000)
  from space 2176K,  16% used [0xaca90000, 0xacae85d8, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 5903K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13659K [0xaf980000, 
0xb0980000, 0xb3980000)
Event: 412.366 GC heap after
Heap after GC invocations=85 (full 0):
 def new generation   total 19648K, used 336K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,   0% used [0xab980000, 0xab980000, 0xaca90000)
  from space 2176K,  15% used [0xaccb0000, 0xacd041d8, 0xaced0000)
  to   space 2176K,   0% used [0xaca90000, 0xaca90000, 0xaccb0000)
 concurrent mark-sweep generation total 43712K, used 5943K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13659K [0xaf980000, 
0xb0980000, 0xb3980000)
}
Event: 421.206 GC heap before
{Heap before GC invocations=85 (full 0):
 def new generation   total 19648K, used 17808K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K, 100% used [0xab980000, 0xaca90000, 0xaca90000)
  from space 2176K,  15% used [0xaccb0000, 0xacd041d8, 0xaced0000)
  to   space 2176K,   0% used [0xaca90000, 0xaca90000, 0xaccb0000)
 concurrent mark-sweep generation total 43712K, used 5943K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
Event: 421.228 GC heap after
Heap after GC invocations=86 (full 0):
 def new generation   total 19648K, used 330K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,   0% used [0xab980000, 0xab980000, 0xaca90000)
  from space 2176K,  15% used [0xaca90000, 0xacae2bf8, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 6004K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
}
Event: 430.812 GC heap before
{Heap before GC invocations=86 (full 0):
 def new generation   total 19648K, used 17802K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K, 100% used [0xab980000, 0xaca90000, 0xaca90000)
  from space 2176K,  15% used [0xaca90000, 0xacae2bf8, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 6004K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
Event: 430.834 GC heap after
Heap after GC invocations=87 (full 0):
 def new generation   total 19648K, used 236K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,   0% used [0xab980000, 0xab980000, 0xaca90000)
  from space 2176K,  10% used [0xaccb0000, 0xacceb358, 0xaced0000)
  to   space 2176K,   0% used [0xaca90000, 0xaca90000, 0xaccb0000)
 concurrent mark-sweep generation total 43712K, used 6024K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
}
Event: 439.880 GC heap before
{Heap before GC invocations=87 (full 0):
 def new generation   total 19648K, used 17708K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K, 100% used [0xab980000, 0xaca90000, 0xaca90000)
  from space 2176K,  10% used [0xaccb0000, 0xacceb358, 0xaced0000)
  to   space 2176K,   0% used [0xaca90000, 0xaca90000, 0xaccb0000)
 concurrent mark-sweep generation total 43712K, used 6024K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
Event: 439.890 GC heap after
Heap after GC invocations=88 (full 0):
 def new generation   total 19648K, used 210K [0xab980000, 0xaced0000, 
0xaced0000)
  eden space 17472K,   0% used [0xab980000, 0xab980000, 0xaca90000)
  from space 2176K,   9% used [0xaca90000, 0xacac4ac0, 0xaccb0000)
  to   space 2176K,   0% used [0xaccb0000, 0xaccb0000, 0xaced0000)
 concurrent mark-sweep generation total 43712K, used 6059K [0xaced0000, 
0xaf980000, 0xaf980000)
 concurrent-mark-sweep perm gen total 16384K, used 13678K [0xaf980000, 
0xb0980000, 0xb3980000)
}

Deoptimization events (10 events):
Event: 337.148 Thread 0x08686000 Uncommon trap -83 fr.pc 0xb3b7cab8
Event: 356.377 Thread 0xaa4fbc00 Uncommon trap -83 fr.pc 0xb3ae329c
Event: 396.364 Thread 0xaa4fbc00 Uncommon trap -58 fr.pc 0xb3b93020
Event: 398.369 Thread 0xaa4fbc00 Uncommon trap -58 fr.pc 0xb3b93020
Event: 412.385 Thread 0xaa4fbc00 Uncommon trap -58 fr.pc 0xb3b93020
Event: 412.400 Thread 0xaa4fbc00 Uncommon trap -58 fr.pc 0xb3b93020
Event: 412.404 Thread 0x08686000 Uncommon trap -83 fr.pc 0xb3b85324
Event: 412.435 Thread 0x08410000 Uncommon trap -12 fr.pc 0xb3b3a614
Event: 412.464 Thread 0x08743800 Uncommon trap 232 fr.pc 0xb3b85ee0
Event: 412.491 Thread 0x08743800 Uncommon trap -83 fr.pc 0xb3b73334

Internal exceptions (10 events):
Event: 412.400 Thread 0xaa4fbc00 Threw 0xab9960e8 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jvm.cpp:2768
Event: 412.401 Thread 0xaa4fbc00 Threw 0xab9a2190 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jni.cpp:742
Event: 412.401 Thread 0xaa4fbc00 Threw 0xab9a2190 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jvm.cpp:1239
Event: 412.401 Thread 0xaa4fbc00 Threw 0xab9a2190 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jvm.cpp:1239
Event: 412.404 Thread 0x08686000 Implicit null exception at 0xb3b820ff to 
0xb3b852f5
Event: 412.435 Thread 0x08410000 Implicit null exception at 0xb3b3a2c8 to 
0xb3b3a609
Event: 412.463 Thread 0x08743800 Threw 0xab9906a0 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jni.cpp:742
Event: 412.463 Thread 0x08743800 Threw 0xab9906a0 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jvm.cpp:1239
Event: 412.464 Thread 0x08743800 Threw 0xab9906a0 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jvm.cpp:1239
Event: 412.492 Thread 0x08743800 Threw 0xab9cda80 at 
/HUDSON/workspace/jdk7u25-2-build-linux-i586-product/jdk7u25/hotspot/src/share/vm/prims/jni.cpp:1631

Events (10 events):
Event: 443.477 Thread 0x08736c00 Thread exited: 0x08736c00
Event: 443.502 Thread 0x085fa400 Thread added: 0x085fa400
Event: 443.579 Thread 0x085fa400 Thread exited: 0x085fa400
Event: 443.636 Thread 0x085fa400 Thread added: 0x085fa400
Event: 443.711 Thread 0x085fa400 Thread exited: 0x085fa400
Event: 443.731 Thread 0x085fa400 Thread added: 0x085fa400
Event: 443.814 Thread 0x085fa400 Thread exited: 0x085fa400
Event: 443.830 Thread 0x085fa400 Thread added: 0x085fa400
Event: 443.911 Thread 0x085fa400 Thread exited: 0x085fa400
Event: 443.930 Thread 0x085fa400 Thread added: 0x085fa400


Dynamic libraries:
08048000-08056000 r-xp 00000000 08:01 1343661    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/libhdfs/test_libhdfs_ops
08056000-08057000 rw-p 0000d000 08:01 1343661    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/libhdfs/test_libhdfs_ops
081e7000-0892c000 rw-p 00000000 00:00 0          [heap]
a9600000-a9700000 rw-p 00000000 00:00 0 
a9761000-a97af000 rw-p 00000000 00:00 0 
a97af000-a97b2000 ---p 00000000 00:00 0 
a97b2000-a9800000 rw-p 00000000 00:00 0 
a9800000-a98fe000 rw-p 00000000 00:00 0 
a98fe000-a9900000 ---p 00000000 00:00 0 
a9900000-a99fc000 rw-p 00000000 00:00 0 
a99fc000-a9a00000 ---p 00000000 00:00 0 
a9a00000-a9af5000 rw-p 00000000 00:00 0 
a9af5000-a9b00000 ---p 00000000 00:00 0 
a9b00000-a9bfc000 rw-p 00000000 00:00 0 
a9bfc000-a9c00000 ---p 00000000 00:00 0 
a9c00000-a9d00000 rw-p 00000000 00:00 0 
a9d00000-a9de9000 rw-p 00000000 00:00 0 
a9de9000-a9e00000 ---p 00000000 00:00 0 
a9e0b000-a9e0e000 ---p 00000000 00:00 0 
a9e0e000-a9e5c000 rw-p 00000000 00:00 0 
a9e5f000-a9ead000 rw-p 00000000 00:00 0 
a9ead000-a9eb0000 ---p 00000000 00:00 0 
a9eb0000-a9efe000 rw-p 00000000 00:00 0 
a9efe000-a9eff000 r-xp 00000000 08:01 4519098    
/opt/jdk1.7.0_25/jre/lib/i386/libjaas_unix.so
a9eff000-a9f00000 rw-p 00000000 08:01 4519098    
/opt/jdk1.7.0_25/jre/lib/i386/libjaas_unix.so
a9f00000-a9ffa000 rw-p 00000000 00:00 0 
a9ffa000-aa000000 ---p 00000000 00:00 0 
aa03b000-aa03e000 ---p 00000000 00:00 0 
aa03e000-aa08c000 rw-p 00000000 00:00 0 
aa08c000-aa08f000 ---p 00000000 00:00 0 
aa08f000-aa0dd000 rw-p 00000000 00:00 0 
aa0dd000-aa0de000 ---p 00000000 00:00 0 
aa0de000-aa15e000 rw-p 00000000 00:00 0 
aa15e000-aa161000 ---p 00000000 00:00 0 
aa161000-aa1af000 rw-p 00000000 00:00 0 
aa1af000-aa1b2000 ---p 00000000 00:00 0 
aa1b2000-aa200000 rw-p 00000000 00:00 0 
aa200000-aa300000 rw-p 00000000 00:00 0 
aa303000-aa311000 rw-p 00000000 00:00 0 
aa311000-aa318000 r--s 00000000 08:01 4571321    
/usr/lib/gconv/gconv-modules.cache
aa318000-aa31b000 ---p 00000000 00:00 0 
aa31b000-aa329000 rw-p 00000000 00:00 0 
aa329000-aa32c000 ---p 00000000 00:00 0 
aa32c000-aa37a000 rw-p 00000000 00:00 0 
aa37a000-aa37e000 r--s 0008a000 08:01 3100374    
/opt/jdk1.7.0_25/jre/lib/jsse.jar
aa37e000-aa38a000 r--s 000b6000 08:01 2442177    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/zookeeper-3.4.6.jar
aa38a000-aa38e000 r--s 00014000 08:01 2596888    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/xz-1.0.jar
aa38e000-aa38f000 r--s 00003000 08:01 2442204    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/xmlenc-0.52.jar
aa38f000-aa397000 r--s 00028000 08:01 2442189    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/xml-apis-1.3.04.jar
aa397000-aa3af000 r--s 00115000 08:01 2442191    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/xercesImpl-2.9.1.jar
aa3af000-aa3cc000 r--s 00196000 08:01 2442239    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/netty-all-4.0.23.Final.jar
aa3cc000-aa3e3000 r--s 0010e000 08:01 2596905    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/netty-3.6.2.Final.jar
aa3e3000-aa400000 r--s 0013e000 08:01 2442160    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/mockito-all-1.8.5.jar
aa400000-aa500000 rw-p 00000000 00:00 0 
aa501000-aa502000 r-xp 00000000 08:01 4519087    
/opt/jdk1.7.0_25/jre/lib/i386/librmi.so
aa502000-aa503000 rw-p 00000000 08:01 4519087    
/opt/jdk1.7.0_25/jre/lib/i386/librmi.so
aa503000-aa507000 r--s 00037000 08:01 3959744    
/opt/jdk1.7.0_25/jre/lib/ext/sunpkcs11.jar
aa507000-aa509000 r--s 00019000 08:01 3100378    
/opt/jdk1.7.0_25/jre/lib/jce.jar
aa509000-aa50b000 r--s 00004000 08:01 2442192    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/stax-api-1.0-2.jar
aa50b000-aa50d000 r--s 000f2000 08:01 2596901    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/snappy-java-1.0.4.1.jar
aa50d000-aa50f000 r--s 00001000 08:01 2442161    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/slf4j-log4j12-1.7.10.jar
aa50f000-aa510000 r--s 00007000 08:01 2596895    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/slf4j-api-1.7.10.jar
aa510000-aa512000 r--s 00018000 08:01 2596904    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/servlet-api-2.5.jar
aa512000-aa51a000 r--s 0007b000 08:01 2442158    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/protobuf-java-2.5.0.jar
aa51a000-aa523000 r--s 0006f000 08:01 2442169    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/log4j-1.2.17.jar
aa523000-aa526000 r--s 000fd000 08:01 2442162    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/leveldbjni-all-1.8.jar
aa526000-aa52c000 r--s 00036000 08:01 2442210    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/junit-4.11.jar
aa52c000-aa52f000 r--s 00006000 08:01 2596899    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jsr305-3.0.0.jar
aa52f000-aa532000 r--s 00016000 08:01 2596891    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jsp-api-2.1.jar
aa532000-aa535000 r--s 0002b000 08:01 2442202    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jsch-0.1.42.jar
aa535000-aa539000 r--s 00028000 08:01 2596892    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jetty-util-6.1.26.jar
aa539000-aa540000 r--s 0007d000 08:01 1585087    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jetty-6.1.26.jar
aa540000-aa542000 r--s 0000f000 08:01 2596886    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jettison-1.1.jar
aa542000-aa54b000 r--s 0007b000 08:01 2442214    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jets3t-0.9.0.jar
aa54b000-aa55d000 r--s 0009d000 08:01 2596894    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jersey-server-1.9.jar
aa55d000-aa561000 r--s 00021000 08:01 2596896    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jersey-json-1.9.jar
aa561000-aa56b000 r--s 00066000 08:01 2442166    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jersey-core-1.9.jar
aa56b000-aa57e000 r--s 000c7000 08:01 2442219    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jaxb-impl-2.2.3-1.jar
aa57e000-aa581000 r--s 00017000 08:01 2442197    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jaxb-api-2.2.2.jar
aa581000-aa582000 r--s 00004000 08:01 2442195    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/java-xmlbuilder-0.4.jar
aa582000-aa583000 r--s 00006000 08:01 1814290    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jackson-xc-1.9.13.jar
aa583000-aa591000 r--s 000b1000 08:01 2442215    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jackson-mapper-asl-1.9.13.jar
aa591000-aa592000 r--s 00004000 08:01 2596893    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jackson-jaxrs-1.9.13.jar
aa592000-aa596000 r--s 00035000 08:01 2442221    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/jackson-core-asl-1.9.13.jar
aa596000-aa600000 r--s 00774000 08:01 2442168    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-hdfs-2.7.2.jar
aa600000-aa6fe000 rw-p 00000000 00:00 0 
aa6fe000-aa700000 ---p 00000000 00:00 0 
aa700000-aa702000 r--s 00006000 08:01 2442175    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/paranamer-2.3.jar
aa702000-aa708000 r--s 00032000 08:01 2596887    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/httpcore-4.2.5.jar
aa708000-aa711000 r--s 00061000 08:01 2442223    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/httpclient-4.2.5.jar
aa711000-aa72a000 r--s 00150000 08:01 2442212    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/htrace-core-3.1.0-incubating.jar
aa72a000-aa72c000 r--s 00009000 08:01 2596883    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hamcrest-core-1.3.jar
aa72c000-aa730000 r--s 00023000 08:01 2442199    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-nfs-2.7.2.jar
aa730000-aa733000 r--s 00017000 08:01 2442194    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-hdfs-nfs-2.7.2.jar
aa733000-aa757000 r--s 002f8000 08:01 2596907    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-hdfs-2.7.2-tests.jar
aa757000-aa774000 r--s 001ad000 08:01 2442155    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-common-2.7.2-tests.jar
aa774000-aa7ab000 r--s 00312000 08:01 2442173    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-common-2.7.2.jar
aa7ab000-aa7ae000 r--s 0000f000 08:01 2442213    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-auth-2.7.2.jar
aa7ae000-aa7b0000 r--s 00003000 08:01 2442205    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/hadoop-annotations-2.7.2.jar
aa7b0000-aa7d1000 r--s 00172000 08:01 2596898    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/guava-11.0.2.jar
aa7d1000-aa7d6000 r--s 0002a000 08:01 2442203    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/gson-2.2.4.jar
aa7d6000-aa7de000 r--s 0003b000 08:01 2442156    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/curator-recipes-2.7.1.jar
aa7de000-aa7e3000 r--s 0003e000 08:01 2596890    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-net-3.1.jar
aa7e3000-aa800000 r--s 0016a000 08:01 2443685    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-math3-3.1.1.jar
aa800000-aa8fe000 rw-p 00000000 00:00 0 
aa8fe000-aa900000 ---p 00000000 00:00 0 
aa900000-aa906000 r--s 00028000 08:01 2442157    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/curator-framework-2.7.1.jar
aa906000-aa908000 r--s 0000f000 08:01 2442167    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/curator-client-2.7.1.jar
aa908000-aa90d000 r--s 00041000 08:01 2596903    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-lang-2.6.jar
aa90d000-aa911000 r--s 0002a000 08:01 2442159    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-io-2.4.jar
aa911000-aa917000 r--s 00045000 08:01 2443697    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-httpclient-3.1.jar
aa917000-aa91b000 r--s 00020000 08:01 2443681    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-digester-1.8.jar
aa91b000-aa91c000 r--s 00005000 08:01 2596882    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-daemon-1.0.13.jar
aa91c000-aa922000 r--s 00043000 08:01 2442224    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-configuration-1.6.jar
aa922000-aa927000 r--s 00036000 08:01 2442200    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-compress-1.4.1.jar
aa927000-aa934000 r--s 00083000 08:01 2596874    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-collections-3.2.2.jar
aa934000-aa936000 r--s 0000d000 08:01 2596900    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-codec-1.4.jar
aa936000-aa938000 r--s 00009000 08:01 2596897    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-cli-1.2.jar
aa938000-aa93c000 r--s 0002f000 08:01 2442196    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-beanutils-core-1.8.0.jar
aa93c000-aa941000 r--s 0002a000 08:01 2596906    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-beanutils-1.7.0.jar
aa941000-aa948000 r--s 00044000 08:01 2442190    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/avro-1.7.4.jar
aa948000-aa949000 r--s 0000a000 08:01 2442216    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/asm-3.2.jar
aa949000-aa94b000 r--s 00012000 08:01 2442188    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/api-util-1.0.0-M20.jar
aa94b000-aa94d000 r--s 00003000 08:01 2442201    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/api-asn1-api-1.0.0-M20.jar
aa94d000-aa95f000 r--s 00097000 08:01 2596902    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/apacheds-kerberos-codec-2.0.0-M15.jar
aa95f000-aa960000 r--s 0000a000 08:01 2442218    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/apacheds-i18n-2.0.0-M15.jar
aa960000-aa962000 r--s 0000e000 08:01 2596889    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/activation-1.1.jar
aa962000-aa9cd000 r--s 00e18000 08:01 3239443    /opt/jdk1.7.0_25/lib/tools.jar
aa9cd000-aa9db000 r-xp 00000000 08:01 4519096    
/opt/jdk1.7.0_25/jre/lib/i386/libnio.so
aa9db000-aa9dc000 rw-p 0000e000 08:01 4519096    
/opt/jdk1.7.0_25/jre/lib/i386/libnio.so
aa9dc000-aa9f0000 r-xp 00000000 08:01 4519088    
/opt/jdk1.7.0_25/jre/lib/i386/libnet.so
aa9f0000-aa9f1000 rw-p 00014000 08:01 4519088    
/opt/jdk1.7.0_25/jre/lib/i386/libnet.so
aa9f1000-aa9f4000 ---p 00000000 00:00 0 
aa9f4000-aaa42000 rw-p 00000000 00:00 0 
aaa42000-aaa45000 ---p 00000000 00:00 0 
aaa45000-aaac3000 rw-p 00000000 00:00 0 
aaac3000-aaac6000 ---p 00000000 00:00 0 
aaac6000-aab44000 rw-p 00000000 00:00 0 
aab44000-aab47000 ---p 00000000 00:00 0 
aab47000-aab95000 rw-p 00000000 00:00 0 
aab95000-aab98000 ---p 00000000 00:00 0 
aab98000-aabe6000 rw-p 00000000 00:00 0 
aabe6000-aade6000 r--p 00000000 08:01 2031617    /usr/lib/locale/locale-archive
aade6000-aade9000 ---p 00000000 00:00 0 
aade9000-aae37000 rw-p 00000000 00:00 0 
aae37000-aae3a000 ---p 00000000 00:00 0 
aae3a000-aae88000 rw-p 00000000 00:00 0 
aae88000-aae89000 ---p 00000000 00:00 0 
aae89000-aaf54000 rw-p 00000000 00:00 0 
aaf54000-ab111000 r--s 039f9000 08:01 3100365    /opt/jdk1.7.0_25/jre/lib/rt.jar
ab111000-ab112000 ---p 00000000 00:00 0 
ab112000-ab911000 rw-p 00000000 00:00 0 
ab911000-ab929000 rw-p 00000000 00:00 0 
ab929000-ab967000 rw-p 00000000 00:00 0 
ab967000-ab97f000 rw-p 00000000 00:00 0 
ab97f000-b0980000 rw-p 00000000 00:00 0 
b0980000-b3980000 rw-p 00000000 00:00 0 
b3980000-b3982000 r--s 0000e000 08:01 2442198    
/home/sr_cloud/IDEP_V3/src/cpp/hla/idep/Hadoop/native/jar/commons-logging-1.1.3.jar
b3982000-b398b000 rw-p 00000000 00:00 0 
b398b000-b3a42000 rw-p 00000000 00:00 0 
b3a42000-b3c82000 rwxp 00000000 00:00 0 
b3c82000-b6a42000 rw-p 00000000 00:00 0 
b6a42000-b6a59000 r-xp 00000000 08:01 4519086    
/opt/jdk1.7.0_25/jre/lib/i386/libzip.so
b6a59000-b6a5a000 rw-p 00017000 08:01 4519086    
/opt/jdk1.7.0_25/jre/lib/i386/libzip.so
b6a5a000-b6a64000 r-xp 00000000 08:01 49204      
/lib/i686/cmov/libnss_files-2.11.3.so
b6a64000-b6a65000 r--p 00009000 08:01 49204      
/lib/i686/cmov/libnss_files-2.11.3.so
b6a65000-b6a66000 rw-p 0000a000 08:01 49204      
/lib/i686/cmov/libnss_files-2.11.3.so
b6a66000-b6a6e000 r-xp 00000000 08:01 49197      
/lib/i686/cmov/libnss_nis-2.11.3.so
b6a6e000-b6a6f000 r--p 00008000 08:01 49197      
/lib/i686/cmov/libnss_nis-2.11.3.so
b6a6f000-b6a70000 rw-p 00009000 08:01 49197      
/lib/i686/cmov/libnss_nis-2.11.3.so
b6a70000-b6a83000 r-xp 00000000 08:01 49201      /lib/i686/cmov/libnsl-2.11.3.so
b6a83000-b6a84000 r--p 00012000 08:01 49201      /lib/i686/cmov/libnsl-2.11.3.so
b6a84000-b6a85000 rw-p 00013000 08:01 49201      /lib/i686/cmov/libnsl-2.11.3.so
b6a85000-b6a87000 rw-p 00000000 00:00 0 
b6a87000-b6a8e000 r-xp 00000000 08:01 4519049    
/opt/jdk1.7.0_25/jre/lib/i386/libmanagement.so
b6a8e000-b6a8f000 rw-p 00006000 08:01 4519049    
/opt/jdk1.7.0_25/jre/lib/i386/libmanagement.so
b6a8f000-b6a96000 rw-p 00000000 00:00 0 
b6a96000-b6a9e000 rw-s 00000000 08:01 5081315    /tmp/hsperfdata_sr_cloud/28314
b6a9e000-b6ac1000 r-xp 00000000 08:01 4519081    
/opt/jdk1.7.0_25/jre/lib/i386/libjava.so
b6ac1000-b6ac2000 rw-p 00022000 08:01 4519081    
/opt/jdk1.7.0_25/jre/lib/i386/libjava.so
b6ac2000-b6ac9000 r-xp 00000000 08:01 49217      /lib/i686/cmov/librt-2.11.3.so
b6ac9000-b6aca000 r--p 00006000 08:01 49217      /lib/i686/cmov/librt-2.11.3.so
b6aca000-b6acb000 rw-p 00007000 08:01 49217      /lib/i686/cmov/librt-2.11.3.so
b6acb000-b6acc000 rw-p 00000000 00:00 0 
b6acc000-b6af0000 r-xp 00000000 08:01 49199      /lib/i686/cmov/libm-2.11.3.so
b6af0000-b6af1000 r--p 00023000 08:01 49199      /lib/i686/cmov/libm-2.11.3.so
b6af1000-b6af2000 rw-p 00024000 08:01 49199      /lib/i686/cmov/libm-2.11.3.so
b6af2000-b6c32000 r-xp 00000000 08:01 49218      /lib/i686/cmov/libc-2.11.3.so
b6c32000-b6c33000 ---p 00140000 08:01 49218      /lib/i686/cmov/libc-2.11.3.so
b6c33000-b6c35000 r--p 00140000 08:01 49218      /lib/i686/cmov/libc-2.11.3.so
b6c35000-b6c36000 rw-p 00142000 08:01 49218      /lib/i686/cmov/libc-2.11.3.so
b6c36000-b6c39000 rw-p 00000000 00:00 0 
b6c39000-b6c4e000 r-xp 00000000 08:01 49207      
/lib/i686/cmov/libpthread-2.11.3.so
b6c4e000-b6c4f000 r--p 00014000 08:01 49207      
/lib/i686/cmov/libpthread-2.11.3.so
b6c4f000-b6c50000 rw-p 00015000 08:01 49207      
/lib/i686/cmov/libpthread-2.11.3.so
b6c50000-b6c53000 rw-p 00000000 00:00 0 
b6c53000-b6c55000 r-xp 00000000 08:01 49198      /lib/i686/cmov/libdl-2.11.3.so
b6c55000-b6c56000 r--p 00001000 08:01 49198      /lib/i686/cmov/libdl-2.11.3.so
b6c56000-b6c57000 rw-p 00002000 08:01 49198      /lib/i686/cmov/libdl-2.11.3.so
b6c57000-b6c58000 r--s 00003000 08:01 3959746    
/opt/jdk1.7.0_25/jre/lib/ext/sunec.jar
b6c58000-b6c5e000 r-xp 00000000 08:01 49220      
/lib/i686/cmov/libnss_compat-2.11.3.so
b6c5e000-b6c5f000 r--p 00006000 08:01 49220      
/lib/i686/cmov/libnss_compat-2.11.3.so
b6c5f000-b6c60000 rw-p 00007000 08:01 49220      
/lib/i686/cmov/libnss_compat-2.11.3.so
b6c60000-b6c61000 rw-p 00000000 00:00 0 
b6c61000-b6c62000 r--p 00000000 00:00 0 
b6c62000-b6c6d000 r-xp 00000000 08:01 4519066    
/opt/jdk1.7.0_25/jre/lib/i386/libverify.so
b6c6d000-b6c6e000 rw-p 0000b000 08:01 4519066    
/opt/jdk1.7.0_25/jre/lib/i386/libverify.so
b6c6e000-b7421000 r-xp 00000000 08:01 4762610    
/opt/jdk1.7.0_25/jre/lib/i386/server/libjvm.so
b7421000-b7474000 rw-p 007b2000 08:01 4762610    
/opt/jdk1.7.0_25/jre/lib/i386/server/libjvm.so
b7474000-b7897000 rw-p 00000000 00:00 0 
b7897000-b7898000 r-xp 00000000 00:00 0          [vdso]
b7898000-b78b3000 r-xp 00000000 08:01 33397      /lib/ld-2.11.3.so
b78b3000-b78b4000 r--p 0001b000 08:01 33397      /lib/ld-2.11.3.so
b78b4000-b78b5000 rw-p 0001c000 08:01 33397      /lib/ld-2.11.3.so
bfbce000-bfbd1000 ---p 00000000 00:00 0 
bfbd2000-bfc1e000 rw-p 00000000 00:00 0          [stack]

VM Arguments:
jvm_args: -Xmx64M -Xms64M -Dcom.sun.management.jmxremote 
-Dcom.sun.management.jmxremote.authenticate=false 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.port=9999 
-Djava.rmi.server.hostname=192.168.135.2 -server -XX:+UseParNewGC 
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled 
-XX:+CMSScavengeBeforeRemark -XX:+DisableExplicitGC -Djava.awt.headless=true 
java_command: <unknown>
Launcher Type: generic

Environment Variables:
JAVA_HOME=/opt/jdk1.7.0_25
PATH=/home/sr_cloud/dist/IDEP_V3/bin:/opt/jdk1.7.0_25/bin:/opt/jboss-4.2.2.GA/bin:/opt/jdk1.5.0_22/bin:/home/sr_cloud/dist/IDEP_V3/bin:/opt/jdk1.7.0_25/bin:/opt/jboss-4.2.2.GA/bin:/opt/jdk1.5.0_22/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:.:.
LD_LIBRARY_PATH=/home/sr_cloud/dist/IDEP_V3/lib::/usr/lib:/usr/local/lib:/opt/jdk1.7.0_25/jre/lib/i386/server
SHELL=/bin/bash
DISPLAY=:0.0

Signal Handlers:
SIGSEGV: [libjvm.so+0x71d560], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x71d560], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x5d74f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x5d74f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x5d74f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x5d74f0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x5d6dd0], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: [libjvm.so+0x5d93c0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGINT: [libjvm.so+0x5d93c0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGTERM: [libjvm.so+0x5d93c0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGQUIT: [libjvm.so+0x5d93c0], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004


---------------  S Y S T E M  ---------------

OS:6.0.5

uname:Linux 2.6.32-5-686 #1 SMP Thu Nov 3 04:23:54 UTC 2011 i686
libc:glibc 2.11.3 NPTL 2.11.3 
rlimit: STACK 8192k, CORE infinity, NPROC infinity, NOFILE 1024, AS 300000k
load average:2.74 2.03 1.59

/proc/meminfo:
MemTotal:        1034472 kB
MemFree:           28100 kB
Buffers:          151116 kB
Cached:           155836 kB
SwapCached:        32768 kB
Active:           454864 kB
Inactive:         479572 kB
Active(anon):     301980 kB
Inactive(anon):   329756 kB
Active(file):     152884 kB
Inactive(file):   149816 kB
Unevictable:          16 kB
Mlocked:              16 kB
HighTotal:        143304 kB
HighFree:            276 kB
LowTotal:         891168 kB
LowFree:           27824 kB
SwapTotal:       1004536 kB
SwapFree:         916008 kB
Dirty:               164 kB
Writeback:             0 kB
AnonPages:        598304 kB
Mapped:            40524 kB
Shmem:              4200 kB
Slab:              57552 kB
SReclaimable:      46500 kB
SUnreclaim:        11052 kB
KernelStack:        3752 kB
PageTables:         4148 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1521772 kB
Committed_AS:    2926148 kB
VmallocTotal:     122880 kB
VmallocUsed:       27940 kB
VmallocChunk:      84328 kB
HardwareCorrupted:     0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       4096 kB
DirectMap4k:       12280 kB
DirectMap4M:      892928 kB


CPU:total 1 (2 cores per cpu, 2 threads per core) family 6 model 60 stepping 3, 
cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, ht, tsc, 
tscinvbit

/proc/cpuinfo:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i5-4210M CPU @ 2.60GHz
stepping        : 3
cpu MHz         : 2593.966
cache size      : 3072 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat 
pse36 clflush mmx fxsr sse sse2 rdtscp constant_tsc up xtopology nonstop_tsc 
pni ssse3 sse4_1 sse4_2 lahf_lm
bogomips        : 5187.93
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:



Memory: 4k page, physical 1034472k(28100k free), swap 1004536k(916008k free)

vm_info: Java HotSpot(TM) Server VM (23.25-b01) for linux-x86 JRE 
(1.7.0_25-b15), built on Jun  5 2013 20:53:39 by "java_re" with gcc 4.3.0 
20080428 (Red Hat 4.3.0-8)

time: Fri May 20 11:30:07 2016
elapsed time: 466 seconds

=================================================================================================================================================================
My Testing program(test/test_libhdfs_ops.c) as following :

/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "hdfs.h" 
#include "hdfs_test.h" 
#include "platform.h"

#include <inttypes.h>
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>

void permission_disp(short permissions, char *rtr) {
  int i;
  short permissionsId;
  char* perm;
  rtr[9] = '\0';
  for(i=2;i>=0;i--)
    {
      permissionsId = permissions >> (i * 3) & (short)7;
      switch(permissionsId) {
      case 7:
        perm = "rwx"; break;
      case 6:
        perm = "rw-"; break;
      case 5:
        perm = "r-x"; break;
      case 4:
        perm = "r--"; break;
      case 3:
        perm = "-wx"; break;
      case 2:
        perm = "-w-"; break;
      case 1:
        perm = "--x"; break;
      case 0:
        perm = "---"; break;
      default:
        perm = "???";
      }
      strncpy(rtr, perm, 3);
      rtr+=3;
    }
} 

int main(int argc, char **argv) {
    const char *writePath = "/tmp/testfile.txt";
    const char *fileContents = "Hello, World!";
    const char *readPath = "/tmp/testfile.txt";
    const char *srcPath = "/tmp/testfile.txt";
    const char *dstPath = "/tmp/testfile2.txt";
    const char *slashTmp = "/tmp";//"/home/sr_cloud/IDEP_V3/src/cpp/hla/idep";
    const char *newDirectory = "/tmp/newdir";
    const char *newOwner = "root";
    const char *tuser = "nobody";
    const char *appendPath = "/tmp/appends";
    const char *userPath = "/tmp/usertestfile.txt";

    char buffer[32], buffer2[256], rdbuffer[32];
    tSize num_written_bytes, num_read_bytes;
    hdfsFS fs, lfs;
    hdfsFile writeFile, readFile, localFile, appendFile, userFile;
    tOffset currentPos, seekPos;
    int exists, totalResult, result, numEntries, i, j;
    const char *resp;
    hdfsFileInfo *fileInfo, *fileList, *finfo;
    char *buffer3;
    char permissions[10];
    char ***hosts;
    short newPerm = 0666;
    tTime newMtime, newAtime;

    fs = hdfsConnectNewInstance("default", 0);
    if(!fs) {
        fprintf(stderr, "Oops! Failed to connect to hdfs!\n");
        exit(-1);
    } 
 
    lfs = hdfsConnectNewInstance(NULL, 0);
    if(!lfs) {
        fprintf(stderr, "Oops! Failed to connect to 'local' hdfs!\n");
        exit(-1);
    } 

//Begin : Testing memory weak 
while(1)
{
        fileList = 0;
        if((fileList = hdfsListDirectory(fs, slashTmp, &numEntries)) != NULL) {
            for(i=0; i < numEntries; ++i) {
                fprintf(stderr, "Name: %s, ", fileList[i].mName);
                fprintf(stderr, "Type: %c, ", (char)fileList[i].mKind);
                fprintf(stderr, "Replication: %d, ", fileList[i].mReplication);
                fprintf(stderr, "BlockSize: %" PRId64 ", ", 
fileList[i].mBlockSize);
                fprintf(stderr, "Size: %" PRId64 ", ", fileList[i].mSize);
                fprintf(stderr, "LastMod: %s", ctime(&fileList[i].mLastMod));
                fprintf(stderr, "Owner: %s, ", fileList[i].mOwner);
                fprintf(stderr, "Group: %s, ", fileList[i].mGroup);
                permission_disp(fileList[i].mPermissions, permissions);
                fprintf(stderr, "Permissions: %d (%s)\n", 
fileList[i].mPermissions, permissions);
            }
            hdfsFreeFileInfo(fileList, numEntries);
        } else {
            if (errno) {
                totalResult++;
                fprintf(stderr, "waah! hdfsListDirectory - FAILED!\n");
            } else {
                fprintf(stderr, "Empty directory!\n");
            }
        }
}

//End : Testing memory weak

    {
        //Write tests
        
        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);
        }
        fprintf(stderr, "Opened %s for writing successfully...\n", writePath);
        num_written_bytes =
          hdfsWrite(fs, writeFile, (void*)fileContents,
            (tSize)(strlen(fileContents)+1));
        if (num_written_bytes != strlen(fileContents) + 1) {
          fprintf(stderr, "Failed to write correct number of bytes - expected 
%d, got %d\n",
                  (int)(strlen(fileContents) + 1), (int)num_written_bytes);
            exit(-1);
        }
        fprintf(stderr, "Wrote %d bytes\n", num_written_bytes);

        currentPos = -1;
        if ((currentPos = hdfsTell(fs, writeFile)) == -1) {
            fprintf(stderr, 
                    "Failed to get current file position correctly! Got %" 
PRId64 "!\n",
                    currentPos);
            exit(-1);
        }
        fprintf(stderr, "Current position: %" PRId64 "\n", currentPos);

        if (hdfsFlush(fs, writeFile)) {
            fprintf(stderr, "Failed to 'flush' %s\n", writePath); 
            exit(-1);
        }
        fprintf(stderr, "Flushed %s successfully!\n", writePath); 

        if (hdfsHFlush(fs, writeFile)) {
            fprintf(stderr, "Failed to 'hflush' %s\n", writePath);
            exit(-1);
        }
        fprintf(stderr, "HFlushed %s successfully!\n", writePath);

        hdfsCloseFile(fs, writeFile);
    }

    {
        //Read tests
        
        exists = hdfsExists(fs, readPath);

        if (exists) {
          fprintf(stderr, "Failed to validate existence of %s\n", readPath);
          exit(-1);
        }

        readFile = hdfsOpenFile(fs, readPath, O_RDONLY, 0, 0, 0);
        if (!readFile) {
            fprintf(stderr, "Failed to open %s for reading!\n", readPath);
            exit(-1);
        }

        if (!hdfsFileIsOpenForRead(readFile)) {
            fprintf(stderr, "hdfsFileIsOpenForRead: we just opened a file "
                    "with O_RDONLY, and it did not show up as 'open for "
                    "read'\n");
            exit(-1);
        }

        fprintf(stderr, "hdfsAvailable: %d\n", hdfsAvailable(fs, readFile));

        seekPos = 1;
        if(hdfsSeek(fs, readFile, seekPos)) {
            fprintf(stderr, "Failed to seek %s for reading!\n", readPath);
            exit(-1);
        }

        currentPos = -1;
        if((currentPos = hdfsTell(fs, readFile)) != seekPos) {
            fprintf(stderr, 
                    "Failed to get current file position correctly! Got %" 
PRId64 "!\n",
                    currentPos);
            exit(-1);
        }
        fprintf(stderr, "Current position: %" PRId64 "\n", currentPos);

        if (!hdfsFileUsesDirectRead(readFile)) {
          fprintf(stderr, "Direct read support incorrectly not detected "
                  "for HDFS filesystem\n");
          exit(-1);
        }

        fprintf(stderr, "Direct read support detected for HDFS\n");

        // Test the direct read path
        if(hdfsSeek(fs, readFile, 0)) {
            fprintf(stderr, "Failed to seek %s for reading!\n", readPath);
            exit(-1);
        }
        memset(buffer, 0, sizeof(buffer));
        num_read_bytes = hdfsRead(fs, readFile, (void*)buffer,
                sizeof(buffer));
        if (strncmp(fileContents, buffer, strlen(fileContents)) != 0) {
            fprintf(stderr, "Failed to read (direct). Expected %s but got %s 
(%d bytes)\n",
                    fileContents, buffer, num_read_bytes);
            exit(-1);
        }
        fprintf(stderr, "Read (direct) following %d bytes:\n%s\n",
                num_read_bytes, buffer);
        if (hdfsSeek(fs, readFile, 0L)) {
            fprintf(stderr, "Failed to seek to file start!\n");
            exit(-1);
        }

        // Disable the direct read path so that we really go through the slow
        // read path
        hdfsFileDisableDirectRead(readFile);

        num_read_bytes = hdfsRead(fs, readFile, (void*)buffer, 
                sizeof(buffer));
        fprintf(stderr, "Read following %d bytes:\n%s\n", 
                num_read_bytes, buffer);

        memset(buffer, 0, strlen(fileContents + 1));

        num_read_bytes = hdfsPread(fs, readFile, 0, (void*)buffer, 
                sizeof(buffer));
        fprintf(stderr, "Read following %d bytes:\n%s\n", 
                num_read_bytes, buffer);

        hdfsCloseFile(fs, readFile);

        // Test correct behaviour for unsupported filesystems
        localFile = hdfsOpenFile(lfs, writePath, O_WRONLY|O_CREAT, 0, 0, 0);
        if(!localFile) {
            fprintf(stderr, "Failed to open %s for writing!\n", writePath);
            exit(-1);
        }

        num_written_bytes = hdfsWrite(lfs, localFile, (void*)fileContents,
                                      (tSize)(strlen(fileContents) + 1));

        hdfsCloseFile(lfs, localFile);
        localFile = hdfsOpenFile(lfs, writePath, O_RDONLY, 0, 0, 0);

        if (hdfsFileUsesDirectRead(localFile)) {
          fprintf(stderr, "Direct read support incorrectly detected for local "
                  "filesystem\n");
          exit(-1);
        }

        hdfsCloseFile(lfs, localFile);
    }

    totalResult = 0;
    result = 0;
    {
        //Generic file-system operations

        fprintf(stderr, "hdfsCopy(remote-local): %s\n", ((result = hdfsCopy(fs, 
srcPath, lfs, srcPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsCopy(remote-remote): %s\n", ((result = 
hdfsCopy(fs, srcPath, fs, dstPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsMove(local-local): %s\n", ((result = hdfsMove(lfs, 
srcPath, lfs, dstPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsMove(remote-local): %s\n", ((result = hdfsMove(fs, 
srcPath, lfs, srcPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr, "hdfsRename: %s\n", ((result = hdfsRename(fs, dstPath, 
srcPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsCopy(remote-remote): %s\n", ((result = 
hdfsCopy(fs, srcPath, fs, dstPath)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr, "hdfsCreateDirectory: %s\n", ((result = 
hdfsCreateDirectory(fs, newDirectory)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr, "hdfsSetReplication: %s\n", ((result = 
hdfsSetReplication(fs, srcPath, 2)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr, "hdfsGetWorkingDirectory: %s\n", ((resp = 
hdfsGetWorkingDirectory(fs, buffer2, sizeof(buffer2))) != 0 ? buffer2 : 
"Failed!"));
        totalResult += (resp ? 0 : 1);
        fprintf(stderr, "hdfsSetWorkingDirectory: %s\n", ((result = 
hdfsSetWorkingDirectory(fs, slashTmp)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsGetWorkingDirectory: %s\n", ((resp = 
hdfsGetWorkingDirectory(fs, buffer2, sizeof(buffer2))) != 0 ? buffer2 : 
"Failed!"));
        totalResult += (resp ? 0 : 1);

        fprintf(stderr, "hdfsGetDefaultBlockSize: %" PRId64 "\n", 
hdfsGetDefaultBlockSize(fs));
        fprintf(stderr, "hdfsGetCapacity: %" PRId64 "\n", hdfsGetCapacity(fs));
        fprintf(stderr, "hdfsGetUsed: %" PRId64 "\n", hdfsGetUsed(fs));

        fileInfo = NULL;
        if((fileInfo = hdfsGetPathInfo(fs, slashTmp)) != NULL) {
            fprintf(stderr, "hdfsGetPathInfo - SUCCESS!\n");
            fprintf(stderr, "Name: %s, ", fileInfo->mName);
            fprintf(stderr, "Type: %c, ", (char)(fileInfo->mKind));
            fprintf(stderr, "Replication: %d, ", fileInfo->mReplication);
            fprintf(stderr, "BlockSize: %" PRId64 ", ", fileInfo->mBlockSize);
            fprintf(stderr, "Size: %" PRId64 ", ", fileInfo->mSize);
            fprintf(stderr, "LastMod: %s", ctime(&fileInfo->mLastMod)); 
            fprintf(stderr, "Owner: %s, ", fileInfo->mOwner);
            fprintf(stderr, "Group: %s, ", fileInfo->mGroup);
            permission_disp(fileInfo->mPermissions, permissions);
            fprintf(stderr, "Permissions: %d (%s)\n", fileInfo->mPermissions, 
permissions);
            hdfsFreeFileInfo(fileInfo, 1);
        } else {
            totalResult++;
            fprintf(stderr, "waah! hdfsGetPathInfo for %s - FAILED!\n", 
slashTmp);
        }

        fileList = 0;
        if((fileList = hdfsListDirectory(fs, slashTmp, &numEntries)) != NULL) {
            for(i=0; i < numEntries; ++i) {
                fprintf(stderr, "Name: %s, ", fileList[i].mName);
                fprintf(stderr, "Type: %c, ", (char)fileList[i].mKind);
                fprintf(stderr, "Replication: %d, ", fileList[i].mReplication);
                fprintf(stderr, "BlockSize: %" PRId64 ", ", 
fileList[i].mBlockSize);
                fprintf(stderr, "Size: %" PRId64 ", ", fileList[i].mSize);
                fprintf(stderr, "LastMod: %s", ctime(&fileList[i].mLastMod));
                fprintf(stderr, "Owner: %s, ", fileList[i].mOwner);
                fprintf(stderr, "Group: %s, ", fileList[i].mGroup);
                permission_disp(fileList[i].mPermissions, permissions);
                fprintf(stderr, "Permissions: %d (%s)\n", 
fileList[i].mPermissions, permissions);
            }
            hdfsFreeFileInfo(fileList, numEntries);
        } else {
            if (errno) {
                totalResult++;
                fprintf(stderr, "waah! hdfsListDirectory - FAILED!\n");
            } else {
                fprintf(stderr, "Empty directory!\n");
            }
        }

        hosts = hdfsGetHosts(fs, srcPath, 0, 1);
        if(hosts) {
            fprintf(stderr, "hdfsGetHosts - SUCCESS! ... \n");
            i=0; 
            while(hosts[i]) {
                j = 0;
                while(hosts[i][j]) {
                    fprintf(stderr, 
                            "\thosts[%d][%d] - %s\n", i, j, hosts[i][j]);
                    ++j;
                }
                ++i;
            }
        } else {
            totalResult++;
            fprintf(stderr, "waah! hdfsGetHosts - FAILED!\n");
        }
       
        // setting tmp dir to 777 so later when connectAsUser nobody, we can 
write to it

        // chown write
        fprintf(stderr, "hdfsChown: %s\n", ((result = hdfsChown(fs, writePath, 
NULL, "users")) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsChown: %s\n", ((result = hdfsChown(fs, writePath, 
newOwner, NULL)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        // chmod write
        fprintf(stderr, "hdfsChmod: %s\n", ((result = hdfsChmod(fs, writePath, 
newPerm)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;



        sleep(2);
        newMtime = time(NULL);
        newAtime = time(NULL);

        // utime write
        fprintf(stderr, "hdfsUtime: %s\n", ((result = hdfsUtime(fs, writePath, 
newMtime, newAtime)) != 0 ? "Failed!" : "Success!"));

        totalResult += result;

        // chown/chmod/utime read
        finfo = hdfsGetPathInfo(fs, writePath);

        fprintf(stderr, "hdfsChown read: %s\n", ((result = 
(strcmp(finfo->mOwner, newOwner))) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr, "hdfsChmod read: %s\n", ((result = (finfo->mPermissions 
!= newPerm)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        // will later use /tmp/ as a different user so enable it
        fprintf(stderr, "hdfsChmod: %s\n", ((result = hdfsChmod(fs, "/tmp/", 
0777)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        fprintf(stderr,"newMTime=%ld\n",newMtime);
        fprintf(stderr,"curMTime=%ld\n",finfo->mLastMod);


        fprintf(stderr, "hdfsUtime read (mtime): %s\n", ((result = 
(finfo->mLastMod != newMtime)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;

        // No easy way to turn on access times from hdfs_test right now
        //        fprintf(stderr, "hdfsUtime read (atime): %s\n", ((result = 
(finfo->mLastAccess != newAtime)) != 0 ? "Failed!" : "Success!"));
        //        totalResult += result;

        hdfsFreeFileInfo(finfo, 1);

        // Clean up
        fprintf(stderr, "hdfsDelete: %s\n", ((result = hdfsDelete(fs, 
newDirectory, 1)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsDelete: %s\n", ((result = hdfsDelete(fs, srcPath, 
1)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsDelete: %s\n", ((result = hdfsDelete(lfs, srcPath, 
1)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsDelete: %s\n", ((result = hdfsDelete(lfs, dstPath, 
1)) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
        fprintf(stderr, "hdfsExists: %s\n", ((result = hdfsExists(fs, 
newDirectory)) != 0 ? "Success!" : "Failed!"));
        totalResult += (result ? 0 : 1);
    }

    {
      // TEST APPENDS

      // CREATE
      appendFile = hdfsOpenFile(fs, appendPath, O_WRONLY, 0, 0, 0);
      if(!appendFile) {
        fprintf(stderr, "Failed to open %s for writing!\n", appendPath);
        exit(-1);
      }
      fprintf(stderr, "Opened %s for writing successfully...\n", appendPath);

      buffer3 = "Hello,";
      num_written_bytes = hdfsWrite(fs, appendFile, (void*)buffer3,
        (tSize)strlen(buffer3));
      fprintf(stderr, "Wrote %d bytes\n", num_written_bytes);

      if (hdfsFlush(fs, appendFile)) {
        fprintf(stderr, "Failed to 'flush' %s\n", appendPath); 
        exit(-1);
        }
      fprintf(stderr, "Flushed %s successfully!\n", appendPath); 

      hdfsCloseFile(fs, appendFile);

      // RE-OPEN
      appendFile = hdfsOpenFile(fs, appendPath, O_WRONLY|O_APPEND, 0, 0, 0);
      if(!appendFile) {
        fprintf(stderr, "Failed to open %s for writing!\n", appendPath);
        exit(-1);
      }
      fprintf(stderr, "Opened %s for writing successfully...\n", appendPath);

      buffer3 = " World";
      num_written_bytes = hdfsWrite(fs, appendFile, (void*)buffer3,
        (tSize)(strlen(buffer3) + 1));
      fprintf(stderr, "Wrote %d bytes\n", num_written_bytes);

      if (hdfsFlush(fs, appendFile)) {
        fprintf(stderr, "Failed to 'flush' %s\n", appendPath); 
        exit(-1);
      }
      fprintf(stderr, "Flushed %s successfully!\n", appendPath); 

      hdfsCloseFile(fs, appendFile);

      // CHECK size
      finfo = hdfsGetPathInfo(fs, appendPath);
      fprintf(stderr, "fileinfo->mSize: == total %s\n", ((result = 
(finfo->mSize == (tOffset)(strlen("Hello, World") + 1))) == 1 ? "Success!" : 
"Failed!"));
      totalResult += (result ? 0 : 1);

      // READ and check data
      readFile = hdfsOpenFile(fs, appendPath, O_RDONLY, 0, 0, 0);
      if (!readFile) {
        fprintf(stderr, "Failed to open %s for reading!\n", appendPath);
        exit(-1);
      }

      num_read_bytes = hdfsRead(fs, readFile, (void*)rdbuffer, 
sizeof(rdbuffer));
      fprintf(stderr, "Read following %d bytes:\n%s\n", 
              num_read_bytes, rdbuffer);

      fprintf(stderr, "read == Hello, World %s\n", ((result = (strcmp(rdbuffer, 
"Hello, World"))) == 0 ? "Success!" : "Failed!"));

      hdfsCloseFile(fs, readFile);

      // DONE test appends
    }
      
      
    totalResult += (hdfsDisconnect(fs) != 0);

    {
      //
      // Now test as connecting as a specific user
      // This is only meant to test that we connected as that user, not to test
      // the actual fs user capabilities. Thus just create a file and read
      // the owner is correct.

      fs = hdfsConnectAsUserNewInstance("default", 0, tuser);
      if(!fs) {
        fprintf(stderr, "Oops! Failed to connect to hdfs as user %s!\n",tuser);
        exit(-1);
      } 

        userFile = hdfsOpenFile(fs, userPath, O_WRONLY|O_CREAT, 0, 0, 0);
        if(!userFile) {
            fprintf(stderr, "Failed to open %s for writing!\n", userPath);
            exit(-1);
        }
        fprintf(stderr, "Opened %s for writing successfully...\n", userPath);

        num_written_bytes = hdfsWrite(fs, userFile, (void*)fileContents,
          (tSize)(strlen(fileContents)+1));
        fprintf(stderr, "Wrote %d bytes\n", num_written_bytes);

        if (hdfsFlush(fs, userFile)) {
            fprintf(stderr, "Failed to 'flush' %s\n", userPath); 
            exit(-1);
        }
        fprintf(stderr, "Flushed %s successfully!\n", userPath); 

        hdfsCloseFile(fs, userFile);

        finfo = hdfsGetPathInfo(fs, userPath);
        fprintf(stderr, "hdfs new file user is correct: %s\n", ((result = 
(strcmp(finfo->mOwner, tuser))) != 0 ? "Failed!" : "Success!"));
        totalResult += result;
    }
    
    totalResult += (hdfsDisconnect(fs) != 0);

    if (totalResult != 0) {
        return -1;
    } else {
        return 0;
    }
}

/**
 * vim: ts=4: sw=4: et:
 */

================================================================================================================================================================
I have no idea why the VIRT,SWAP and DATA segment keeps increasing.
And program is core dump at the end. 

Does anybody could provide some helps to me? Thanks.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to