Reg : EventDispatcher Thread

Dear All,
I have some doubts in EventDispatcher thread. As everyone know, java provides the option for creating a modal dialog. But the problem here is, it is modal to entire jvm. My requirement is i have to create modal dialog based on some context ( only for two three frames & dialogs). So I have written a class which extends the EventQueue and put it in top of EventQueue stack.
The above methodology allow me to dispatch the events based on my condition. I have created all the dialogs as non modal one and event restriction can be applied from extended eventqueue.
The problem here is, I can not pause the thread (until the dialog closed).Since it is EventDispatchThread, i can not use while(true) methodlogy.
Please help me in this regard
Thanks and Regards
V.S.Saravanan

Swing and Thread handling...
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

Similar Messages

  • Blocking the EventDispatcher thread

    Hi,
    Some times, when I click on a menu item, I see a grey area underneath the menu pop-up.
    Probably, I am blocking the event dispatching thread.
    So , I am using the update method to overcome this ..
    e.getSourceTree().update(e.getSourceTree().getGraphics());
    But still, it doesnot seem to be working at times. Especially, when the menu popup appears on some other component, the overlapping area appears greyed.
    I even tried using SwingUtil.invokeLater but that does not seem to be working fine.
    Please advice.
    The code is pasted here...
    public void performTreeAction(XmlTreeEvent e) {
              e.getSourceTree().update(e.getSourceTree().getGraphics());
                   if((e.getActionType()!=null && e.getUiForm()!=null
                   && e.getUiMode()!=null ) && (e.getActionType().equals("ui"))) {
              // I load the form here ****************
                   else if(e.getActionType()!=null && e.getActionType().equalsIgnoreCase("command") && e.getActionCommand()!=null) {
                        if(e.getActionCommand().equalsIgnoreCase("Reload")) {
                             // I refresh the tree here
         }

    Swing and Thread handling...
    http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • ERROR : sgslupsSpawn : spawned max (1023) threads

    Hi,
    I'm trying to install a Oracle AS cluster which includes two infrastructures and two portals instances.
    The OS is SLES9.
    I have finished the installation without any error and logged into portal successfully.
    After running for a while, I found that some errors occured continually about every two seconds and the log file was in $ORACLE_HOME/ldap/log/oidldapxxxxx.log
    Here is the log detail.
    2005/11/14:21:08:17 * Main:0 *
    oidldapd: Release 10.1.2.1.0 - Production on mon nov 14 21:08:17 2005
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    2005/11/14:21:08:17 * Main:0 *
    Portions Copyright (c) 1992-1996, 1999, 2000, 2001, 2004, 2005 Regents of University of Michigan. All Rights Reserved.
    2005/11/14:21:08:17 * Main:0 * Starting up the OiD Server, on node dvpcsso2
    2005/11/14:21:08:17 * Main:0 * Oid Server Connected to DB store via asdb connect string.
    2005/11/14:21:08:17 * Main:0 * OiD LDAP server started.
    2005/11/14:21:08:18 * ServerController :0 * Thread Started
    2005/11/14:21:08:18 * ServerDispatcher :1 * Thread Started
    2005/11/14:21:08:18 * ServerDispatcher :5 * Thread Started
    2005/11/14:21:08:18 * ServerDispatcher :2 * Thread Started
    2005/11/14:21:08:18 * ServerWorker (REG):8 * Thread Started
    2005/11/14:21:08:18 * ServerDispatcher :3 * Thread Started
    2005/11/14:21:08:18 * ServerDispatcher :4 * Thread Started
    2005/11/14:21:08:18 * ServerListener :6 * Thread Started
    2005/11/14:21:08:18 * ServerWorker (SPW):9 * Thread Started
    2005/11/14:21:08:18 * ServerWorker (REG):7 * Thread Started
    2005/11/14:21:49:01 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:05 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:07 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:09 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:11 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:15 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:17 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:19 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    2005/11/14:21:49:21 * ServerListener :6 * ERROR : sgslupsSpawn : spawned max (1023) threads
    What's wrong with my configuration?
    Thanks in advance.

    Hi,
    We found out that the problem should be LBR SSL handshake failed.
    LBR sends a SSL handshake every 2 seconds, and Oracle AS couldn't handshake with it.
    Our LBR vender told us that is a standard SSL handshake, and the problem should be the application server.
    We have tried the health check with sslh and tcp but to no avail.
    Does anyone have any Oracle AS configuration experience of the SSL handshake with LBR.
    Note that our LBR is Alteon 2208.
    Thanks.
    Jimmy

  • That old chestnut: Swing Threading - EventQueue

    First of all, I'm sorry if this topic has been done to death already but I really have searched through the forums and tutorials and not found a solution that I can get to work.
    Scenario (the usual):
    - Swing GUI application
    - Button fires off 'IntensiveProcess'
    - Display a 'MessageBox' while 'IntensiveProcess' is running
    Problem:
    MessageBox is not displayed (or is displayed but its contents are not painted - depending on which [incorrect] implementation I try) until IntensiveProcess has finished.
    I have tried all kinds of different ways of accomplishing this but I can't for the life of me get it to work:
    The implementations I have tried involved various combinations of:
    - EventQueue.invokeLater()
    - EventQueue.invokeAndWait()
    - inner and annonymous-inner Runnable classes
    As far as I understand it, the following strategy should work:
    public class MySwingApp extends JFrame
        //create button with Action: DoButtonAction
        private class DoButtonAction extends AbstractAction
            public void actionPerformed(ActionEvent e)
                // ~~~ IMPLEMENTAION 1  ~~~
                EventQueue.invokeLater(new ShowMessageBox());
                EventQueue.invokeLater(new IntensiveProcess());
                // ~~~ IMPLEMENTAION 2 ~~~
                EventQueue.invokeLater(new ShowMessageBox());
                //cannot call invokeAndWait() from Event Dispatcher thread so:
                (new Thread(new Runnable()
                    public void run()
                        EventQueue.invokeAndWait(new IntensiveProcess());
                )).start();
                // ~~~ IMPLEMENTAION 3  ~~~
                EventQueue.invokeLater(new IntensiveProcess());
                //cannot call invokeAndWait() from Event Dispatcher thread so:
                (new Thread(new Runnable()
                    public void run()
                        EventQueue.invokeAndWait(new ShowMessageBox());
                )).start();
                //dispose of message box if user didn't close it
        private class ShowMessageBox implements Runnable
            //display MessageBox...
        private class IntensiveProcess implements Runnable
            //execute intensive process...
    }None of the above 3 implementations yield the correct result.
    Can anyone please point out where I'm going wrong?
    Thanks all.
    John

    I have implemented your suggestion but sadly I am
    getting the same result: the entire GUI hangs until
    IntensiveProcess has completed, and only then is the
    message box displayed.Hmm, with the intenstive process in its own thread (construct() runs in a thread other than EDT) the GUI shouldn't hang like that, I'm not sure why that is. Maybe try invokeAndWait instead. Or, did you try displaying the message box before creating the SwingWorker? Make sure the message box is not modal if you create it before creating SwingWorker.
    I can't grasp why the EventDispatcher thread is
    getting tied up with IntensiveProcess. I thought
    calling EventQueue.invokeLater() (or SwingWorker) is
    supposed allow the executing thread (in my case the
    EventDispatcher thread) to continue. So why is the
    GUI not getting updated and the message box being
    displayed until AFTER IntensiveProcess finishes?As I understand it, invokeLater means stuff this Runnable into the event queue and run it when its turn comes up, while invokeAndWait runs the Runnable immediately. Neither method will wait for another thread to finish like you're expecting, that's what SwingWorker does.
    For some background info, the SwingWorker's construct() method creates a new non-EDT thread, which is where you're supposed to do time-intensive background work, and the code inside the finished() method will be run in the EDT, which is where you're supposed to update Swing components. The major benefit is the happens-before guarantee, construct() will run to completion before finished() is invoked. Maybe you already knew that, but it's important to know so I wanted to make sure.

  • Question of the day: In which Thread context does the main method run ?

    let's say, you create a JFrame in the main method:
    public static void main(String[] args)
    new MyJFrame();
    let's suppose, you construct the whole JFrame
    inside the constructor, which contains a lot
    of other Swing components, like JTree's and more.
    AND the JFrame calls setVisible(true) in its
    constructor.
    -> According to my knowledge, this won't work
    properly - it will function, BUT you will get one
    or two quite big exceptions (which usually start
    with a nullpointer exception, produced by the
    PLAF, but the whole stacktrace shows, that the
    the exception was thrown AND catched inside
    the Swing objects.
    Reason for this would be, that all operations
    after the "setVisible(true)" statement must be
    carried out in the eventdispatch thread, according
    to Swing rules.
    Now, as you can see by running the source below,
    the main() method always is processed in special thread,
    NOT the event dispatch thread - which produces the above behaviour.
    My Question:
    Wouldn't it have been easier to let the JVM
    process the main() methods right in the
    event dispatch thread ?
    Or:
    Why is the JVM designed to process the
    main() method in a special thread and not
    the Swing event dispatch thread ?
    opinions?
    Regards
    JPlaz / SnowRaver
    package Test1;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame
    public Frame1( final String title, int position )
    this.setSize(400,300);
    this.setLocation(position,position);
    this.setVisible(true);
    if( SwingUtilities.isEventDispatchThread() )
    System.out.println("Constructor of "+title+" is processed IN the event dispatch thread.");
    else
    System.out.println("Constructor of "+title+" is processed in ANOTHER than the event dispatch thread.");
    public static void main(String[] args)
    // First creation just from the startup thread context :
    new Frame1("first Frame", 60);
    // Now we let the second creation be done in the
    // eventdispatch thread context for sure :
    SwingUtilities.invokeLater( new Runnable()
    public void run()
    new Frame1("second Frame",120);

    Matt,
    it's been so long, I don't have the full answer in my head.
    This page on Adobe.com has an example that shows Flash 4
    mouse stuff (I'm Mr
    Vague today) when you scroll down. Your timelinme reference
    will be
    something like
    TellTarget(_Root, gotoAndPlay(50))
    Hopefully from that vagueness you can locate the right
    answer.
    Steve
    Adobe Community Expert: Authorware, Flash Mobile and Devices
    My blog -
    http://stevehoward.blogspot.com/
    Authorware tips -
    http://www.tomorrows-key.com

  • SwingGUIs and Threads

    Hello,
    I have written a progressDialog. And now I am not sure if I did it the right way. It looks like it is working. But especially I would like to know if the way I did it could be problematic in terms of the Swing EventDispatching Thread and my Thread.
    This is what I wanted to do:
    A Task's (that is run as a thread) progress shall be watchable via a modal progressDialog. The updatefrequency of the content of the dialog shall configurable and triggered by a timer. Also the must be a function like decidetopopup (millisces).
    This is how I did it:
    A class that extends Thread named ProgressTask has two timers as members: a timer that triggers the popup and a timer that triggers the JProgressDialog.updatecontent() frequently. updatecontent changes the status of the progressbar, sets a new title for the dialog if needed, changes the icon that is displayed in that dialog and changes the text in that dialog.
    So to sum it up:
    in the actionperformed eventhandler (the listener is that thread itself) is the Jprogressdialog.show() done
    in the same eventhandler is also the Jprogressdialog.updatecontent() done
    in the run method of the thread is the actual work done (i.e. Reading a file) some variables are set frequently (when progress is done) that contain information about the icon/title/text/progressvalue for the progressdialog.
    from the mainclass I do myProgressTask.start();

    Hello,
    I have written a progressDialog. And now I am not sure if I did it the right way. It looks like it is working. But especially I would like to know if the way I did it could be problematic in terms of the Swing EventDispatching Thread and my Thread.
    This is what I wanted to do:
    A Task's (that is run as a thread) progress shall be watchable via a modal progressDialog. The updatefrequency of the content of the dialog shall configurable and triggered by a timer. Also the must be a function like decidetopopup (millisces).
    This is how I did it:
    A class that extends Thread named ProgressTask has two timers as members: a timer that triggers the popup and a timer that triggers the JProgressDialog.updatecontent() frequently. updatecontent changes the status of the progressbar, sets a new title for the dialog if needed, changes the icon that is displayed in that dialog and changes the text in that dialog.
    So to sum it up:
    in the actionperformed eventhandler (the listener is that thread itself) is the Jprogressdialog.show() done
    in the same eventhandler is also the Jprogressdialog.updatecontent() done
    in the run method of the thread is the actual work done (i.e. Reading a file) some variables are set frequently (when progress is done) that contain information about the icon/title/text/progressvalue for the progressdialog.
    from the mainclass I do myProgressTask.start();

  • Socket and Thread Question?

    I have a Server/Client app where the Client connects to the server and the server accepts the Client and starts a new thread for each client.
    Then the Server Thread waits for the Client to contact.
    I set the timeout on the Server socket to 30 seconds.
    but the Client could sit there idle for much longer.
    So on the client side i used a timer to send "-1" every 5 seconds.
    That way if the Server Thread times out i know the Client is not there and end the thread and close everything.
    Now on the client side i may send several strings in a row to the server so i do not want my "-1" timer (i'm still here) messages to get intermingled with regular Client messages so i set up a boolean variable like so:
        volatile private boolean out1busy = false;
        private synchronized boolean getOut1busy(){
         return out1busy;
        private synchronized void setOut1busy(boolean on){
         out1busy = on;
        }then before using the socket i do this:
            while (getOut1busy()) try { Thread.sleep(40); } catch (InterruptedException ex) {}
            setOut1busy(true);
            lobbyOut.println("-1");
            setOut1busy(false);I have been running this for over a year and have personally never had a problem but have had rare clients testing say their comp has suddenly bogged down and it seems like they are describing what might happen if Out1Busy is set to true and not set back to false.
    ive checked my code and like i say it has never happened to me BUT i feel like what i am doing here is not the right way and there is probably a much better way to accomplish this. It is the only place in my code i see the chance of an infinate loop occuring.
    So regardless of whether or not it is even causing a problem can anyone tell me if it might cause a problem and a better way to do it.

    how about this.
    everywhere that i send data to the server that is not already on the event dispatch thread i just put in an invoke later which wold execute it on the eventdispatch thread.
    that way all communication with the server would be done on the event dispatch thread.
    so if i click a button that sends several strings right in a row it would complete before the "-1" im still here message sent at the same time goes through.
    so even if i had two bits of code that send several strings that need to be received in a row they would not get intermingled as long as they were both executed within a invokelater or already executed on the event dispatch thread (like a mouse clicked or action performed)
    so in my case here i always contact the server in either a state changed, action performed, or mouseclicked except for the "-1" im still here message.
    are alll these (state changed, action performed, or mouseclicked) executed on the event dispatch thread?
    i just put the "-1" in an invoke later and take out all the sleep and outbusy variable stuff.

  • Swing and jmf

    can u please have a look to the attached file
    i know that this involves the jmf API but I have the feeling that has to do more with swing, thats whay I post my question here
    this simple application is based on the MDI.java example of the jmf web
    pages
    I also added a slider and want to set the playback rate for the player from
    there if possible
    that is I want everytime that I move the slider and the value is biggerthan
    50 the rate to be reduced according to a simple calculation that converts
    the slider value to a value between 0 an1 for the rate...
    so all i want to do is pass the slider value to the player everytime that
    the slider changes value and this is bigger than 50
    the attached file can do that only when the player starts playing the
    file,,,,
    after the player has started and the rate is set I cant change it even if
    the slider moves
    when I tried to do that from within the stateChanged method of the slider I
    was getting a Nullpointer exception because of the EventDispatching thread,
    so I thought to take this piece of code out of there (create the setnewrate
    method in the jmframe instead),,,,but then of course doesnt work like I
    would want,,,,,
    do I have to register the class that implements the frame for the player as
    a ChangeListener on the slider to achieve that, is something like that
    possible....
    I know that swing is not supposed to be thread safe, so maybe this is what
    the problem is after all...any suggestions to that direction?
    Can u please have a look??
    I am a beginner so any help would really be very much appreciated
    thanx :)
    maria
    .....and the attached file
    I think the problem is with the stateChanged method for the Jslider...
    I am getting a null pointerexception because of the eventdispatching thread
    pls ignore any silly mistakes I am a completely newbie in java
    myAppfr2.java
    import javax.media.*;
    import com.sun.media.ui.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.Vector;
    import javax.swing.border.Border.*;
    import java.util.Hashtable;
    public class myAppfr2 extends Frame {
    * VARIABLES
    JMFrame jmframe = null;
    JDesktopPane desktop;
    FileDialog fd = null;
    CheckboxMenuItem cbAutoLoop = null;
    Player player ;
    //Player newPlayer = null;
    String filename;
    boolean stopped;
    public my_slider test_slider;//put it here so I can use it by name by all code
    float rate;
    * MAIN PROGRAM / STATIC METHODS
    public static void main(String args[]) {
    //if (args.length > 0)
         //rate=Float.parseFloat(args[0]);
    myAppfr2 mdi = new myAppfr2();
    static void Fatal(String s) {
    MessageBox mb = new MessageBox("JMF Error", s);
    * METHODS
    public myAppfr2() {
    super("VHE Demo");
    // Add the desktop pane
    setLayout( new BorderLayout() );
    desktop = new JDesktopPane();
    desktop.setDoubleBuffered(true);
         desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);//makes dragging faster
    add("Center", desktop);
    setMenuBar(createMenuBar());
    setSize(640, 480);
    setVisible(true);
         test_slider = new my_slider("networkutil");
         createnetworkutil();
         try {
         UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel") ;
    } catch (Exception e) {
    System.err.println("Could not initialize personal look and feel");
    addWindowListener( new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
    private MenuBar createMenuBar() {
    ActionListener al = new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    String command = ae.getActionCommand();
    if (command.equals("Open")) {
    if (fd == null) {
    fd = new FileDialog(myAppfr2.this, "Open File",
    FileDialog.LOAD);
    fd.setDirectory("~/movies");
    fd.show();
    if (fd.getFile() != null) {
    String filename = fd.getDirectory() + fd.getFile();
    openFile("file:" + filename);
    } else if (command.equals("Exit")) {
    dispose();
    System.exit(0);
    MenuItem item;
    MenuBar mb = new MenuBar();
    // File Menu
    Menu mnFile = new Menu("File");
    mnFile.add(item = new MenuItem("Open"));
    item.addActionListener(al);
    mnFile.add(item = new MenuItem("Exit"));
    item.addActionListener(al);
    // Options Menu
    Menu mnOptions = new Menu("Options");
    cbAutoLoop = new CheckboxMenuItem("Auto replay");
    cbAutoLoop.setState(true);
    mnOptions.add(cbAutoLoop);
    mb.add(mnFile);
    mb.add(mnOptions);
    return mb;
    //create slider and add it to desktop
    public void createnetworkutil(){
    test_slider.pack();
    desktop.add(test_slider);
    test_slider.setVisible(true);
    * Open a media file.
    private void openFile(String filename) {
    String mediaFile = filename;
    Player player = null;
    // URL for our media file
    URL url = null;
    try {
    // Create an url from the file name and the url to the
    // document containing this applet.
    if ((url = new URL(mediaFile)) == null) {
    Fatal("Can't build URL for " + mediaFile);
    return;
    // Create an instance of a player for this media
    try {
    player = Manager.createPlayer(url);
    } catch (NoPlayerException e) {
    Fatal("Error: " + e);
    } catch (MalformedURLException e) {
    Fatal("Error:" + e);
    } catch (IOException e) {
    Fatal("Error:" + e);
    if (player != null) {
    this.filename = filename;
    JMFrame jmframe = new JMFrame(player, filename);
    desktop.add(jmframe);
    class JMFrame extends JInternalFrame implements ControllerListener {
    public Player mplayer;
    Component visual = null;
    Component control = null;
    int videoWidth = 0;
    int videoHeight = 0;
    int controlHeight = 30;
    int insetWidth = 10;
    int insetHeight = 30;
    // boolean firstTime = true;
    public JMFrame(Player player, String title) {
    super(title, true, true, true, true);
    getContentPane().setLayout( new BorderLayout() );
    //setSize(320, 10);
    setLocation(200, 25);
    setVisible(true);
    mplayer = player;
    mplayer.addControllerListener((ControllerListener) this);
    mplayer.realize();
    addInternalFrameListener( new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent ife) {
    mplayer.close();
    public void controllerUpdate(ControllerEvent ce) {
    // System.out.println("controllerUpdate");
    //SwingUtilities.isEventDispatchThread();
    if (ce instanceof RealizeCompleteEvent) {
    mplayer.prefetch();
    } else if (ce instanceof PrefetchCompleteEvent) {
    if (visual != null)
    return;
         //setnewrate();
         //rate=mplayer.getRate();
         System.out.println( mplayer.getRate());
    if ((visual = mplayer.getVisualComponent()) != null) {
    Dimension size = visual.getPreferredSize();
    videoWidth = size.width;
    videoHeight = size.height;
    getContentPane().add("Center", visual);
    } else
    videoWidth = 320;
    /*if ((control = mplayer.getControlPanelComponent()) != null) {
    controlHeight = control.getPreferredSize().height;
    getContentPane().add("South", control);
    setSize(videoWidth + insetWidth,
    videoHeight + controlHeight + insetHeight);
    validate();
    mplayer.start();
    } else if (ce instanceof StartEvent){
         if (test_slider.netutil==0) {
         mplayer.stop();
         } else if (ce instanceof EndOfMediaEvent && cbAutoLoop.getState()) {
    mplayer.setMediaTime(new Time(0));
              boolean stopped=true;
              mplayer.prefetch();
              mplayer.start();
              stopped=false;
    class my_slider extends JInternalFrame implements ChangeListener{
    //Set up parameters.
    int netini=50;
    public int netutil=netini;
    public my_slider(String windowTitle) {
    super(windowTitle, false, false, false, false);
    getContentPane().setLayout(new BorderLayout());
    setLocation(25,25);// for the internal frame that contains the slider
    setVisible(true); //..same
    //Create the slider(the component included in "my_slider" internal frame
         JSlider mslider = new JSlider(JSlider.VERTICAL,
    0, 100, netini);
    mslider.addChangeListener((ChangeListener) this);
    mslider.setMajorTickSpacing(10);
    mslider.setPaintTicks(true);
    //Create the label table.
    Hashtable labelTable = new Hashtable();
    labelTable.put(new Integer( 0 ),
    new JLabel("0%") );
    labelTable.put(new Integer( 25 ),
    new JLabel("25%") );
    labelTable.put(new Integer( 50 ),
    new JLabel("50%") );
    labelTable.put(new Integer(75),
    new JLabel("75%") );
         labelTable.put(new Integer( 100),
    new JLabel("100%") );     
    mslider.setLabelTable(labelTable);
    mslider.setPaintLabels(true);
    mslider.setBorder(
    BorderFactory.createEmptyBorder(0,0,0,10));
         //Put everything in the content pane.
    getContentPane().add(mslider, BorderLayout.CENTER);
    public void stateChanged(ChangeEvent e) { //System.out.println("stateChanged");
    // SwingUtilities.isEventDispatchThread();
    if (e instanceof ChangeEvent){
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
    netutil= (int)source.getValue();
         System.out.println(netutil);
              if (jmframe.mplayer!=null) {
         jmframe.mplayer.setRate((float)(netutil/(netutil+(0.3*netutil))));
              if (jmframe.mplayer.getTargetState() <Player.Started)
         jmframe.mplayer.prefetch();
    i am stuck so any help would be really very much appreciated

    did you ever resolve this.
    I may be having similar problems
    I have an JMF application running under webstart. It runs ok in Java 1.3
    Now I am trying to get ti to run under Java 1.4. The attached error is rather useless,
    but by guess at what is happening is that the JMF control has some .awt. stuff included
    but that Java 1.4 emulates .awt. in swing. But something was not set and the default does not
    work.
    This error messages does not appear in the 1.3 run
    Any suggestions would be greatly appriatated.
    1.4 result:
    mg version 2.1.1a
    player created com.sun.media.content.unknown.Handler@3a1834
    ctr com.sun.media.PlaybackEngine$BitRateA@4a9a7d
    ctr com.sun.media.BasicJMD[panel0,0,0,512x200,invalid,layout=java.awt.BorderLayout]
    duration? javax.media.Time@6b5666 sec = 9.223372036854776E9
    time unknown javax.media.Time@754699
    will realize the player
    realize
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.
    Handler@3a1834,previous=Unrealized,current=Realizing,
    target=Realized]
    start smxBADS
    bass start
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(Unknown Source)
    at javax.swing.JComponent._paintImmediately(Unknown Source)
    at javax.swing.JComponent.paintImmediately(Unknown Source)
    at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(Unknown Source)
    at javax.swing.JComponent._paintImmediately(Unknown Source)
    at javax.swing.JComponent.paintImmediately(Unknown Source)
    at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    realize done
    panel found java.awt.Panel[panel1,0,0,0x0,invalid] java.awt.Panel[panel2,4,216,292x30,layout=java.awt.FlowLayout]
    press a button
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(Unknown Source)
    at javax.swing.JComponent._paintImmediately(Unknown Source)
    at javax.swing.JComponent.paintImmediately(Unknown Source)
    at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    1.3 result
    mg version 2.1.1a
    player created com.sun.media.content.unknown.Handler@354749
    ctr com.sun.media.PlaybackEngine$BitRateA@5b484d
    ctr com.sun.media.BasicJMD[panel3,0,0,512x200,invalid,layout=java.awt.BorderLayout]
    duration? javax.media.Time@46d228 sec = 9.223372036854776E9
    time unknown javax.media.Time@f7386
    will realize the player
    realize
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.
    Handler@354749,previous=Unrealized,current=Realizing,
    target=Realized]
    start smxBADS
    bass start
    javax.media.DurationUpdateEvent[source=com.sun.media.content.unknown.Handler@354749,duration=javax.media.Time@55c0f9
    javax.media.Time@55c0f9
    javax.media.RealizeCompleteEvent[source=com.sun.media.content.unknown.Handler@354749,previous=Realizing,current=Realized,target=Realized]
    realized complete
    prefetch
    realize done
    controlComp com.sun.media.ui.DefaultControlPanel[,0,0,74x21,invalid,layout=java.awt.BorderLayout]
    add controlComp 21 java.awt.Panel[panel4,10,-12,258x47,invalid]
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.Handler@354749,previous=Realized,current=Prefetching,target=Prefetched]
    start smxBADS
    bass start
    running ok from here on

  • Xerces-c-3.0.0 runtime errors in 5.10 Generic_137111-06 sun4v sparc SUNW,

    Hi all,
    I am facing the problem of run time alignment problem . Below is the error
    program terminated by signal SEGV (no mapping at the fault address)
    0x000000010000cd94: __do_misaligned_ldst_instr+0x01a4: ldx [%o2], %i3
    where -l
    Current function is xercesc_3_0::MemoryManagerImpl::allocate (optimized)
    40 memptr = ::operator new(size);
    I compiled Xerces-c-3.0.0 code through Sun C++ 5.9 SunOS_sparc Patch 124863-01 2007/07/25 in a following manner
    CC -library=stlport4 -DHAVE_CONFIG_H -DXERCES_BUILDING_LIBRARY -I. -I.. -I../src/xercesc/util -I/usr/include -I/usr/include -features=extensions -fast -mt -xarch=sparc -xprefetch -m64 -g -xmemalign=1i -D_REENTRANT -c -o xercesc/internal/MemoryManagerImpl.lo xercesc/internal/MemoryManagerImpl.cpp.
    Please let me know what would be the problem.Any help would be greatly appreciated.
    Thank you
    Vijay Mukka

    Thanks for the Quick Reply,
    This time I compiled by removing -fast flag for debugging purpose.Still I believe that the Problem exists in Xerces code for 64 Bit Programs.
    I am pasting the error as well.
    dbx: Stack Trace
    t@1 (l@1) program terminated by signal SEGV (no mapping at the fault address)
    0xffffffff7c80fea0: gcFinishCollection+0x00b8: ldx [%o2 + 56], %o3
    Current function is xercesc_3_0::MemoryManagerImpl::allocate (optimized)
    40 memptr = ::operator new(size);
    (dbx) frame 1
    0xffffffff7c80fea0: gcFinishCollection+0x00b8: ldx [%o2 + 56], %o3
    (dbx) regs
    current thread: t@1
    current frame: [1]
    g0-g1 0x0000000000000000 0x0000000000000226
    g2-g3 0xffffffff745df278 0xffffffff745df278
    g4-g5 0x0000000000001136 0x0000000000001136
    g6-g7 0x0000000000000000 0xffffffff78f00200
    o0-o1 0x0000000000000000 0x0000000000000000
    o2-o3 0x0000000000000040 0x0000000000001300
    o4-o5 0x0000000000000040 0x0000000000000044
    o6-o7 0xffffffff7fff7f51 0x0000000000000226
    l0-l1 0x0000000000000001 0xffffffff7c924fb0
    l2-l3 0x0000000000000000 0x0000000000001fff
    l4-l5 0xffffffffffffe000 0x0000000000000009
    l6-l7 0x0000000000001000 0x3230303930322000
    i0-i1 0x3230303930323136 0xffffffff7c933a2c
    i2-i3 0xffffffff7c9226a8 0x000000000000040a
    i4-i5 0x0000000000000001 0xffffffff7c925190
    i6-i7 0xffffffff7fff8001 0xffffffff7c810268
    y 0x0000000000000000
    ccr 0x0000000000000044
    pc 0xffffffff7c80fea0:gcFinishCollection+0xb8 ldx [%o2 + 56], %o3
    npc 0xffffffff7c80fea4:gcFinishCollection+0xbc and %g1, 63, %o0
    (dbx) where -l
    current thread: t@1
    =>[1] libgc.so.1:gcFinishCollection(0x3230303930323136, 0xffffffff7c933a2c, 0xffffffff7c9226a8, 0x40a, 0x1, 0xffffffff7c925190), at 0xffffffff7c80fea0
    [2] libgc.so.1:gcTryToCollectInner(0xffffffff7c80f918, 0x17e3c, 0x0, 0xffffffff7c9226a8, 0x11253c, 0xffffffff7c924c08), at 0xffffffff7c810268
    [3] libgc.so.1:gcCollectOrExpand(0x1, 0x1, 0x0, 0x700, 0xffffffff7c924c38, 0xffffffff7c952068), at 0xffffffff7c810ae0
    [4] libgc.so.1:gcAllocobj(0x0, 0xffffffff7c943acc, 0xffffffff7c9226a8, 0x27, 0x1, 0xffffffff7c924c00), at 0xffffffff7c810bac
    [5] libgc.so.1:gcGenericMallocInner(0x0, 0x1, 0xffffffff7c925358, 0xffffffff7c9251f8, 0xffffffff7c9226a8, 0x27), at 0xffffffff7c814aac
    [6] libgc.so.1:gcGenericMalloc(0x36f8, 0x1, 0xffffffff739f7f80, 0x10d994, 0xffffffff7c9226a8, 0x0), at 0xffffffff7c814d44
    [7] libgc.so.1:malloc(0x36f8, 0x0, 0xffffffff7c925358, 0x27, 0xffffffff7c9261c0, 0xffffffff7c954850), at 0xffffffff7c815c5c
    [8] libCrun.so.1:operator new(0x36f8, 0xffffffff73d6b368, 0xffffffff7c9251c0, 0x104274, 0xffffffff74d0ca60, 0xffffffff7c954850), at 0xffffffff74c08810
    [9] libxerces-c-3.0.so:xercesc_3_0::MemoryManagerImpl::allocate(this = ???, size = ???) (optimized), at 0xffffffff745df294 (line ~40) in "MemoryManagerImpl.cpp"
    [10] libxerces-c-3.0.so:xercesc_3_0::ValueHashTableOf<bool,xercesc_3_0::StringHasher>::rehash(this = ???) (optimized), at 0xffffffff74383914 (line ~221) in "ValueHashTableOf.c"
    [11] libxerces-c-3.0.so:xercesc_3_0::EncodingValidator::initializeRegistry(this = ???) (optimized), at 0xffffffff74380d60 (line ~186) in "ValueHashTableOf.c"
    [12] libxerces-c-3.0.so:xercesc_3_0::XMLInitializer::initializeEncodingValidator() (optimized), at 0xffffffff74380a64 (line ~35) in "EncodingValidator.cpp"
    [13] libxerces-c-3.0.so:xercesc_3_0::XMLInitializer::initializeStaticData() (optimized), at 0xffffffff7440e034 (line ~44) in "XMLInitializer.cpp"
    [14] libapix.so:XMLInterface::initializeXML() (optimized), at 0xffffffff76120cc0 (line ~1252) in "xmlinter.cpp"
    Please reply this is the bug with the xerces code because from My code just I am calling XMLInterface::initializeXML() ,I am Getting this Error as above.

  • Of what use is SwingUtilities.invokeAndWait?

    hi,
    i have a GUI that processes a huge amount of data on each click of the button. By huge, i mean it processes
    packs of about 1000 bytes each, but at any given time there could be 25,000,000 or more of them. Hence,
    my application is very sensitive to slight shifts in processing speeds for each claim. An extra half a second processing any of these can lead to unacceptable processing times. 2 or 3 hours is OK, but 2 or 3 days is not. Anyways, each time I click on the button to process the process starts, and the GUI stops responding. I have been researching how to get this to stop and I, of course, came across the SwingUtilities.invokeAndWait() method. However, if I can't call it from the EventDispatch thread, of what use is it? I mean, the only time I need it is when a Button is pressed and I start processing data. Is there anything I can do to satisfy my need to maintain speed and a decent looking GUI? I tried calling this.paintAll(this.getGraphics()) a bunch of times, but that makes my screen flash and it seems to take forever and slow my app down way too much. Any ideas Swing gurus? thanks

    Ok, so I took one of my shorter processes from my GUI and I put that into its own class that extends thread and I launched it from the eventDispatch thread (the actionPerformed function, i assume they are the same thing) however, my GUI is still not updating. What gives? I did launch a thread, so it seems like my GUI should be responsive. I know the thread was launched because it responds properly, but I still can't get the GUI part to work. Here is a sample of the code:
    //here is how i call this...
         else if(E.getSource() == CheckRecordLengthButton){
               CheckForRecordLength CFRL = new CheckForRecordLength(ReferenceFileField.getText(),
                                                                                    RFW.getRecordLength(), CheckRecordLengthButton);
           }//end else
    //here is the actual class declaration...
    class CheckForRecordLength extends Thread{
         String filepath;
         int RL;
         JButton Button;
         public CheckForRecordLength(String Filepath,int rL,JButton button){
                           //do constructor stuff...
         public void run(){
              try {
                              //...do some useful work...
              catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              }//end catch
         }//end function run
    } //end class defso, is there a way to launch this thread and still get the GUI to update? I REALLY appreciate the help....

  • Fire! Core dump in pthread_mutex_lock

    Hi, All,
    Here is the pstack information from dbx.
    t@1 (l@1) terminated by signal SEGV (access to address exceeded protections)
    0xfd90b258: locktry_adaptive : ldstub [%o0 + 12], %o1
    (dbx) where
    current thread: t@1
    =>[1] locktry_adaptive(0x10018, 0x2089c, 0x64d530, 0x85e18, 0xffbef338, 0x20bd288), at 0xfd90b258
    [2] tipthread_mutex_lock(0x0, 0xfd91c000, 0x10018, 0x3, 0x0, 0x0), at 0xfd8fb798
    [3] cmgCall::sendEventIn(0x224e010, 0x2, 0x209144b, 0x3, 0x10018, 0x6ef910), at 0xfe4912bc
    [4] cmgSs7Adapter::inputNetMsg(0xfe50db20, 0x2091430, 0xfe5f677c, 0x3, 0x1a7d5e0, 0xfe5b85c4), at 0xfe50d060
    [5] cmgCallMgr::forwardNetEvent(0x28b010, 0xaf6f10, 0x100a, 0x100b, 0xfe5526eb, 0x0), at 0xfe4a6c40
    [6] engIOS_EvtHdlr::handleEvent(0x25e1f0, 0xaf6f10, 0x0, 0xbd07c, 0x5, 0x2), at 0xfe1f4a7c
    [7] XEEvtDispatcher::run(0x1b9010, 0xdce170, 0x1b9124, 0x1b9078, 0x1, 0x710381), at 0xfe96bac4
    [8] XEProcShell::run(0x1b69a0, 0x800, 0x9a8, 0xfea06630, 0x1bb610, 0x1), at 0xfe991ce8
    [9] main(0x3, 0xffbefb54, 0xffbefb64, 0x1617d0, 0x0, 0x0), at 0x26238
    (dbx) regs
    current thread: t@1
    current frame: [1]
    g0-g1 0x00000000 0x00000000 0x00000000 0x0001b000
    g2-g3 0x00000000 0x00000001 0x00000000 0xfe8ead08
    g4-g5 0x00000000 0x00000074 0x00000000 0xffbef32c
    g6-g7 0x00000000 0x00000000 0x00000000 0x00193778
    o0-o1 0x00000000 0x00010018 0x00000000 0x0002089c
    o2-o3 0x00000000 0x0064d530 0x00000000 0x00085e18
    o4-o5 0x00000000 0xffbef338 0x00000000 0x020bd288
    o6-o7 0x00000000 0xffbef318 0x00000000 0xfd8fb798
    l0-l3 0x00000000 0xfcfc35e4 0x00000009 0x00000000
    l4-l7 0x0064d530 0xfe8db0e8 0x0064d530 0xfe5b85c4
    i0-i3 0x00000000 0xfd91c000 0x00010018 0x00000003
    i4-i7 0x00000000 0x00000000 0xffbef378 0xfe4912bc
    y 0x000f7c26
    psr 0xfe401001
    pc 0xfd90b258:_lock_try_adaptive ldstub [%o0 + 12], %o1
    npc 0xfd90b25c:_lock_try_adaptive+0x4 tst %o1
    (dbx) lwps
    o>l@1 signal SIGSEGV in locktry_adaptive()
    l@2 LWP suspended in libcsigaction()
    l@3 LWP suspended in ___lwp_cond_wait()
    l@27 LWP suspended in ___lwp_cond_wait()
    l@28 LWP suspended in private___lwp_cond_wait()
    l@29 LWP suspended in writeValue<unsigned short>()
    l@24 LWP suspended in __door_call()
    (dbx)
    Could you help investigate it?
    Thanks!
    Eric

    Shouting Fire! in a crowded forum can cause a riot. People can get trampled.
    Very bad. :-) But in this case, I don't think there is a riot coming.
    You probably passed a 0 to the mutex function.
    Try something like this in dbx:
    (dbx) stop in tipthread_mutex_lock -if $o0 == 0
    (dbx) run
    See if it hits that breakpoint. If so, then your app is passing a zero
    to that function.
    Also, look at the code for cmdCall::sendEventIn and see if you
    can tell if it might be passing a zero.

  • Exception during event processing

    I have an application which has an "exception catcher" at the bottom that performs some "exit work" that I need done when the program terminates abnormally.
    In certain places of the program, I automatically have the program quit and exit by dividing by zero to trigger an exception. Up until today, this technique has worked nicely.
    Today, however, I tried to do it in the middle of an AWT Event (a menu selection from a frame), in the following method:
    public void actionPerformed(ActionEvent event)
    Instead of the exception being handled by my routine, the program instead hangs without getting to the "catch" command that I usually use and instead generates the following sequence of error messages:
    Exception occurred during event dispatching:
    java.lang.ArithmeticException: / by zero
    at WTPFrame.actionPerformed(wtp.java:5335)
    at java.awt.AWTEventMulticaster.actionPerformed(Unknown Source)
    at java.awt.MenuItem.processActionEvent(Unknown Source)
    at java.awt.MenuItem.processEvent(Unknown Source)
    at java.awt.MenuComponent.dispatchEventImpl(Unknown Source)
    at java.awt.MenuComponent.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Is there any thing I can do to allow this exception to pass through to my handler so that the program doesn't hang?
    Thanks,
    Bruce

    When I was describing the business of subclassing an exception, this was independent of your hanging problem.
    The hanging thing is a consequence of the way that threading is done in a GUI application.
    Your app (by the sound of it) has two threads of execution running. The "main" thread is listening to the socket and running the game. The "EventDispatcher" thread is listening to the mouse and keyboard and redrawing the GUI.
    When a GUI event handler is called, this call is done by the event dispatcher thread. If you throw an exception from the handler, the loop in the event dispatcher thread just prints the stack trace and goes on listening for more mouse and keyboard events.
    To get the threads to communicate, you need for one thread to set a flag that the other thread can read. To interrupt the socket read, you need to call interrupt on the main thread from the gui thread. Lastly, to get the app to exit you must call System.exit().
    class Foo {
      volatile boolean weHaveToExit = false;
      Thread mainThread;
      // this method is called when the user clicks the exit button
      void exitMenuHandler() {
        weHaveToExit = true;
        mainThread.interrupt();
      public static void main(String[] av) {
        mainThread = Thread.currentThread();
        // create the menu
        // attach the event handler to it
         while(!weHaveToExit) {
             // process a game move
         System.exit(0);

  • SwingWorker and Exceptions in doInBackground() function

    Hi. I have GUI and task which communicate with database. I have special class with prepared statements fields, data (returned from database) fields, get methods and construcor. Constructor assume one parameter, query data and fill data fields. So in constructor I perform (maybe) long running task. So I made this subclass SwingWorker in which I create instance of my database class. User type some input (serial number to which he wants to show info), confirm, there start the worker thread. However when he type bad input constructor of database class throws InvalidSnException and then I must show him JOptionPane with error message (or database error occurs). But I shouldn't do that from doInBacground() method because it isn't EventDispatcher thread.
    public DbOperations doInBackground()
      DbOperations db = null;
      try {
        db = new DbOperations(sn);
      catch(InvalidSnException) {
      catch(SQLException e) {
      catch(Exception e) {
      return db;
    }I don't want to create some additional variables to hold error data, because exceptions hold worth information itself (for example SQLException). Do you know any idea how can solve this?

    So you mean that when I invoke JOptionPane method in chatch block in SwingUtilities.invokeLater() function, the code that shows JOptionPane will run on EDT?
    When I catch InvalidSnException I just want to show error message and continue some loop to let user type input again, but when I catch SQLException I want show error message and exit with System.exit(-1). Should I use invokeAndWait() instead of invokeLater() ?
    Thx

  • FI/CO SIM files mate!

    Hi Guys,
    Do any one can help me out finding SIM files particularly for FI/CO module? Plz don't ask me what are the SIM files I failed to succeed in finding these on the web. Help would be appreciated with points. Thanks.
    Reg,
    Sridhar.

    Thread locked.  Read the rules of engagement before posting next time.  if you do this again your userID will be reported to SDN and most likely deleted.
    -nathan

  • Problems calling virtual functions

    Hi,
         We have code running in a shared library that appears to be incorrectly changing registers that contain function parameters before the called (virtual) function acceses the registers containing its parameters.
    Has anyone seen a similar problem ? If so does
    anyone knaw what the solution is ?
    Compiler:
    SunAMD:tbucken@win64bld 247>>> CC -V
    CC: Sun C++ 5.7 2005/01/07
    SunAMD:tbucken@win64bld 248>>> uname -a
    SunOS win64bld 5.10 Generic i86pc i386 i86pc
    solaris is running on an HP DL585 (4 cpu's)
    calling function code (We are setting up a vitual function call):
         tempdatabase->CostModel->GetCompareSelectivity
         (_lhs_base, rhsbase, rhsconverted, op, &sel_est,
         &_value_distrib );
    / Line 922
         movq     -144(%rbp), %r8
         movq     352(%r8), %r8
         movq     0(%r8), %r14
         movq     -144(%rbp), %r13
         movq     -8(%rbp), %r12
         movq     -8(%rbp), %r11
         movq     -8(%rbp), %r10
         movq     -8(%rbp), %r8
         movzbl     120(%r8), %eax
         movq     -8(%rbp), %r9
         movq     -8(%rbp), %r8
         leaq     192(%r8), %r8
         movq     %r8, 0(%rsp)
         leaq     40(%r9), %r9
         movl     %eax, %r8d
         movq     168(%r10), %rcx
         movq     152(%r11), %rdx
         movq     144(%r12), %rsi
         movq     352(%r13), %rdi
         movq     48(%r14), %r10
         movl     $0, %eax
         call     *%r10
    the function called:
    p_expr is a pointer:
    a_relation is an unsigned char
    The last 2 arguments are pointers.
    void CostModel::GetCompareSelectivity(
    p_expr                colexpr,
                        p_expr                expr2,
                        p_expr                expr2_converted,
                        a_relation           reln,
                        SelectivityEstimate      *est,
                        IHistogram          **hist )
    My uderstading of register usage during a function call on opteron (from
    http://www.x86-64.org/documentation/abi-0.96.pdf)
    %rdi - first argument - this pointer
    %rsi - second argument - colexpr
    %rdx - third argument - expr2
    %rcx - fourth argument - expr2_converted
    %r8 - fifth argument - reln
    %r9 - sixth argument - est
         %rcx and %r8 are being setup correctly by the calling function but they are changed by the code that is executed by the call psudo-op that
    calculates that virtual function address.
    setting up the function call
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at line 922 in file "dfp_compares.cpp"
    922 tempdatabase->CostModel->GetCompareSelectivity
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcbd
    0xfffffd7ffe85dcbd: ComputeSelectivity+0x038d: movq 0x0000000000000160(%r8),%r8
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcc4
    0xfffffd7ffe85dcc4: ComputeSelectivity+0x0394: movq 0x0000000000000000(%r8),%r14
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcc8
    0xfffffd7ffe85dcc8: ComputeSelectivity+0x0398: movq 0xffffffffffffff70(%rbp),%r13
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dccf
    0xfffffd7ffe85dccf: ComputeSelectivity+0x039f: movq 0xfffffffffffffff8(%rbp),%r12
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcd3
    0xfffffd7ffe85dcd3: ComputeSelectivity+0x03a3: movq 0xfffffffffffffff8(%rbp),%r11
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcd7
    0xfffffd7ffe85dcd7: ComputeSelectivity+0x03a7: movq 0xfffffffffffffff8(%rbp),%r10
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcdb
    0xfffffd7ffe85dcdb: ComputeSelectivity+0x03ab: movq 0xfffffffffffffff8(%rbp),%r8
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcdf
    0xfffffd7ffe85dcdf: ComputeSelectivity+0x03af: movzbl 0x0000000000000078(%r8),%eax
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dce4
    0xfffffd7ffe85dce4: ComputeSelectivity+0x03b4: movq 0xfffffffffffffff8(%rbp),%r9
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dce8
    0xfffffd7ffe85dce8: ComputeSelectivity+0x03b8: movq 0xfffffffffffffff8(%rbp),%r8
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcec
    0xfffffd7ffe85dcec: ComputeSelectivity+0x03bc: leaq 0x00000000000000c0(%r8),%r8
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcf3
    0xfffffd7ffe85dcf3: ComputeSelectivity+0x03c3: movq %r8,0x0000000000000000(%rsp)
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcf8
    0xfffffd7ffe85dcf8: ComputeSelectivity+0x03c8: leaq 0x0000000000000028(%r9),%r9
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcfc
    0xfffffd7ffe85dcfc: ComputeSelectivity+0x03cc: movl %eax,%r8d
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dcff
    0xfffffd7ffe85dcff: ComputeSelectivity+0x03cf: movq 0x00000000000000a8(%r10),%rcx
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd06
    0xfffffd7ffe85dd06: ComputeSelectivity+0x03d6: movq 0x0000000000000098(%r11),%rdx
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd0d
    0xfffffd7ffe85dd0d: ComputeSelectivity+0x03dd: movq 0x0000000000000090(%r12),%rsi
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd15
    0xfffffd7ffe85dd15: ComputeSelectivity+0x03e5: movq 0x0000000000000160(%r13),%rdi
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd1c
    0xfffffd7ffe85dd1c: ComputeSelectivity+0x03ec: movq 0x0000000000000030(%r14),%r10
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd20
    0xfffffd7ffe85dd20: ComputeSelectivity+0x03f0: movl $0x0000000000000000,%eax
    t@7 stepi
    t@7 (l@7) stopped in dfp_Compares::ComputeSelectivity at 0xfffffd7ffe85dd25
    0xfffffd7ffe85dd25: ComputeSelectivity+0x03f5: call *%r10d
    t@7 regs
    current frame: [1]
    r15 0x0000000000000000
    r14 0xfffffd7ffee61d60
    r13 0xfffffd7fed3f3890
    r12 0xfffffd7fed4573c0
    r11 0xfffffd7fed4573c0
    r10 0xfffffd7ffeaa3b20
    r9 0xfffffd7fed4573e8
    r8 0x0000000000000002
    rdi 0xfffffd7fed3ff1a8
    rsi 0x0000000000000000
    rbp 0xfffffd7ffdbfa730
    rbx 0xfffffd7ffdee1400
    rdx 0x0000000000000000
    rcx 0x0000000000000000
    rax 0x0000000000000000
    trapno 0x0000000000000001
    err 0x0000000000000000
    rip 0xfffffd7ffe85dd25:ComputeSelectivity+0x3f5 call *%r10d
    cs 0x000000000000004b
    eflags 0x0000000000000286
    rsp 0xfffffd7ffdbfa600
    ss 0x0000000000000043
    fs 0x00000000000001bb
    gs 0x0000000000000000
    es 0x0000000000000000
    ds 0x0000000000000000
    fsbase 0xfffffd7ffdee1400
    gsbase 0xffffffff80000000
    t@7
    %rcx contains 0 which is the correct value for expr2_converted
    %r8 contains 2 which is the correct value for reln
    step through the code generated by the call psudo-op
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b20
    0xfffffd7ffeaa3b20: __SLIP.THUNK__E : pushq %rbp
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b21
    0xfffffd7ffeaa3b21: __SLIP.THUNK__E+0x0001: movq %rsp,%rbp
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b24
    0xfffffd7ffeaa3b24: __SLIP.THUNK__E+0x0004: subq $0x0000000000000010,%rsp
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b28
    0xfffffd7ffeaa3b28: __SLIP.THUNK__E+0x0008: movq %rdi,0xfffffffffffffff8(%rbp)
    t@7 stepi
    %r8 is changed here:
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b2c
    0xfffffd7ffeaa3b2c: __SLIP.THUNK__E+0x000c: movq 0xfffffffffffffff8(%rbp),%r8
    t@7 p -fx $r8
    dbx: warning: The format '0x%x' is not suitable for type long long, will use 'llx' instead
    $r8 = 0x2
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b30
    0xfffffd7ffeaa3b30: __SLIP.THUNK__E+0x0010: leaq 0xfffffffffffffff8(%r8),%r8
    t@7 p -fx $r8
    dbx: warning: The format '0x%x' is not suitable for type long long, will use 'llx' instead
    $r8 = 0xfffffd7fed3ff1a8
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b34
    0xfffffd7ffeaa3b34: __SLIP.THUNK__E+0x0014: movq %r8,0xfffffffffffffff8(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b38
    0xfffffd7ffeaa3b38: __SLIP.THUNK__E+0x0018: movq 0xfffffffffffffff8(%rbp),%rdi
    t@7 stepi
    %rcx is chaged here:
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b3c
    0xfffffd7ffeaa3b3c: __SLIP.THUNK__E+0x001c: movq 0x000000000035d08d [ 0x35d08d ],%rcx
    t@7 p -fx $rcx
    dbx: warning: The format '0x%x' is not suitable for type long long, will use 'llx' instead
    $rcx = 0x0
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b43
    0xfffffd7ffeaa3b43: __SLIP.THUNK__E+0x0023: leave
    t@7 p -fx $rcx
    dbx: warning: The format '0x%x' is not suitable for type long long, will use 'llx' instead
    $rcx = 0xfffffd7ffeaa8aa0
    t@7 stepi
    t@7 (l@7) stopped in __SLIP.THUNK__E at 0xfffffd7ffeaa3b44
    0xfffffd7ffeaa3b44: __SLIP.THUNK__E+0x0024: jmp *%ecx
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8aa0
    0xfffffd7ffeaa8aa0: GetCompareSelectivity : pushq %rbp
    t@7 regs
    current thread: t@7
    current frame: [1]
    r15 0x0000000000000000
    r14 0xfffffd7ffee61d60
    r13 0xfffffd7fed3f3890
    r12 0xfffffd7fed4573c0
    r11 0xfffffd7fed4573c0
    r10 0xfffffd7ffeaa3b20
    r9 0xfffffd7fed4573e8
    r8 0xfffffd7fed3ff1a0
    rdi 0xfffffd7fed3ff1a0
    rsi 0x0000000000000000
    rbp 0xfffffd7ffdbfa730
    rbx 0xfffffd7ffdee1400
    rdx 0x0000000000000000
    rcx 0xfffffd7ffeaa8aa0
    rax 0x0000000000000000
    trapno 0x0000000000000001
    err 0x0000000000000000
    rip 0xfffffd7ffeaa8aa0:GetCompareSelectivity pushq %rbp
    cs 0x000000000000004b
    eflags 0x0000000000000282
    rsp 0xfffffd7ffdbfa5f8
    ss 0x0000000000000043
    fs 0x00000000000001bb
    gs 0x0000000000000000
    es 0x0000000000000000
    ds 0x0000000000000000
    fsbase 0xfffffd7ffdee1400
    gsbase 0xffffffff80000000
    step through the function prolog:
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8aa1
    0xfffffd7ffeaa8aa1: GetCompareSelectivity+0x0001: movq %rsp,%rbp
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8aa4
    0xfffffd7ffeaa8aa4: GetCompareSelectivity+0x0004: subq $0x0000000000000190,%rsp
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8aab
    0xfffffd7ffeaa8aab: GetCompareSelectivity+0x000b: movq %rbx,0xfffffffffffffea8(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ab2
    0xfffffd7ffeaa8ab2: GetCompareSelectivity+0x0012: movq %r12,0xfffffffffffffea0(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ab9
    0xfffffd7ffeaa8ab9: GetCompareSelectivity+0x0019: movq %r13,0xfffffffffffffe98(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ac0
    0xfffffd7ffeaa8ac0: GetCompareSelectivity+0x0020: movq %r14,0xfffffffffffffe90(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ac7
    0xfffffd7ffeaa8ac7: GetCompareSelectivity+0x0027: movq %r15,0xfffffffffffffe88(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ace
    0xfffffd7ffeaa8ace: GetCompareSelectivity+0x002e: movq %rdi,0xfffffffffffffff8(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ad2
    0xfffffd7ffeaa8ad2: GetCompareSelectivity+0x0032: movq %rsi,0xfffffffffffffff0(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ad6
    0xfffffd7ffeaa8ad6: GetCompareSelectivity+0x0036: movq %rdx,0xffffffffffffffe8(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ada
    0xfffffd7ffeaa8ada: GetCompareSelectivity+0x003a: movq %rcx,0xffffffffffffffe0(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ade
    0xfffffd7ffeaa8ade: GetCompareSelectivity+0x003e: movl %r8d,0xffffffffffffffdc(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ae2
    0xfffffd7ffeaa8ae2: GetCompareSelectivity+0x0042: movq %r9,0xffffffffffffffd0(%rbp)
    t@7 stepi
    t@7 (l@7) stopped in CostModel::GetCompareSelectivity at 0xfffffd7ffeaa8ae6
    0xfffffd7ffeaa8ae6: GetCompareSelectivity+0x0046: movl $0x0000000000000000,0xfffffffffffffeb0(%rbp)
    check the values of expr2_converted and reln
    t@7 p expr2_converted
    expr2_converted = 0xfffffd7ffeaa8aa0
    t@7 p reln
    reln = ' '
    t@7 p -fx reln
    reln = 0xa0
    and both values are incorrect because the values in registers %rcx and %r8
    have changed.sus
    Tom

    The original release of Sun Studio 10 had problems with saving and restoring registers in some cases on AMD64. Please visit the Sun Studio patch page at
    http://developers.sun.com/prodtech/cc/downloads/patches/index.html
    Download the current patches for
    C++ Compiler
    x86 compiler backend
    C++ shared library patch for your Solaris version.

Maybe you are looking for