Mandalika's scratchpad [ Work blog @Oracle | My Music Compositions ]

Old Posts: 09.04  10.04  11.04  12.04  01.05  02.05  03.05  04.05  05.05  06.05  07.05  08.05  09.05  10.05  11.05  12.05  01.06  02.06  03.06  04.06  05.06  06.06  07.06  08.06  09.06  10.06  11.06  12.06  01.07  02.07  03.07  04.07  05.07  06.07  08.07  09.07  10.07  11.07  12.07  01.08  02.08  03.08  04.08  05.08  06.08  07.08  08.08  09.08  10.08  11.08  12.08  01.09  02.09  03.09  04.09  05.09  06.09  07.09  08.09  09.09  10.09  11.09  12.09  01.10  02.10  03.10  04.10  05.10  06.10  07.10  08.10  09.10  10.10  11.10  12.10  01.11  02.11  03.11  04.11  05.11  07.11  08.11  09.11  10.11  11.11  12.11  01.12  02.12  03.12  04.12  05.12  06.12  07.12  08.12  09.12  10.12  11.12  12.12  01.13  02.13  03.13  04.13  05.13  06.13  07.13  08.13  09.13  10.13  11.13  12.13  01.14  02.14  03.14  04.14  05.14  06.14  07.14  09.14  10.14  11.14  12.14  01.15  02.15  03.15  04.15  06.15  09.15  12.15  01.16  03.16  04.16  05.16  06.16  07.16  08.16  09.16  12.16  01.17  02.17  03.17  04.17  06.17  07.17  08.17  09.17  10.17  12.17  01.18  02.18  03.18  04.18  05.18  06.18  07.18  08.18  09.18  11.18  12.18  01.19  02.19  05.19  06.19  08.19  10.19  11.19  05.20  10.20  11.20  12.20  09.21  11.21  12.22 


Friday, April 28, 2006
 
The Reason Is You

Earlier I was watching television in my usual desultory fashion and happen to catch some part of Hoobastanks latest video If I were you on MTV-2. Even though I wasn't impressed much with this song, I felt nostalgic for a while, as it just happened to be the same band's single, The Reason, was in my top singles list of 2004. I guess it was released in 2003, but in heavy rotation for more than an year in many FM stations.

Whenever I spend a lot of time sitting in front of my laptop doing some work, I prefer to tune into our local (San Francisco) radio station Star 101.3, for some decent music. While I was working on our record breaking Sun-Siebel benchmark, I got a chance to hear pretty good (and nice) singles like Hoobastank's The Reason, Lionel Richie's Just For You, Matchbox 20's Unwell, countless times; and they are sort of stuck in my head since then. All the above mentioned songs have great vocals with not so noisey music. Since my half dead brain is in an oblivious state (I am not drunk. I'm not a boozer -- feeling not so well, just to clarify) and refusing to co-operate in putting together some useful content, I chose to post the lyrics of The Reason and Just For You, for the second time in a row.

HOOBASTANK - THE REASON
(courtesy: absolutelyrics.com)
Listen to a 30 sec preview at: last.fm

I'm not a perfect person
As many things I wish I didn't do
But I continue learning
I never meant to do those things to you
And so I have to say before I go
That I just want you to know

I've found a reason for me
To change who I used to be
A reason to start over new
And the reason is you


I'm sorry that I hurt you
It's something I must live with everyday
And all the pain I put you through
I wish that I could take it all away
And be the one who catches all your tears
That's why I need you to hear

I've found a reason for me
To change who I used to be
A reason to start over new
And the reason is you

And the reason is you
And the reason is you
And the reason is you

I'm not a perfect person
I never meant to do those things to you
And so I have to say before I go
That I just want you to know

I've found a reason for me
To change who I used to be
A reason to start over new
And the reason is you

I've found a reason to show
A side of me you didn't know
A reason for all that I do
And the reason is you


LIONEL RICHIE - JUST FOR YOU
(courtesy: azlyrics.com)

Golden days
Night was play
Pain was all a world away
We went to school
We learned the rules
We trusted all they had to say

Then life took a turn
We all had to learn
And we cant go back again


And my heart is breaking
Just for you
Just for you
And my arms are open
Just for you
Just for you
Just for you

God was God
And dreams were dreams
Life was all pecan ice cream
Truth was true
And lies were lies
And we thought love would never die
But the world moved on
My illusions gone
And I don't know who to blame

And my heart is breaking
Just for you
Just for you
And my arms are open
Just for you
Just for you
And these tears I'm crying are for you
Just for you
Just for you

I'm looking for protection
Give me shelter from the storm
I just hope this light inside me
Keeps me strong

And my heart is breaking
Just for you
Just for you
And my arms they're open
Just for you
Just for you
And these tears I'm crying are for you
Just for you
Just for you

Just for you
Oh my heart is breaking
And my arms are open
Oh these tears I'm crying are just for you

Oh yeah

______________
Technorati tag:


Sunday, April 23, 2006
 
