Creation Zone

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Sunday, 19 November 2006

Solaris: Workaround for incorrect LUN size issue

Posted on 22:40 by Unknown
Scenario:
You created a logical drive of capacity x GB, and mapped it so there is a LUN (Logical Unit Number) with size x GB. When you run format command, Solaris shows incorrect size for the logical drive.

eg.,
Partition table showing only 409 GB, where it is supposed to show 816 GB.
partition> p
Current partition table (original):
Total disk cylinders available: 53233 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 16 133.88MB (17/0/0) 274193
1 swap wu 17 - 33 133.88MB (17/0/0) 274193
2 backup wu 0 - 53232 409.41GB (53233/0/0) 858595057
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 34 - 53232 409.15GB (53199/0/0) 858046671
7 unassigned wm 0 0 (0/0/0) 0

It could be a Solaris bug. However the following steps may fix the issue and show the real size of the LUN.

Note:
I'm no storage expert - just outlining the steps that helped me resolving the issue. May be there are better/simpler ways to resolve this issue which I do not know yet.

Steps:

Run the following commands as root user:

# touch /reconfigure
# reboot

# format

Select the disk and check the partition table. Do you see the configured size? If yes, you are done - stop here. If not, go to the next step.

eg., continued ..
# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@0,0
1. c1t1d0
/pci@7c0/pci@0/pci@1/pci@0,2/LSILogic,sas@2/sd@1,0
2. c2t216000C0FFD7E5FBd0 <SUN-StorEdge3510-411I cyl 65533 alt 2 hd 64 sec 408>
/pci@7c0/pci@0/pci@1/pci@0,2/SUNW,qlc@1/fp@0,0/ssd@w216000c0ffd7e5fb,0
3. c2t216000C0FFD7E5FBd1 <SUN-StorEdge3510-411I cyl 47588 alt 2 hd 64 sec 255>
/pci@7c0/pci@0/pci@1/pci@0,2/SUNW,qlc@1/fp@0,0/ssd@w216000c0ffd7e5fb,1

Specify disk (enter its number): 2
selecting c2t216000C0FFD7E5FBd0
[disk formatted]
Warning: Current Disk has mounted partitions.


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit

format> p

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit

partition> p
Current partition table (original):
Total disk cylinders available: 53233 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 16 133.88MB (17/0/0) 274193
1 swap wu 17 - 33 133.88MB (17/0/0) 274193
2 backup wu 0 - 53232 409.41GB (53233/0/0) 858595057
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 34 - 53232 409.15GB (53199/0/0) 858046671
7 unassigned wm 0 0 (0/0/0) 0

In this example the issue wasn't resolved just by rebooting the server with /reconfigure file in root file system.

Now go back one level by quitting the partition table screen; and then type in the word 'type'. When you are shown the available drive types, select '0. Auto configure' option by typing 0. Usually this step would fix the issue and show the right LUN size. Just label the disk by selecting 'label' option and verify the partition table one more time to see if it is showing the right size.

eg., continued ..
partition> q

format> type

AVAILABLE DRIVE TYPES:
0. Auto configure
1. Quantum ProDrive 80S
2. Quantum ProDrive 105S
3. CDC Wren IV 94171-344
4. SUN0104
5. SUN0207
6. SUN0327
7. SUN0340
8. SUN0424
9. SUN0535
10. SUN0669
11. SUN1.0G
12. SUN1.05
13. SUN1.3G
14. SUN2.1G
15. SUN2.9G
16. Zip 100
17. Zip 250
18. Peerless 10GB
19. SUN72G
20. SUN-StorEdge3510-411I
21. SUN-StorEdge3510-411I
22. SUN-StorEdge3510-411I
23. other

Specify disk type (enter its number)[21]: 0
c2t216000C0FFD7E5FBd0: configured with capacity of 815.96GB
<SUN-StorEdge3510-411I cyl 65533 alt 2 hd 64 sec 408>
selecting c2t216000C0FFD7E5FBd0
[disk formatted]

format> current
Current Disk = c2t216000C0FFD7E5FBd0
<SUN-StorEdge3510-411I cyl 65533 alt 2 hd 64 sec 408>
/pci@7c0/pci@0/pci@1/pci@0,2/SUNW,qlc@1/fp@0,0/ssd@w216000c0ffd7e5fb,0

format> label
Ready to label disk, continue? y

format> p

PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit

partition> p
Current partition table (default):
Total disk cylinders available: 65533 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks
0 root wm 0 - 10 140.25MB (11/0/0) 287232
1 swap wu 11 - 21 140.25MB (11/0/0) 287232
2 backup wu 0 - 65532 815.96GB (65533/0/0) 1711197696
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 22 - 65532 815.69GB (65511/0/0) 1710623232
7 unassigned wm 0 0 (0/0/0) 0

partition> q

