May 31, 2010

Debugging memory problems on solaris with libumem

pmap -x showed an increasing memory usage of an application.

After searching, I found  a lot of hints using libumem for debugging
memory issues in Solaris / OpenSolaris.

Hints are here , here and here and also a lot more.

On Build 134 I started the application with:

# libumem
LD_PRELOAD=libumem.so.1
export LD_PRELOAD
##UMEM_DEBUG=default
UMEM_DEBUG=default,firewall=1
export UMEM_DEBUG
UMEM_LOGGING=transaction
export UMEM_LOGGING
UMEM_OPTIONS=backend=mmap
export UMEM_OPTIONS
After starting the application, I attached the mdb with the command:
mdb -p
>::sysbp _exit
>::cont

After this I let the application run and  shut down. During shutdown the
debugger stopped short before finishing:


mdb: stop on entry to _exit
mdb: target stopped at:
0xfe8c3f68:     nop  

Now we trapped in the exit function of the process and verify the
recordings of libumem:
 
> ::umem_verify
Cache Name                      Addr     Cache Integrity    
umem_magazine_1                 fe826010 clean
umem_magazine_3                 fe826390 clean
umem_magazine_7                 fe826710 clean
umem_magazine_15                fe826a90 clean
umem_magazine_31                fe827010 clean
umem_magazine_47                fe827390 clean
umem_magazine_63                fe827710 clean
umem_magazine_95                fe827a90 clean
umem_magazine_143               fe828010 clean
umem_slab_cache                 fe828390 clean
umem_bufctl_cache               fe828710 clean
umem_bufctl_audit_cache         fe828a90 clean

Here every buffer is clean and no memory overwriting occured, otherwise
there would be a message like:
 umem_alloc_1152                  8098a90 1 corrupt buffer
Show open memory allocations:
> ::findleaks
BYTES             LEAKED VMEM_SEG CALLER
8192                   1 fef39000 MMAP
------------------------------------------------------------------------
           Total       1 oversized leak, 8192 bytes

CACHE     LEAKED   BUFCTL CALLER
fe7d3010       1 fae39eb8 libldap50.so`ldap_x_calloc+0x2d
fe7d0710       6 fae39c60 libldap50.so`ldap_x_malloc+0x29
fe7d0710       1 fae39f30 libldap50.so`ldap_x_malloc+0x29
fe7d0a90      10 fae39e40 libldap50.so`ldap_x_malloc+0x29
fe7d0390       3 fab805f0 libstdc++.so.6`_Znwj+0x29
fe7d0390      17 f9c4e480 libstdc++.so.6`_Znwj+0x29
fe7d0390       2 fab80500 libstdc++.so.6`_Znwj+0x29
fe7d0390      21 fb026ad0 libstdc++.so.6`_Znwj+0x29
fe7d0390       3 fab80398 libstdc++.so.6`_Znwj+0x29
fe7d0390      28 fa91d168 libstdc++.so.6`_Znwj+0x29
fe7d0390      22 fa66df28 libstdc++.so.6`_Znwj+0x29
fe7d0710       1 fa081878 libstdc++.so.6`_Znwj+0x29
fe7d0710       1 faae2148 libstdc++.so.6`_Znwj+0x29
fe7d9a90       1 fde2ce40 lib
XXXXXX.so403`scf_XXXXXX+0x3c
fe7d9a90       1 fd97b078 lib
XXXXXX.so403`scf_XXXXXX+0x3c
fe7d0710       1 fb0842f8 lib
XXXXXX.so403`scf_malloc+0x48
fe7d1010       1 fb084370 lib
XXXXXX.so403`scf_malloc+0x48
fe7dda90       1 fa82f4c0 lib
XXXXXX.so403`scf_malloc+0x48
fe7df390       1 fa0818f0 lib
XXXXXX.so403`scf_malloc+0x48
fe7d3710       1 fe7b48f0 lib
XXXXXX.so403`init_libXXXXXX+0x18
------------------------------------------------------------------------
   Total     123 buffers, 25112 bytes
Analyse a specific buffer:
> fb0842f8::bufctl_audit
            ADDR  BUFADDR  TIMESTAMP    THREAD
                    CACHE    LASTLOG    CONTENTS
        fb0842f8  f9f16000
a926cc9ecf6a     1
                  fe7d0710     fe8033e8     0
                 libumem.so.1`umem_slab_alloc+0x1b7
                 libumem.so.1`umem_cache_alloc+0xe5
                 libumem.so.1`umem_alloc+0xcd
                 libumem.so.1`malloc+0x2a
                 lib
XXXXXX.so403`scf_malloc+0x48
                 libvsmsgCsi.so403`scf_
XXXXXX+0x46b
                 libvsmsgCsi.so403`bcf_
XXXXXX+0x1a1
                 lib
XXXXXX.so403`ctrl_XXXXXX+0x106
                 lib
XXXXXX.so403`ctrl_XXXXXX+0x1bc
                 lib
XXXXXX.so403`ctrl_XXXXXX+0xb2
                 lib
XXXXXX.so403`ctrl_XXXXXX+0x7dd
                 lib
XXXXXX.so403`ctrl_XXXXXX+0x1bc
                 lib
XXXXXX.so403`prog_XXXXXX+0x9a
                
XXXXXX?main+0x140
                 lib
XXXXXX.so403`main+0x196

The real memory pointer in the executable is f9f16000 + 8.

The length of the data can be calculated by dumping the memory:


> f9f16000/10X
0xf9f16000:     2579            3a109a87        2f6a392f        51414134
                4a5a6b53        42416752        41455141        4c4


and calculate 2579-8 in hex seems to be the size of the allocated buffer.