Make a noise and make it clear

I am not saying that - John Farnham did, in his 1986 single You're The Voice. I found this incredible song in the audio CD, Greenpeace: Rainbow Warriors, that I borrowed from our local library. I can't get it out of my head ever since I heard it for the very first time. This song has got a nice lyric, great vocals, very cool chorus and superb music. I'm afraid I am going deaf playing it so loud; and of course there is fairly an equal chance of going dumb, as I am bellowing along and straining my vocal folds/cords.

Here's the song verbatim (Courtesy: Leoslyrics.com):
JOHN FARNHAM - YOU'RE THE VOICE

We have the chance to turn the pages over
We can write what we want to write

We gotta make ends meet before we get much older
We're all someone's daughter
We're all someone's son
How long can we look at each other
Down the barrel of a gun?

You're the voice, try and understand it
Make a noise and make it clear

Oh-wo-wo-wo, oh-wo-wo-wo (chorus)
We're not gonna sit in silence
We're not gonna live with fear

Oh-wo-wo-wo, oh-wo-wo-wo (chorus)

This time we know we call can stand together
With the power to be powerful
Believing we can make it better
We're all someone's daughter
We're all someone's son
How long can we look at each other
Down the barrel of a gun?
______________
Technorati tag:


Thursday, April 20, 2006
 
Solaris: NULL pointer bugs & /usr/lib/0@0.so.1 library

Some programmers assume that a NULL character pointer is the same as a pointer to a NULL string. However de-referencing a NULL pointer (ie., location 0x00000000 in the address space of a 32-bit process) results in a segmentation fault on Solaris; and hence the process dies with a signal SEGV. On Solaris, typically application text loads at 0x00001000. All the address space between 0x00000000 and 0x0000FFFF (that is about 64K of address space) is not used. I still need to find out why?. [Update: 04/26/06] According to Chris, first few pages were intentionally unmapped to catch poorly written code. Thanks Chris.

The following simple C program illustrates the NULL pointer de-referencing, and the subsequent process crash:
 % cat strlen.c
 #include <stdio.h>
 #include <string.h>

 int main()
 {
  char *string = NULL;

  printf("\nString length = %d", strlen(string));
  return (0);
 }

 % cc -g -o strlen strlen.c

 % ./strlen
 Segmentation Fault (core dumped)

 % dbx strlen core
 Reading strlen
 core file header read successfully
 Reading ld.so.1
 Reading libc.so.1
 Reading libdl.so.1
 Reading libc_psr.so.1
 program terminated by signal SEGV (no mapping at the fault address)
 0xff2b44e4: strlen+0x0080: ld [%o1], %o2
 Current function is main
  8 printf("\nString length = %d", strlen(string));


 (dbx) print $o1
 $o1 = 0

 (dbx) where
  [1] strlen(0x0, 0x0, 0x36a2c, 0x7efefeff, 0x81010100, 0xff3cdc4c), at 0xff2b44e4
 =>[2] main(), line 8 in "strlen.c"

 (dbx) whatis string
 char *string;

 (dbx) examine string
 0x00000000: 0x00000000

 (dbx) regs
 current frame: [2]
 g0-g1 0x00000000 0x00000000 0x00000000 0xff2b4464
 g2-g3 0x00000000 0x00000000 0x00000000 0x00000000
 g4-g5 0x00000000 0x00000000 0x00000000 0x00000000
 g6-g7 0x00000000 0x00000000 0x00000000 0x00000000
 o0-o1 0x00000000 0x00000000 0x00000000 0x00000000
 o2-o3 0x00000000 0x00036a2c 0x00000000 0x7efefeff
 o4-o5 0x00000000 0x81010100 0x00000000 0xff3cdc4c
 o6-o7 0x00000000 0xffbff8b8 0x00000000 0x00010c14
 l0-l1 0x00000000 0x00000000 0x00000000 0x00010c70
 l2-l3 0x00000000 0xff342070 0x00000000 0x00000000
 l4-l5 0x00000000 0x00000000 0x00000000 0x00000000
 l6-l7 0x00000000 0x00000000 0x00000000 0xff3ee7c4
 i0-i1 0x00000000 0x00000001 0x00000000 0xffbff984
 i2-i3 0x00000000 0xffbff98c 0x00000000 0x00020c00
 i4-i5 0x00000000 0x00000000 0x00000000 0x00000000
 i6-i7 0x00000000 0xffbff920 0x00000000 0x000107d0
 y 0x00000000 0x00000000
 ccr 0x00000000 0xfe400006
 pc 0x00000000 0x00010c14:main+0x14 call strlen [PLT] ! 0x20cdc
 npc 0x00000000 0xff2b44e8:strlen+0x84 inc 4, %o1

Observe that dbx is actually showing six arguments (addresses) instead of just one argument that is the address of the string being passed to this routine. These six arguments are the registers %o0 to %o5 which hold the outgoing arguments. You can match the arguments to strlen() in the call stack with the addresses in regs output. Note that the registers %i0 to %i5 hold the incoming arguments.