In this particular example, we can see that the issue is resolved. But in some other cases it may not fix the real issue. In such scenarios go ahead and file a bug against Solaris storage management at bugs.opensolaris.org.

Acknowledgements:
Thanks to Robert Cohen for the tip in thread: Solaris 'format' not seeing new size of LUN after expansion on SAN.
________________
Technorati Tags:
Solaris | OpenSolaris | storage
Read More
Posted in | No comments

Thursday, 16 November 2006

Solaris: Disabling Out Of The Box (OOB) Large Page Support

Posted on 01:21 by Unknown
Starting with the release of Solaris 10 1/06 (aka Solaris 10 Update 1), large page OOB feature turns on MPSS (Multiple Page Size Support) automatically for applications' data (heap) and text (libraries).

One obvious advantage of this large page OOB feature is that it improves the performance of user land applications by reducing the wastage of CPU cycles in serving iTLB and dTLB misses. For example, if the heap size of a process is 256M, on a Niagara (UltraSPARC-T1) box it will be mapped on to a single 256M page. On a system that doesn't support large pages, it will be mapped on to 32,768 8K pages. Now imagine having all the words of a story on a single large page versus having the words spread into 32,500+ small pages. Which one do you prefer?

However large page OOB feature may have negative impact on some applications - eg., application may crash due to some wrong assumption(s) about the page size {by the application} or there could be an increase in virtual memory consumption due to the way the data and libraries are mapped on to larger pages.

Fortunately Solaris provides a bunch of /etc/system tunables to enable/disable large page OOB support.

/etc/system tunables to disable large page OOB feature
  • set exec_lpg_disable = 1

    This parameter prevents large pages from being used when the kernel is allocating memory for processes being executed. These constitute the memory needed for a processes' text/data/bss.

  • set use_brk_lpg = 0

    This parameter prevents large pages from being used for heap. To enable large pages for heap, set the value of this parameter to 1 or remove this parameter from /etc/system completely.

    Note:
    brk() is the kernel routine that is called whenever a user level application invokes malloc().

  • set use_stk_lpg = 0

    This parameter disables the large pages for stack. Set it to 1 to retain the default functionality.

  • set use_zmap_lpg = 0

    This variable controls the size of anonymous (anon) pages.

  • set use_text_pgsz4m = 0

    This tunable disables the default use of 4M text pages on UltraSPARC-III/III+/IV/IV+/T1 platforms.

  • set use_text_pgsz64k = 0

    This tunable disables the default use of 64K text pages on UltraSPARC-T1 (Niagara) platform.

  • set use_initdata_pgsz64k = 0

    This tunable disables the default use of 64K data pages on UltraSPARC-T1 (Niagara) platform.

Tuning off large page OOB support for heap/stack/anon pages on-the-fly

Setting /etc/system parameters require the system to be rebooted to enable/disable large page OOB support. However it is possible to set the desired page size for heap/stack/anon pages dynamically as shown below. Note that the system goes back to the default behavior when it is rebooted. Depending on the need to turn off large page support, use mdb or /etc/system parameters at your discretion.

To turn off large page support for heap, stack and anon pages dynamically, set the following under mdb -kw:
  • use_brk_lpg/W 0 (heap)
  • use_stk_lpg/W 0 (stack)
  • use_zmap_lpg/W 0 (anon)

Note:
Java sets its own page size with memctl() interface - so, the /etc/system changes won't impact Java at all. Consider using the JVM option -XX:LargePageSizeInBytes=pagesize[K|M] to set the desired page size for Java process mappings.

How to check whether disabling large page support is really helping?

Compare the outputs of the following {along with application specific data} before and after changes:
  • vmstat 2 50 - look under free and id columns
  • trapstat -T 5 5 - check %time column
  • mdb -k and then ::memstat

How to set the maximum large page size?

Run pagesize -a to get the list of supported page sizes for your platform. Then set the page size of your choice as shown below.

% mdb -kw
Loading modules: [ unix krtld genunix specfs dtrace ufs sd ip sctp usba random fcp fctl nca lofs ssd logindmux ptm cpc sppp crypto nfs ipc ]
> auto_lpg_maxszc/W <hex_value>

where:
hex_value = { 0x0 for 8K,
0x1 for 64K,
0x2 for 512K,
0x3 for 4M,
0x4 for 32M and
0x5 for 256M }

How to check the maximum page size in use?

Here is an example from a Niagara box (T2000):
% pagesize -a
8192
65536
4194304
268435456


% mdb -kw
Loading modules: [ unix krtld genunix specfs dtrace ufs sd ip sctp usba random fcp fctl nca lofs ssd logindmux ptm cpc sppp crypto nfs ipc ]
> auto_lpg_maxszc/X
auto_lpg_maxszc:
auto_lpg_maxszc:5
> ::quit

See Also:
6287398 vm 1.5 dumps core with -d64