If the leak occured more times, there is only the last entry in the
::findleaks output.  In the column LEAKED is the number of
occurrences of the leak.


To get all buffers issued the following:


::walk leak 
or
::walk leakbuf

and this shows you all leaking buffers, which can be inspected with
::bufctl_audit

May 27, 2010

GCC compile problem on AIX 6.1 as non root user. Getting cc1: error: /usr/local/include: Permission denied

On a p520 with AIX 6.1 I installed the GCC Packages from http://www.perzl.org/aix/index.php?n=Main.Gcc.

The had the version 4.2.4.

When trying to compile a simple c file I get the following message, when I'm a normal user:

[vsop:aixhaspa61:/entw/vsop/tmp]$ gcc -o a a.c
cc1: error: /usr/local/include: Permission denied
After searching for a solution, I found this thread, which has the same problem on solaris.  

After creating a /usr/local/include folder and changing the access rights,
the compilation also works for a non-root user. 

FindBugs, PMD, Checkstyle, Dependency finder from SQE is now in kenai for netbeans update

After upgrading to Netbeans 6.9 RC1 I could not install the SQE
( Software Quality Environment ) from the dev.java.net site.

The refered to kenai for netbeans > 6.7.1.


Use this link for the update center  or go to the following site for more
information.

May 26, 2010

Netbeans 6.9 RC1 is ready for download

 The Netbeans 6.9 RC 1 is ready for download at:
http://dlc.sun.com.edgesuite.net/netbeans/6.9/rc/

The Python Plugins are available for installation.

The installation was fine on my OpenSolaris Build 134.

The python modules seems to work.

Zones on AIX 6.1 -> Workload Partitions

On an AIX system you can also create zones like in Solaris 10 but here
they are named WPAR ( workload partitions ).

the commands are

mkwpar -n
lswpar
startwpar
stopwpar
The default directory is /wpars if not defined otherwise in mkwpar.

Smitty also contains a menu entry for WPAR maintenance, where you have
an option to add a network interface to the WPAR.

May 25, 2010

sftp login via jEdit failed on new installed AIX 6.1 with ssh from the CD|s

We installed a AIX 6.1 on a new p520. To allow the login via ssh, I installed
the SSH-Package from the CD.

But the open request in jEdit failed with a

java.io.IOException: com.jcraft.jsch.JSchException: failed to send channel request

After searching for the error, I found out, that /etc/ssh/sshd_config had a
wrong path entry for the sftp server.
After setting to /usr/sbin/sftp-server, the login worked via jEdit.

May 18, 2010

Accessing a NFTS partition from OpenSolaris

In the former Laptop, I had fusefs/libfusefs and ntfs-3g installed to access
the NTFS partition.

On the new Laptop I haven't done this so far. To access and copy files from
the NTFS-Partition of an external USB device I use now:

ntfscat /dev/dsk/c6t0d0p1 source File Name > targetFilename

ntfsls /dev/dsk/c6t0d0p1

ntfscp should only work when writing to the NTFS partition as found on the
web.

May 7, 2010

InstallAnywhere Package fails to install with a strange Malformed encoding error

I attempted to install an InstallAnywhere Package on OpenSolaris with UTF-8
Character setting:


[root@solewer:~/prod]$locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
Starting the installer results in the following output:


[root@solewer:~/prod]$./vsopcsi_40305_sol11i.bin
Preparing to install...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

Launching installer...

An internal LaunchAnywhere application error has occured and this application cannot proceed. (LAX)

Stack Trace:
java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
        at java.util.Properties.loadConvert(Properties.java:552)
        at java.util.Properties.load0(Properties.java:375)
        at java.util.Properties.load(Properties.java:325)
        at com.zerog.common.java.util.PropertiesUtil.loadProperties(DashoA10*..)
        at com.zerog.lax.LAX.(DashoA10*..)
        at com.zerog.lax.LAX.main(DashoA10*..)
Attempting to set an other locale like de_AT.ISO8859-15 didn't change
anything.

A helpful hint is here.

reseting the PS1 environment variable for the prompt to
PS1='${PWD}>'
and starting the installer: 
/export/home/ewer/prod>./vsopcsi_40305_sol11i.bin
Preparing to install...
Extracting the installation resources from the installer archive...
Configuring the installer for this system's environment...

Launching installer...

 shows the install dialog.

May 4, 2010

matching C/C++ preprocessor defines in netbeans 6.9 Beta

I'm using Netbeans also for C/C++, because the integration of exiting source with it's own Makefiles is much easier than in Eclipse.

C/C++ has preprocessor defines. You can jump between the matching braces,
but when you put the cursor on a preprocessor define, the corresponding defines are  highlighted.

May 3, 2010

Starting a windows service as a "normal" user

I have the problem to allow a normal user the start/stop of a service of our own.

Here you've to start the Microsoft Management Console with  mmc.
Select Add Snap-In and in the dialog select Add and select Security templates.

The names may not be exact, because I've a German version of windows xp here.

Open the templates tree and double click the entry compatws on the right side.
Select System Services with double click and select your service.
Here you can add the user and select the allowed operations.

After this, you have to define a security database and import the configuration.

The helpful link in German  is here.

May 2, 2010

OpenSolaris Build 134 on FUJITSU SIEMENS CELSIUS H270

I installed OpenSolaris Build 134 on the Celsisu H270.

The graphics card is a nVidia G96M [Quadro FX 770M], wich supports the
3rd effects.

The webcam is also useable with the Cheese application.

Suspend/Resume works also.

Only the graphics boot from grub doesn't work.
You have to edit the commandline in grub and remove the
splashimage, fore- and background color line and remove the
graphics option from the kernel line.