How to prevent the crash?

The recommended way is to modify the source code. The quick and dirty way is to pre-load the Solaris specific /usr/lib/0@0.so.1 library into process address space. /usr/lib/0@0.so.1 is an user compatibility library that Sun started shipping with Solaris 2.6, provides a mechanism that will cause location 0x00000000 {for 32-bit processes} to be mapped to a valid address containing the value 0. Note that the address 0x00000000 (or 0x0 in short) of the virtual address space is not mapped, by default.

eg.,
 % setenv LD_PRELOAD_32 /usr/lib/0@0.so.1

 %./strlen
 String length = 0

Read man page of run-time linker, ld.so.1, for more.

Acknowledgements:
Jim Fiori
___________________
Technorati tags: | |


Saturday, April 15, 2006
 
Building Enterprise Applications with Sun Studio Profile Feedback

article on Sun Developer Network (SDN) can be accessed through the URL:
http://developers.sun.com/prodtech/cc/articles/building.html

Many thanks to Chris Aoki, Mukesh Kapoor, Richard Friedman and Dr. SG, for their time and effort in reviewing and suggesting changes to this document.

Needless to say, the content of this article is a concoction of technical material from my earlier blog posts:

Sun Studio C/C++: Profile Feedback Optimization
Sun Studio C/C++: Profile Feedback Optimization II
Sun Studio 11: Asynchronous Profile Feedback Data Collection
Sun Studio C/C++: PFO - single feedbin for all executables
___________________
Technorati tags: | |


Thursday, April 13, 2006
 
My Favorite Music VI

Appending few more to the incessant list of my favorite singles .. Parts of this list are at: I | II | III | IV | V.

Aerosmith - Crazy
Blind Melon - No Rain
Bow Wow Wow - I Want Candy
Buster Poindexter - Hot Hot Hot
CC Music Factory - Gonna Make You Sweat
      (Everybody Dance Now)

Carl Douglas -Kung Fu Fighting
Chic - Le Freak
Collective Soul - Under Heavens Skies
Craig David - Seven Days
Daniel Powter - Bad Day
Deep Blue - Breakfast At Tiffany's
Desree - You Gotta Be
Devo - Whip It
Eddie Money - Take Me Home Tonight
Eric Clapton - Layla
Everything But The Girl - Missing
Falco - Rock Me Amadeus
Frankie Goes To Hollywood - Relax
Franz Ferdinand - Take Me Out
George Michael - Faith
George Michael - Freedom
Georgia Satellites - Keep Your Hands To Yourself
Goo Goo Dolls - Better Days
Groove Terminator - How Life Should Be
      (ref: Progressive Auto Insurance commercial)
Harold Faltermeyer - AxelF
House Of Pain - Jump Around
INXS - Guns In The Sky
INXS - Need You Tonight
INXS - Pretty Vegas
James Blunt - You Are Beautiful
Janet Jackson - Rhythm Nation
Jennifer Lopez - Play
John Couger Mellencamp - Crumblin Down
John Farnham - You're The Voice
Journey - Don't Stop Believein'
KC And The Sunshine Band - Thats The Way I Like It
Kajagoogoo - Too Shy
Kasabian - LSF
Kid Rock - Bawitdaba
Killers - All These Things That I've Done
Killers - Somebody Told Me

Kinks - You Really Got Me
M-Pop - Muzik
Madonna - Cherish
Madonna - Crazy For You
Madonna - Material Girl
Madonna - Vogue
Madonna - Into The Groove
Marcy Play Ground - Sex And Candy
Melissa Etheridge - I'm The Only One
Meredith Brooks - Bitch
Natalie Merchant - Carnival
OMC - How Bizarre
PM Dawn - Set Adrift On Memory Bliss
Peter Gabriel - Kiss That Frog
Prince - Cream
Prince - Delirious
Prodigy - Diesel Power
Prodigy - Narayan
Rammstein - Mein Teil
Rebirth Of Slick - Cool Like Dat
Redhot Chili Peppers - Zephyr Song
Richard Marx - Right Here Waiting For You
Ringside - Struggle
Rob Base - It Takes Two
Rockwell - Somebody's Watching Me
Sister Sledge - We Are Family
Slipknot - Spit It Out
Snow - Informer
Sound Garden - Spoon Man
Spandau Ballet - True
Sting - Fields Of Gold
Sting - If I Ever Lose My Faith In You
Switchfoot - Dare You To Move
Take That - Never Forget
The Verve - Bitter Sweet Symphony
The Vines - Ride
Tom Tom Club - Genius Of Love
Toni Basil - Mickey
Train - Cab
Turtles - Happy Together
Twisted Sister - We Are Not Gonna Take It
Van McCoy - The Hustle
Vicki Sue Robinson - Turn The Beat Around
________________
Technorati tag:



2004-2019 

This page is powered by Blogger. Isn't yours?