Acknowledgements:
Sang-Suan Sam Gam
___________________
Technorati tags:
Solaris | OpenSolaris | Sun | Performance
Read More
Posted in | No comments

Monday, 13 November 2006

Sun: OpenJDK

Posted on 00:27 by Unknown
Open source JDK, that is. Sun Microsystems did it again -- As promised during JavaOne event back in May 2006, Sun made the implementation of the Java Platform, Standard Edition, available to the community under GNU General Public License (GPLv2).

Note that only HotSpot Virtual Machine and javac (compiler) components of the earlier builds of JDK version 7 are open sourced as of now. Rest of the components will be open sourced over the time; and by the end of first half of 2007, we will have fully buildable implementation for JDK 7.

OpenJDK web site and download location

OpenJDK home page:
https://openjdk.dev.java.net/

Source code download location:
JDK 7 build 02 source code

Browsable source code

Frequently Asked Questions:
Free and Open Source Java FAQ

Related information

The following list shows Sun's presence in open source world:
OpenSolaris
OpenSPARC
OpenJDK
OpenOffice (office suite)
NetBeans (IDE)
GlassFish (Java EE 5 Application Server)
Project Looking Glass (3D desktop)
...

____________
Technorati tags:
Sun | Java | JDK | OpenJDK | Open Source
Read More
Posted in | No comments

Friday, 10 November 2006

Oracle: Explain plan & Tracing a particular SQL

Posted on 23:52 by Unknown
Scenario:
You are on a mission to fix majority of database related performance issues in production environment - so, you are actively taking snapshots of the database during peak hours and generating AWR reports for the performance data.

