Jeremy Uejio's BlogJeremy Uejio's Weblog |
|
Tuesday Jul 29, 2008
LiveUSB creator for fedora
The application lets you choose from a couple of different Fedora releases to download and it downloads and creates the USB all in one step. If the USB create fails for some reason, it doesn't have to download the image again and it lets you continue on after correcting the error. In my case, my flash drive was not FAT formatted, so after correcting that and refreshing the target device in their GUI, I continued with the USB creation. The liveUSB booted fine on my Acer 3400. Now, why can't creating an OpenSolaris liveUSB be that easy? Posted at 12:46PM Jul 29, 2008 by uejio in Sun | Comments[1]
Sunday Jul 20, 2008
Ukulele Underground!
About a year ago, I posted some ukulele links. Well, that list of links has turned into just one link:
That's http://ukuleleunderground.com. I'm a sustaining engineer and not particularly good at marketing, but this website has everything you ever need for learning to play the ukulele or just enjoying ukulele music. There's tutorials on the front page, you can buy a CD of original ukulele music, and the best part are the pointers in the forum to all the cool ukulele videos on youtube and to some really interesting discussions. See if you can find which user is me... The folks who created the website are on tour in California this week. They spent three days in San Francisco, CA playing at Mike DeSilva's in Berkeley on Friday night and then at the Hukilau in SF on Sunday night. I also got to jam with them until the wee hours of the morning on Saturday night. They will be playing in San Diego, California on July 21, 22, and 23. (See the website for the exact place and times.) If you like the ukulele, you'll love ukuleleunderground.com even more! If there are any ukulele players at Sun, please contact me and we can get together to jam sometime! Posted at 11:34PM Jul 20, 2008 by uejio in General | Comments[4]
Wednesday Jul 16, 2008
OpenSolaris on an iPod Touch (via VNC)
Not sure if this would actually be usable, but here it is:
This is using an iPod Touch that I bought a few months ago running the 2.0 Update and running a free VNC app from the App Store. OpenSolaris 2008.05 in running on a Sun Ultra 20. I had to enable XDMCP in gdm by editing the file /etc/X11/gdm/custom.conf and changing the xdmcp section to read: [xdmcp] Hm... This looks just like OpenSolaris. "How do I know that you're running on an iTouch?", one might ask. The only difference is those three buttons on the bottom of the image. The keyboard button brings up keyboard input:
Trust me. I really do have my iTouch running a VNC app and displaying OpenSolaris 2008.05. It really works! Posted at 10:13PM Jul 16, 2008 by uejio in Sun |
Wednesday Jul 02, 2008
simple DTrace script to print function argument
Someone asked me for a DTrace script to print out the
argument to an arbitrary function. I'm not exactly sure if this is what
he meant, so I wrote a script which lets you specify a function name and
the position of the string argument that you want printed out and then
the command to run. Since it's a script, you can modify to print out
integer args or to connect to a running process, etc...
Posted at 08:36AM Jul 02, 2008 by uejio in Sun |
Thursday Jun 05, 2008
Difference between deadbeef and baddcafe
No, this is not a posting about food poisoning at a restaurant. It's about my experience with libumem. libumem is a very useful and fast preload library for detecting memory corruption and memory leaks. I was working on a bug where the Xserver crashes, but only under libumem. The stack trace showed that a particular function was being called with the first argument equal to "deadbeef". Something like: (dbx) where =>[1] SizeDeviceInfo(0xdeadbeef, 0xffbfed44, 0xffbfed40, 0x1f, 0x58, 0x52d1c8), at 0xff0ee260 [2] ProcXListInputDevices(0xda1188, 0x1, 0xffbfed44, 0xdeadbeef, 0xff102000, 0xffbfed40), at 0xff0ee0f8 Well, actually it is 0xdeadbeef. This is a special constant that libumem uses. I thought it was for an uninitialized variable and kept looking for that in the code, but I couldn't find it. But, after reading the manpage for umem_debug(3MALLOC) it turns out that the constant for uninitialized variables is "baddcafe". "deadbeef" is used to show that a chunk of memory has been freed. So, basically I was trying to access freed memory. So, it was just a matter of stepping thru the code and looking to see where the memory got freed. Here's a link to someone else's experience with libumem and accessing freed memory. I should really blog more about using mdb and libumem one of these days... Posted at 09:37AM Jun 05, 2008 by uejio in Sun | Comments[3]
Sunday May 04, 2008
Another acronym for JAVA
I went to DC a couple of weeks ago and at the Cherry Blossom Festival, I saw sign that said "JAVA", but it wasn't from Sun: Their website is at javadc.org. From their about page: "This is an umbrella website representing a number of Japanese American Veterans' organizations throughout the United States." It looks like some sites are still under construction, but have a look anyway. Posted at 12:17AM May 04, 2008 by uejio in Sun |
Wednesday Dec 05, 2007
Favorite Podcasts for December 2007
I was talking to some coworkers at lunch the other day about my favorite podcasts, so here's an updated list for December 2007 (I still use iTunes to subscribe to them, but I put links for more information): Daily Giz Wiz - Dick DeBartolo and Leo Laporte review gadgets Monday thru Friday WNYC's Radio Lab - sometimes contains material not suitable for young children NPR Shuffle - an assortment of news from NPR (National Public Radio) Wait Wait... Don't Tell Me! - NPR quiz show net@nite - Web 2.0 stuff with Leo Laporte and Amber MacArthur. I really like that they put all the links that they discuss on their website. Jumping Monkeys - A parenting podcast with Leo Laporte and Megan Morrone While compiling the links above, I noticed that NPR has a huge assortment of podcasts which I really need to explore. Posted at 11:26PM Dec 05, 2007 by uejio in Audio | Corrupted BIOS on laptop
As a computer geek, I often get calls from friends or relatives for help with their PC issues. I'm no PC expert, but knowing about Solaris and Sun hardware seems to transfer well to other computer systems and especially how to search the Internet goes a long way. This evening, my nephew who goes to UCB (you know who you are...), called with a "simple" computer problem. His Compaq Presario laptop shutoff several times because it was out of power and now it doesn't boot. It just hangs at the Windows logo. So, the first thing we tried is to boot in Safe Mode. Well, that also didn't work. Infact, all the Safe Mode options hung. Next, is try the Window XP CD. That also hung. A quick search of the internet yielded several suggestions and one site said to take the battery out and boot with only the AC adapter plugged in. That worked! I guess his laptop BIOS got corrupted somehow and removing the battery allows it to get reset. Well, that was easy. Posted at 11:04PM Dec 05, 2007 by uejio in General | Comments[1]
Wednesday Nov 14, 2007
DTrace Tutorial for X Window Programmers
Here's some notes on a DTrace presentation I gave to our desktop sustaining group. It's geared towards application debugging esp. for X Window System programmers and not for kernel debugging. DTrace is usually thought of as a tool for kernel debugging. However, I
have found it very useful for user level debugging, too. It's especially
useful when first debugging an issue that you don't know where to begin
and for issues involving applications that are already running.
Useful One-liners:
Here are some one-liners for client debugging. There are a number
of useful ones from Brendan Gregg's website at:
dtrace -qn 'syscall::exec*:return { printf("%Y %s\n",walltimestamp,curpsinfo->pr_psargs); }'
If I run gnome-terminal, I see the following output: 2007 Nov 14 16:56:17 gnome-terminal 2007 Nov 14 16:56:18 gnome-pty-helper 2007 Nov 14 16:56:18 pt_chmod 4 2007 Nov 14 16:56:18 /usr/lib/utmp_update testuser /5 pts/5 19917 7 0 0 1195088178 373248 0 000000000 2007 Nov 14 16:56:18 bash Here's one for looking at files opened by processes:
dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }'
If I run gnome-terminal again, I get a lot of output: ... 0 43837 open64:entry gnome-terminal /usr/share/themes/blueprint/gtk-2.0/vertStepDwnButton.png 0 43837 open64:entry gnome-terminal /usr/share/themes/blueprint/gtk-2.0/menuBorderButton.png 0 43453 open:entry nscd /etc/user_attr 0 43453 open:entry utmpd /proc/19924/psinfo 0 43453 open:entry gconfd-2 /export/home/testuser/.gconf/apps/panel/profiles/default/applets/... 0 43453 open:entry gconfd-2 /export/home/testuser/.gconfd/saved_state.tmp ... Try doing this with dbx or truss or any other tool, especially the first example!
# dtrace -n 'syscall::XOpenDisplay:entry' You will get the error: dtrace: invalid probe specifier syscall::XOpenDisplay:entry: probe description syscall::XOpenDisplay:entry does not match any probes DTrace only knows about system calls, but you can use the pid provider to look at all the calls in a particular process. For example "dtrace -l" will list out the probes. You can limit that also with -n. Let's look at the probes for metacity for an Xlib call XMoveWindow:
dtrace -l -n "pid`pgrep metacity`::XMove*:" ID PROVIDER MODULE FUNCTION NAME 44083 pid19834 libX11.so.4 XMoveWindow return 44084 pid19834 libX11.so.4 XMoveWindow entry 44085 pid19834 libX11.so.4 XMoveWindow 0 44086 pid19834 libX11.so.4 XMoveWindow 1 ... # ./libX11.d `pgrep gnome-terminal` dtrace: script './libX11.d' matched 1629 probes CPU ID FUNCTION:NAME 0 44400 XPending:entry 0 44401 _XEventsQueued:entry 0 44326 _XFlush:entry 0 44309 _XFlushInt:entry 0 44402 _X11TransBytesReadable:entry 0 44403 _X11TransSocketBytesReadable:entry ... Wow, lots of calls to
XPending() and other functions. We probably don't want to debug those,
so before we remove them, we can format the output nicer by adding to the libX11.d script:
#pragma D option flowindent Now we can see that XPending is calling these functions and that's probably not a very interesting function to look at, so, we can get rid of them by setting a flag in the entry probe to XPending(). Then
in the return probe of XPending unset the flag. When the flag is set, don't print out
the function calls and when it is not set, then print out calls.
# ./libX11_pending.d `pgrep gnome-terminal` XNextEvent called _XDeq called XFilterEvent called XNextEvent called _XDeq called ... XChangeGC called _XUpdateGCCache called XChangeGC called XChangeGC called XSetClipRectangles called _XSetClipRectangles called XSetTSOrigin called XFillRectangle called ... So, we see lots and lots of libX11 functions being called. Well, this also is too much information and probably not useful. Suppose, we wanted to instead limit the calls to a specific
type of call. So, let's look at the next example. libX11_grab.d. This
example prints out all the calls to any Xlib grab functions. It also
prints out the stack trace of the user process (gnome-terminal in this
case) whenever the grab or ungrab function is called. Printing out
stack traces for grabs can be a problem when running in dbx since you
probably can't type in the dbx window if client has a keyboard or
pointer grab. So, DTrace is definitely the better tool here. In this example, I press the mouse button on the Edit menu item and get a popdown menu. # ./libX11_grab.d `pgrep gnome-terminal`
XGrabPointer called
libX11.so.4`XGrabPointer
libgdk-x11-2.0.so.0.400.9`gdk_pointer_grab+0x180
XGrabKeyboard called
libX11.so.4`XGrabKeyboard
libgdk-x11-2.0.so.0.400.9`gdk_keyboard_grab+0x6c
...
More Complex Examples:
Now let's look at a complex example involving two processes. Suppose,
we want to know what happens in one processs when another process calls
some function.
The script trace2processes.d takes 3 arguments--the process id of the two processes and the function to key off of. For example, if I want to know what the Xserver is doing when metacity calls XMoveWindow(), I would execute: # ./trace2processes.d `pgrep Xnest` `pgrep metacity` XMoveWindow metacity: XMoveWindow: enters metacity: XMoveWindow: returns Xnest: xnestGetImage: return = 1 Xnest: WriteToClient: entering Xnest: WriteToClient: return = 2400 Xnest: DoGetImage: return = 0 Xnest: ProcGetImage: return = 0 Xnest: FlushAllOutput: entering ... In my example, I am using the Xnest server since I was demo'ing this via a VNC session to engineers in Ireland and India and had Xnest running in VNC. xscope.d
This shows how to use some of the Xserver probes to implement a simple DTrace version of the X debugging tool called xscope. Xscope is a tool
for viewing the X protocol between client and server.
Handy DTrace scripts from the DTrace Toolkit at:
http://www.brendangregg.com/dtrace.html#DTraceToolkit Posted at 09:59PM Nov 14, 2007 by uejio in Sun |
Tuesday Nov 06, 2007
xscope in dtrace ver. 0.1
I've been playing with dtrace a lot lately to help debug issues with the Xserver and some X clients. Since Alan added the dtrace probes for the Xserver in Solaris 10, I've been meaning to rewrite xscope using dtrace. It's probably a much bigger job than I have the spare time for, but I did start working on a simply version called xscope.d. This is version 0.1 and just prints a simple one line output for each X request and event and is based on Alan's sample scripts. Here is some example output when xlogo is started: request-start: from client=21 (), request = X_CreateWindow request-done: from client=21 (), request = X_ChangeWindowAttributes, resultCode = 0 request-start: from client=21 (), request = X_ChangeWindowAttributes client-auth: client=21, from local pid=7209 (/usr/openwin/bin/xlogo) request-done: from client=21 (/usr/openwin/bin/xlogo), request = X_ChangeWindowAttributes, resultCode = 0 This shows that the xlogo probably calls XCreateWindow() then XChangeWindowAttributes(). One odd thing about this output is that the client-auth probe which should fire when the client first connects to the Xserver seems to be called after the client makes a X_CreateWindow request. I can't figure out if that's a bug in dtrace or the Xserver probes. I also added an example in xscope.d which gives more detail for the PropertyNotify event, so for this example, I see: send-event: to client = 21 (/usr/openwin/bin/xlogo), event type = PropertyNotify (28) PropertyNotify: window=0xa80001, atom=0x27, state=0, time=381056109 What that means is that xlogo is probably changing the atom 0x27. What atom is that? I can use xlsatoms to list all the atoms (using the -f "%x %s" option to display in hex) and find that 0x27 is WM_NAME. So, this event corresponds to xlogo setting the name of the window. This is not particularly useful for this case, however, I have been working on a bug with focus events and modified this script to print out details for the FocusIn and FocusOut events. My xscope.d script has been very useful for understanding what's happening with that bug. Posted at 02:29PM Nov 06, 2007 by uejio in Sun |
Monday Nov 05, 2007
Experience with OpenSolaris Developer Preview Live USB
I got an internal copy of a flash image and downloaded it to my Acer 3400 laptop running Solaris 10. I first tried the usbdump.sh script from Belenix, but my flash image was not an ISO image. Fortunately, a fellow blogger posted instructions on using a command called usbcopy. Unfortunately, I didn't have usbcopy on my Solaris 10 machine. So, the instructions said to use mercurial. But, I didn't have that either... Fortunately, I could download mercurial from blastwave and after an hour or so of fiddling and downloading dependent packages (mostly due to the fact that I had run out of disk space in "/") I was able to run usbcopy. Finally, I ran it and got: Found the following USB devices: There were no devices listed! D'oh! I took a look at the usbcopy command and it was parsing the output of rmformat. I ran that command by hand and it showed my Kingston 1.0 Gb USB stick: 3. Logical Node: /dev/rdsk/c4t0d0p0 But the size and bus type were missing. Hm... Now what? Well, I looked closely at the usbcopy script and found that it was just getting the logical device name and then running fdisk and format on the drive. Then, it copied the contents using dd and finally added the boot sectors with installgrub. So, I did all that by hand (I had to disable volume management first): # svcadm disable volfs I partitioned the drive as a single root partition using the entire disk from starting cylinder 1. This is what the usbcopy script was doing, so I just copied that. Then, I ran the dd command and about 20 minutes later it was done. I forgot to save the output of the command, but for future use, the output device was /dev/rdsk/c4t0d0s0. Then I ran the installgrub as in the usbcopy script. And I was done, but "will it blend?" Amazingly, "YES!". I was so happy that I even attempted to explain this to my wife whose eyes began to glaze over and she immediately changed the subject... Ok. So, maybe my son is right. I am a nerd (or at least a geek). BTW, to boot off the USB drive on an Acer 3400, you have to insert the drive before powering on the computer. Then, press the F2 key for the setup screen and select the hard drive as the boot disk. The hard drive will contain two entries: one for the hard drive and one for the flash drive. Move the flash drive above the hard drive using the F5 or F6 key. Then save and boot up. Also, don't forget to read the release notes to get the default user and root passwords... So, OpenSolaris booted up fine from the Live USB drive and I was surprised at how usable the performance was even running from a USB drive. It connected automatically to my router (hardwired) and I was able to get to my work email using Thunderbird. Firefox 2.0.0.8 works great. Infact, I'm typing this blog from it. Although, I noticed that the fan on my laptop keeps running. I guess there's still some issues with power, but this is a developer preview after all. I don't want to upgrade my Solaris 10 image to it just yet, but maybe soon! Now to take this USB stick to some other laptops and see how it runs there... Posted at 10:45AM Nov 05, 2007 by uejio in Sun |
Sunday May 13, 2007
Ukulele Links
Posted at 10:53PM May 13, 2007 by uejio in General |
Thursday Apr 12, 2007
A drop of water
My son took this picture of a drop of water on to a shallow bowl. I cropped and changed the contrast a little. We turned off the lights in the room, set a long exposure, and used the camera's flash. We didn't use a sync strobe or any other tricks to time the drop. Just patiently waited for the drops to fall... Posted at 10:51PM Apr 12, 2007 by uejio in General | Comments[1]
Tuesday Mar 20, 2007
Favorite podcasts for March 2007 I'm still addicted to podcasts while commuting. Ever since I started listening to podcasts about a year or so ago, I've been waiting to hear "From WHYY ... This is FRESH AIR." Well, finally that time has come. You can download the latest episodes from iTunes or directly from NPR here. I also just found another one of my radio favorites--Car Talk. Their podcast is not free, but they have a free "Call of the Week" available on iTunes. (The link on cartalk.com to the "Call of the Week" seems to be broken). And one more podcast I'm listening to is from Jonathan Coulton called "Thing a Week". Jonathan posts a new original song every week. I'm not sure if he's still doing this, but there appears to be 52 free songs on iTunes. My favorite so far is "Code Monkey". I happened to search for it on You Tube and actually found a video of Jonathan performing this song. Enjoy!
Posted at 10:51PM Mar 20, 2007 by uejio in Audio |
Monday Feb 26, 2007
DST changes in two weeks (Sun Alert 102775)
An issue that I've been working on lately has been to evaluate the effects on the CDE calendars from the new Daylight Savings Time changes for the US and a few other countries. The new DST starts March 11 this year. Patches created for the Solaris Operating System will fix the issues related to the CDE calendar manager (dtcm) and calendar server (rpc.cmsd). Unfortunately, appointments which were created before the patches were installed and which are starting in the new DST period (between March 11 and April 1 and between Oct 28 and Nov 4) may have to be recreated. For more information on the DST issues in Solaris see Sun Alert 102775. In addition, Sun has a site which gathers all the DST issues for Sun products at: http://www.sun.com/bigadmin/hubs/dst/ Growing up in Hawaii which doesn't observe DST, I never understood why it was needed. Infact, I wonder why everyone doesn't just use GMT. It would make traveling and coordinating meetings across timezones so much easier. Of course it would be a little confusing since I would eat breakfast at 4 pm, have lunch at 8 pm., dinner at 3 am. and go to bed at 7 am. Hm... Maybe that would not be such a good idea after all...
Posted at 11:25AM Feb 26, 2007 by uejio in Sun | |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||