Now you have the list of long running SQLs under SQL ordered by Elapsed Time section of the report. One of the next steps is to trace such SQLs to see what is happening when they get executed. Since we can extract the SQL identifier (SQL Id) from the AWR report for all top SQLs, tracing can be enabled as shown below.
  1. Get the session id (sid) and serial# for the sql_id from active sessions.
    % sqlplus / as sysdba
    SQL> select sid, serial# from v$session where sql_id='<sql_id>';

    If you wish to see the corresponding SQL text, run the following:

    SQL> select sql_text from v$sql where sql_id='<sql_id>';


  2. Enable SQL tracing for any session as follows:

    SQL> exec dbms_system.set_ev(<sid>, <serial#>, 10046, <level>, '');

    Event 10046 generates detailed information on statement parsing, values of bind variables, and wait events occurred during a particular session.

    Level = 1, 4, 8 or 12. Check Diagnostic event 10046 for more information about these levels.

    To disable tracing:

    SQL> exec dbms_system.set_ev(<sid>, <serial#>, 10046, 0, '');


  3. Check the trace file(s) under udump directory.

Note:
The above steps may not make much sense with short lived sessions. An alternate option is to enable system wide tracing for all sessions as shown here:
% sqlplus / as sysdba
SQL> alter system set events '10046 trace name context forever, level level';

To disable:

SQL> alter system set events '10046 trace name context off';

I'm pretty sure that there might be better ways to collect this information. I'll update this blog entry when I find simple alternative ways.

Generating explain plan for a SQL

Explain plan will have details related to Oracle's decisions about certain things like whether to use indexes or not, or which one to use if there are more than one index. Such a plan can be generated as shown here:
SQL> set pages 100
SQL> set lines 132
SQL> select plan_table_output from table(dbms_xplan.display_cursor('<sql_id>',0));

The generated output will be something similar to:

--------------------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
--------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | 10 (100)| |
| 1 | SORT ORDER BY | | 2 | 448 | 9 (56)| 00:00:01 |
| 2 | UNION-ALL | | | | | |
| 3 | NESTED LOOPS | | 1 | 191 | 4 (0)| 00:00:01 |
|* 4 | TABLE ACCESS BY INDEX ROWID | WF_EVENT_SUBSCRIPTIONS | 1 | 118 | 3 (0)| 00:00:01 |
|* 5 | INDEX RANGE SCAN | WF_EVENT_SUBSCRIPTIONS_N1 | 1 | | 2 (0)| 00:00:01 |
|* 6 | TABLE ACCESS BY INDEX ROWID | WF_EVENTS | 1 | 73 | 1 (0)| 00:00:01 |
|* 7 | INDEX UNIQUE SCAN | WF_EVENTS_U1 | 1 | | 0 (0)| |
| 8 | NESTED LOOPS | | 1 | 257 | 5 (0)| 00:00:01 |
| 9 | NESTED LOOPS | | 1 | 223 | 5 (0)| 00:00:01 |
| 10 | NESTED LOOPS | | 1 | 191 | 4 (0)| 00:00:01 |
|* 11 | TABLE ACCESS BY INDEX ROWID| WF_EVENTS | 1 | 73 | 2 (0)| 00:00:01 |
|* 12 | INDEX UNIQUE SCAN | WF_EVENTS_U2 | 1 | | 1 (0)| 00:00:01 |
|* 13 | TABLE ACCESS BY INDEX ROWID| WF_EVENT_SUBSCRIPTIONS | 1 | 118 | 2 (0)| 00:00:01 |
|* 14 | INDEX RANGE SCAN | WF_EVENT_SUBSCRIPTIONS_N1 | 1 | | 1 (0)| 00:00:01 |
|* 15 | TABLE ACCESS BY INDEX ROWID | WF_EVENTS | 1 | 32 | 1 (0)| 00:00:01 |
|* 16 | INDEX UNIQUE SCAN | WF_EVENTS_U1 | 1 | | 0 (0)| |
|* 17 | INDEX UNIQUE SCAN | WF_EVENT_GROUPS_U1 | 1 | 34 | 0 (0)| |
--------------------------------------------------------------------------------------------------------------

Acknowledgements:
Ahmed Alomari

_______________
Technorati tags:
Oracle | Performance
Read More
Posted in | No comments

Wednesday, 8 November 2006

Oracle: Snapshots and AWR report

Posted on 00:32 by Unknown
Starting with Oracle 10g database management system, Oracle offers a set of scripts to extract performance statistics from Automatic Workload Repository (AWR) to generate a human readable report. This report will be a starting point in finding {and fixing them sometimes, almost with no additional effort} the bottlenecks in the database system.

Oracle automatically generates snapshots of the performance data once every hour and stores the statistics in the workload repository. While diagnosing some issues, it might be necessary to take several snapshots manually. create_snapshot procedure can be used to create a database snapshot manually, as shown below:

    % sqlplus / as sysdba
    SQL> exec dbms_workload_repository.create_snapshot();

Note down the date and time of all such snapshots; and use the corresponding snap IDs while generating the AWR report for a certain interval.

How to generate an AWR report?

Simply run the awrrpti.sql as shown below. The questions from the script are pretty straight forward to answer.

    sqlplus / as sysdba
    SQL> @$ORACLE_HOME/rdbms/admin/awrrpti.sql

How to interpret an AWR report?

Here are some useful resources (note that statspack interpretation is still applicable to AWR):
  • Statspack 101: Interpreting Your Statspack Report by Troy Campano
  • Interpreting the Statspack report at AskTom.com
For more information:
  • Oracle® Database Performance Tuning Guide - Automatic Workload Repository
  • Automatic Workload Repository (AWR) in Oracle Database 10g
__________
Technorati tags:
Oracle | Performance
Read More
Posted in | No comments

Monday, 16 October 2006

Solaris/SPARC: dbx style regs (registers) output

Posted on 22:50 by Unknown
Recently one of our partners requested for some help in capturing the values of all the registers at the time of a process crash. Their idea is to get all the information that is necessary for a crash dump analysis, programmatically.

It is no surprise to hear such an idea, as majority of the customers may not be interested in installing and running a long list of commands under a debugger whenever there is a process crash. If the application can gather as much information as it can about the state of the process (context of the process in OS terminology) before it goes down, customers can simply send that information back to the software vendor along with their bug report(s).

Since it is a native application, I gave them the following C code that tries to print the values of all global (g0 - g7) and output (o0 - o7) registers of SPARC, just the way dbx does with regs command. Also it prints the values of program counter (PC) and next program counter (nPC). Note that this program is not complete - it does not print the values of local (l0 - l7), input (i0 - i7) registers. Also the values of multiply/divide register (y), processor state register (psr) and the single-precision & double-precision floating-point registers (f0 - f31) are missing. I will try to enhance this code later to include all the missing pieces. However this sample program gave them some idea on how to proceed with their actual plan.

Programming example:

The following example demonstrates the process crash with SIGSEGV in 32- and 64-bit code. Correctness of this code can be verified by comparing the output of the C program with the output of regs command in dbx environment.

% cat regs.c
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <ucontext.h>

void signal_handler (int signo, siginfo_t *si, void *data)
{
ucontext_t *uc;
u_int pc;
u_int sp;
gregset_t *regs;
u_int tspage;
struct frame *fp;
int i;

uc = (ucontext_t *) data;

if (signo = SIGSEGV)
{
fprintf(stdout, "Caught signal SEGV\n");

fprintf(stderr, "\n*** SIGNAL TRAPPED: SIGNAL %d ***\n", signo);
fprintf(stderr, "si_signo = %d\n", si->si_signo);
fprintf(stderr, "si_code = %d\n", si->si_code);
fprintf(stderr, "si_errno = %d\n", si->si_errno);
fprintf(stderr, "si_addr = %p\n", si->si_addr);
fprintf(stderr, "si_trapno= %p\n", si->si_trapno);
fprintf(stderr, "si_pc = %p\n\n", si->si_pc);

fprintf(stderr, "stack info:\nsp: 0x%#016p size: %#016x flags: %d\n\n",
uc->uc_stack.ss_sp, uc->uc_stack.ss_size, uc->uc_stack.ss_flags);

fprintf(stderr, "\ng0-g1 0x0000000000000000 0x%#016p", uc->uc_mcontext.gregs[REG_G1]);
fprintf(stderr, "\ng2-g3 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_G2], uc->uc_mcontext.gregs[REG_G3]);
fprintf(stderr, "\ng4-g5 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_G4], uc->uc_mcontext.gregs[REG_G5]);
fprintf(stderr, "\ng6-g7 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_G6], uc->uc_mcontext.gregs[REG_G7]);
fprintf(stderr, "\no0-o1 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_O0], uc->uc_mcontext.gregs[REG_O1]);
fprintf(stderr, "\no2-o3 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_O2], uc->uc_mcontext.gregs[REG_O3]);
fprintf(stderr, "\no4-o5 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_O4], uc->uc_mcontext.gregs[REG_O5]);
fprintf(stderr, "\no6-o7 0x%#016p 0x%#016p", uc->uc_mcontext.gregs[REG_O6], uc->uc_mcontext.gregs[REG_O7]);
fprintf(stderr, "\npc 0x%#016p", uc->uc_mcontext.gregs[REG_PC]);
fprintf(stderr, "\nnpc 0x%#016p", uc->uc_mcontext.gregs[REG_nPC]);
printf("\n");

exit(1);
}
else
{
fprintf(stdout, "default handler\n");
}
}

int main (void)
{
char *a;
struct sigaction sa, osa;
unsigned int b = ULONG_MAX;

sa.sa_flags = SA_ONSTACK | SA_RESTART | SA_SIGINFO;
sa.sa_sigaction = signal_handler;
sigaction(SIGSEGV, &sa, &osa);

strcat(a, "dummy");
printf("\a = %s", *a);

return b;
}


32-bit code:
% /opt/SUNWspro/prod/bin/cc -o regs regs.c

%./regs
Caught signal SEGV

*** SIGNAL TRAPPED: SIGNAL 11 ***
si_signo = 11
si_code = 1
si_errno = 0
si_addr = ffffffff
si_trapno= 0
si_pc = 0

stack info:
sp: 0x00000000ff400000 size: 0x00000000800000 flags: 0

g0-g1 0x0000000000000000 0x00000000ff2b0ba0
g2-g3 0x0000000000000000 0x0000000000000000
g4-g5 0x0000000000000000 0x0000000000000000
g6-g7 0x0000000000000000 0x00000000ff3a2000
o0-o1 0x00000000ffffffff 0x00000000fffffaf0
o2-o3 0x00000000ffffffff 0x00000000ff3704f8
o4-o5 0x0000000000000003 0x00000000ff3704fc
o6-o7 0x00000000ffbfec88 0x00000000ff316130
pc 0x00000000ff2b0bb8
npc 0x00000000ff2b0bbc

Segmentation Fault (core dumped)

% /opt/SUNWspro/prod/bin/dbx regs core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
Reading regs
core file header read successfully
Reading ld.so.1
Reading libc.so.1
program terminated by signal SEGV (no mapping at the fault address)
0xffffffffffffffff:

(dbx) up
0xff2c075c: _exithandle+0x003c: call %l7

(dbx) up
0xff2af080: exit+0x0004: call _PROCEDURE_LINKAGE_TABLE_+0xd8 [PLT] ! 0xff36935c

(dbx) up
0x00010e1c: signal_handler+0x0194: call exit [PLT] ! 0x21114

(dbx) up
0xff33fec8: __sighndlr+0x000c: call %i3

(dbx) up
0xff2b0bb8: strlen+0x0018: ldub [%o2], %o1

(dbx) where
[1] 0x6d6d7900(0xffbfe728, 0x1084, 0x0, 0x0, 0x4, 0x0), at 0x6d6d7900
[2] _exithandle(0xff36db80, 0xff3a6475, 0xff36cbc0, 0x0, 0xff3a2000, 0xffbfe950), at 0xff2c075c
[3] exit(0x1, 0x21258, 0x0, 0x21276, 0xff368284, 0x1), at 0xff2af080
[4] signal_handler(0xb, 0xffbfec08, 0xffbfe950, 0x0, 0xff3a2000, 0xffbfe950), at 0x10e1c
[5] __sighndlr(0xb, 0xffbfec08, 0xffbfe950, 0x10c88, 0x0, 0x1), at 0xff33fec8
---- called from signal handler with signal 11 (SIGSEGV) ------
=>[6] strlen(0xffffffff, 0xfffffaf0, 0xffffffff, 0xff3704f8, 0x3, 0xff3704fc), at 0xff2b0bb8
[7] _ndoprnt(0x110d2, 0xffbff9c4, 0xffbff241, 0xffffffff, 0x0, 0x0), at 0xff316130
[8] printf(0x110cc, 0x21258, 0x0, 0x21276, 0xff368284, 0x0), at 0xff3182dc
[9] main(0x1, 0xffbffa8c, 0xffbffa94, 0x21000, 0xff3a00c0, 0xff3a0100), at 0x10e90

(dbx) regs
current frame: [6]
g0-g1 0x00000000 0x00000000 0x00000000 0xff2b0ba0
g2-g3 0x00000000 0x00000000 0x00000000 0x00000000
g4-g5 0x00000000 0x00000000 0x00000000 0x00000000
g6-g7 0x00000000 0x00000000 0x00000000 0xff3a2000
o0-o1 0x00000000 0xffffffff 0x00000000 0xfffffaf0
o2-o3 0x00000000 0xffffffff 0x00000000 0xff3704f8
o4-o5 0x00000000 0x00000003 0x00000000 0xff3704fc
o6-o7 0x00000000 0xffbfec88 0x00000000 0xff316130

l0-l1 0x00000000 0x00000073 0x00000000 0x00000000
l2-l3 0x00000000 0x00000000 0x00000000 0x00001000
l4-l5 0x00000000 0x00000000 0x00000000 0x00000000
l6-l7 0x00000000 0xff36bf69 0x00000000 0xff3708f8
i0-i1 0x00000000 0x000110d2 0x00000000 0xffbff9c4
i2-i3 0x00000000 0xffbff241 0x00000000 0xffffffff
i4-i5 0x00000000 0x00000000 0x00000000 0x00000000
i6-i7 0x00000000 0xffbff918 0x00000000 0xff3182dc
y 0x00000000 0x00000000
ccr 0x00000000 0x00000000
pc 0x00000000 0xff2b0bb8
:strlen+0x18 ldub [%o2], %o1
npc 0x00000000 0xff2b0bbc
:strlen+0x1c tst %o1


64-bit code:
% /opt/SUNWspro/prod/bin/cc -o regs64 -xarch=v9 regs.c

%./regs64
Caught signal SEGV

*** SIGNAL TRAPPED: SIGNAL 11 ***
si_signo = 11
si_code = 1
si_errno = 0
si_addr = ffffffffffffffff
si_trapno= 0
si_pc = 0

stack info:
sp: 0xffffffff7f800000 size: 0x00000000800000 flags: 0

g0-g1 0x0000000000000000 0xffffffff7f239940
g2-g3 0x0000000000000000 0x0000000000000000
g4-g5 0xfffffffffffffad8 0x0000000000000202
g6-g7 0x0000000000000000 0xffffffff7f402000
o0-o1 0xffffffffffffffff 0x0000000000000053
o2-o3 0xffffffffffffffff 0x0000000000000000
o4-o5 0x0000000000000003 0x0000000000000053
o6-o7 0xffffffff7fffe171 0xffffffff7f2a2b54
pc 0xffffffff7f239958
npc 0xffffffff7f23995c

Segmentation Fault (core dumped)

% /opt/SUNWspro/prod/bin/dbx regs64 core
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc
Reading regs64
core file header read successfully
Reading ld.so.1
Reading libc.so.1
program terminated by signal SEGV (no mapping at the fault address)
0xffffffff7f249240: _exithandle+0x0044: call %l6

(dbx) up
0xffffffff7f237d10: exit+0x0004: call _PROCEDURE_LINKAGE_TABLE_+0x200 [PLT] ! 0xffffffff7f3e6700

(dbx) up
0x0000000100000b3c: signal_handler+0x01ac: call exit [PLT] ! 0x100100fa0

(dbx) up
0xffffffff7f2cd0bc: __sighndlr+0x000c: call %i3

(dbx) up
0xffffffff7f239958: strlen+0x0018: ldub [%o2], %o1

(dbx) where
[1] _exithandle(0xffffffff7f3eff00, 0xffffffff7fffe170, 0xffffffff7f3eef40, 0xd, 0x0, 0xffffffff7fffe590), at 0xffffffff7f249240

[2] exit(0x1, 0x2000, 0x0, 0x1001012e4, 0xffffffff7f3e4000, 0x1), at 0xffffffff7f237d10
[3] signal_handler(0xb, 0xffffffff7fffe870, 0xffffffff7fffe590, 0xd, 0x0, 0xffffffff7fffe590), at 0x100000b3c
[4] __sighndlr(0xb, 0xffffffff7fffe870, 0xffffffff7fffe590, 0x100000990, 0x0, 0xa), at 0xffffffff7f2cd0bc
---- called from signal handler with signal 11 (SIGSEGV) ------
=>[5] strlen(0xffffffffffffffff, 0x53, 0xffffffffffffffff, 0x0, 0x3, 0x53), at 0xffffffff7f239958
[6] _ndoprnt(0x100000e46, 0xffffffff7ffff878, 0xffffffff7f2a0de4, 0xffffffff7fffefc9, 0xffffffffffffffff, 0x100000e45), at 0xffffffff7f2a2b54

[7] printf(0x100000e40, 0x2000, 0x0, 0x1001012e4, 0xffffffff7f3e4000, 0x0), at 0xffffffff7f2a4de0
[8] main(0x1, 0xffffffff7ffff9b8, 0xffffffff7ffff9c8, 0x0, 0xffffffffffffffff, 0xffffffff7f400100), at 0x100000bc4

(dbx) regs
current frame: [5]
g0-g1 0x0000000000000000 0xffffffff7f239940
g2-g3 0x0000000000000000 0x0000000000000000
g4-g5 0xfffffffffffffad8 0x0000000000000202
g6-g7 0x0000000000000000 0xffffffff7f402000
o0-o1 0xffffffffffffffff 0x0000000000000053
o2-o3 0xffffffffffffffff 0x0000000000000000
o4-o5 0x0000000000000003 0x0000000000000053
o6-o7 0xffffffff7fffe171 0xffffffff7f2a2b54

l0-l1 0x0000000000000000 0x0000000000000073
l2-l3 0x0000000000000000 0x0000000000000000
l4-l5 0x0000000000001000 0x0000000000000000
l6-l7 0x0000000000000000 0xffffffff7f3ede21
i0-i1 0x0000000100000e46 0xffffffff7ffff878
i2-i3 0xffffffff7f2a0de4 0xffffffff7fffefc9
i4-i5 0xffffffffffffffff 0x0000000100000e45
i6-i7 0xffffffff7fffef41 0xffffffff7f2a4de0
y 0x0000000000000000
ccr 0x0000000000000000
pc 0xffffffff7f239958
:strlen+0x18 ldub [%o2], %o1
npc 0xffffffff7f23995c
:strlen+0x1c tst %o1


Note:
You might have noticed that the value of global register, g0, is hard coded to 0. The primary reason being the first global register (g0 on SPARC) is the assembly language equivalent of /dev/null. No matter what you try to put into this register, the value always remain zero.

To DO://
  1. Enhance the above code to include input, local, floating-point registers. Also print the actual instructions of program counter (PC) and next program counter (nPC)
  2. Post similar code for x86/x64 architecture

__________
Technorati tags:
Solaris | SPARC | dbx
Read More
Posted in | No comments

Saturday, 14 October 2006

My favorite fictional characters

Posted on 23:02 by Unknown
Although majority of my acquaintances make fun of me watching TV-Y/TV-Y7 television rating cartoon shows, I still prefer watching simple, short, clean and colorful cartoon shows over long, overly-hyped yet insipid sagas on celluloid. Thought I'd introduce some of my favorite fictitious characters from cartoon shows and comic strips - so, here they are: (courtesy: wikipedia.org)

























Garfield
Garfield comic strip


Tom & Jerry
Tom and Jerry


Stewie Griffin (Stewie)
Family Guy


Blooregard Q. Kazoo (Bloo)
Foster's Home for Imaginary Friends


Bender Bending Rodríguez (Bender)
Futurama


Bugs Bunny
Looney Tunes


Pointy haired boss (PHB)
Dilbert comic strip


Norville Shaggy Rogers & Scoobert Scooby-Doo (Shaggy & Scooby)
Scooby-Doo, Where Are You?


Mandy
The Grim Adventures of Billy and Mandy
(definitely not one of my favorite shows)
Read More
Posted in | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • UNIX/Linux: File Permissions (chmod)
    A file's permissions are also known as its 'mode'; so to change them we need to use the 'chmod' command (change mode). T...
  • C/C++/Java: ++ unary operator
    #include <stdio.h> int main() { int i = 5, j = 5; int total = 0; total = ++i + j++; printf("\ntotal o...
  • C++: Virtual Function
    A virtual function allows derived classes to replace the implementation provided by the base class. The compiler makes sure the replacemen...
  • Achievement Award
    Got an Achievement Award/Certificate from Sun Microsystems, in recognition for my effort with Siebel Benchmark!! =:) Related post: http:...
  • C/C++: Structure Vs Union
    A structure is a collection of items of different types; and each data item will have its own memory location. Where as only one item withi...
  • Database: Oracle Server Architecture (overview)
    Oracle server consists of the following core components: 1) database(s) & 2) instance(s) 1) database consists of: 1) datafil...
  • Solaris/C/C++: Benefit(s) of Linker (symbol) Scoping
    Introduction By default, the static linker (ld) makes all ELF symbols global in scope. This means it puts the symbols into the dynamic symbo...
  • Linux: Frozen Xwindows
    If Xwindows seem frozen, the following simple key strokes may bring back the Xserver without the need for a reboot Two ways to kill the Xwi...
  • PHP: Memory savings with mysqlnd
    mysqlnd may save memory. In the best cases, it may consume only 50% memory as that of libmysql esp. when the client application does not mod...
  • Blast from the Past : The Weekend Playlist #3
    The 80s contd., The 80s witnessed the rise of fine talent - so, it is only fitting to dedicate another complete playlist for the 80s. Her...

Categories

  • 80s music playlist
  • bandwidth iperf network solaris
  • best
  • black friday
  • breakdown database groups locality oracle pmap sga solaris
  • buy
  • deal
  • ebiz ebs hrms oracle payroll
  • emca oracle rdbms database ORA-01034
  • friday
  • Garmin
  • generic+discussion software installer
  • GPS
  • how-to solaris mmap
  • impdp ora-01089 oracle rdbms solaris tips upgrade workarounds zombie
  • Magellan
  • music
  • Navigation
  • OATS Oracle
  • Oracle Business+Intelligence Analytics Solaris SPARC T4
  • oracle database flashback FDA
  • Oracle Database RDBMS Redo Flash+Storage
  • oracle database solaris
  • oracle database solaris resource manager virtualization consolidation
  • Oracle EBS E-Business+Suite SPARC SuperCluster Optimized+Solution
  • Oracle EBS E-Business+Suite Workaround Tip
  • oracle lob bfile blob securefile rdbms database tips performance clob
  • oracle obiee analytics presentation+services
  • Oracle OID LDAP ADS
  • Oracle OID LDAP SPARC T5 T5-2 Benchmark
  • oracle pls-00201 dbms_system
  • oracle siebel CRM SCBroker load+balancing
  • Oracle Siebel Sun SPARC T4 Benchmark
  • Oracle Siebel Sun SPARC T5 Benchmark T5-2
  • Oracle Solaris
  • Oracle Solaris Database RDBMS Redo Flash F40 AWR
  • oracle solaris rpc statd RPC troubleshooting
  • oracle solaris svm solaris+volume+manager
  • Oracle Solaris Tips
  • oracle+solaris
  • RDC
  • sale
  • Smartphone Samsung Galaxy S2 Phone+Shutter Tip Android ICS
  • solaris oracle database fmw weblogic java dfw
  • SuperCluster Oracle Database RDBMS RAC Solaris Zones
  • tee
  • thanksgiving sale
  • tips
  • TomTom
  • windows

Blog Archive

  • ▼  2013 (16)
    • ▼  December (3)
      • Blast from the Past : The Weekend Playlist #3
      • Measuring Network Bandwidth Using iperf
      • Blast from the Past : The Weekend Playlist #2
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (2)
    • ►  January (1)
  • ►  2012 (14)
    • ►  December (1)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (2)
  • ►  2011 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2010 (19)
    • ►  December (3)
    • ►  November (1)
    • ►  October (2)
    • ►  September (1)
    • ►  August (1)
    • ►  July (1)
    • ►  June (1)
    • ►  May (5)
    • ►  April (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (25)
    • ►  December (1)
    • ►  November (2)
    • ►  October (1)
    • ►  September (1)
    • ►  August (2)
    • ►  July (2)
    • ►  June (1)
    • ►  May (2)
    • ►  April (3)
    • ►  March (1)
    • ►  February (5)
    • ►  January (4)
  • ►  2008 (34)
    • ►  December (2)
    • ►  November (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (4)
    • ►  July (2)
    • ►  June (3)
    • ►  May (3)
    • ►  April (2)
    • ►  March (5)
    • ►  February (4)
    • ►  January (4)
  • ►  2007 (33)
    • ►  December (2)
    • ►  November (4)
    • ►  October (2)
    • ►  September (5)
    • ►  August (3)
    • ►  June (2)
    • ►  May (3)
    • ►  April (5)
    • ►  March (3)
    • ►  February (1)
    • ►  January (3)
  • ►  2006 (40)
    • ►  December (2)
    • ►  November (6)
    • ►  October (2)
    • ►  September (2)
    • ►  August (1)
    • ►  July (2)
    • ►  June (2)
    • ►  May (4)
    • ►  April (5)
    • ►  March (5)
    • ►  February (3)
    • ►  January (6)
  • ►  2005 (72)
    • ►  December (5)
    • ►  November (2)
    • ►  October (6)
    • ►  September (5)
    • ►  August (5)
    • ►  July (10)
    • ►  June (8)
    • ►  May (9)
    • ►  April (6)
    • ►  March (6)
    • ►  February (5)
    • ►  January (5)
  • ►  2004 (36)
    • ►  December (1)
    • ►  November (5)
    • ►  October (12)
    • ►  September (18)
Powered by Blogger.

About Me

Unknown
View my complete profile