Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4250859

On NT, setting the clipboard to StringSelection(null) causes NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.2.1
    • client-libs
    • beta
    • x86
    • windows_nt

      Param#4 Function Name
      0574fd80 77f04f85 00000160 ffffffff 00000000 50241c6b ntdll!NtWaitForSingleObject
      00000001 00000000 00000000 00000000 00000000 00000000 kernel32!WaitForSingleObject
      (Review ID: 85029)
      ======================================================================


      Name: skT88420 Date: 06/30/99


      If you have a JTextArea with no selected text, yet the user causes
      a Copy action to occur, then getSelectedText() returns null. If
      you create a StringSelection directly on the null, then try to
      set the contents of the clipboard, the JVM aborts.

      This problem appears on NT 4.0; under Solaris_JDK_1.2.1_02,
      it works as expected.

      java version "1.2.1"
      Classic VM (build JDK-1.2.1-A, native threads)

      Code sample:

      import java.awt.*;
      import java.awt.datatransfer.*;
      import javax.swing.*;

      public class NullTest {
        public static void main (String[] args) {
          JTextArea textArea = new JTextArea("some text");
          String txt = textArea.getSelectedText();
          StringSelection selectedString = new StringSelection(txt);
          Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selectedString, selectedString);
          System.out.println("everything worked ok");
        }
      }


      Dr. Watson Log:

      Application exception occurred:
              App: java.exe (pid=297)
              When: 6/30/1999 @ 12:24:1.168
              Exception number: c0000005 (access violation)

      *----> System Information <----*
              Computer Name: MROA410212
              User Name: SY42xxx
              Number of Processors: 1
              Processor Type: x86 Family 6 Model 5 Stepping 2
              Windows Version: 4.0
              Current Build: 1381
              Current Type: Uniprocessor Free
              Registered Organization: Fidelity Investments
              Registered Owner: Fidelity Investments

      *----> Task List <----*
         0 Idle.exe
         2 System.exe
        20 smss.exe
        24 csrss.exe
        34 winlogon.exe
        42 services.exe
        45 lsass.exe
        68 spoolss.exe
        82 Apache.exe
        85 Apache.exe
        88 smartagt.exe
        91 INV32CLI.exe
       148 navapsvc.exe
       159 npssvc.exe
       163 nwmsgsvc.exe
       169 RpcSs.exe
       175 AtSvc.exe
       182 war-ftpd.exe
       209 alertsvc.exe
       281 nddeagnt.exe
       288 Explorer.exe
       285 SysTray.exe
       283 DACONFIG.exe
       278 em_exec.exe
       304 navapw32.exe
       301 NSCHEDNT.exe
       291 FINDFAST.exe
       305 TASKMGR.exe
       314 pcmwin32.exe
       333 ntvdm.exe
       345 outlook.exe
       246 MAPISP32.exe
       245 climonnt.exe
       292 Winword.exe
        76 MEW32.exe
       241 CMD.exe
        71 ddhelp.exe
       310 netscape.exe
       216 CMD.exe
       297 java.exe
       339 drwtsn32.exe
         0 _Total.exe

      (00400000 - 0040a000) java.exe
      (77f60000 - 77fbc000) dll\ntdll.dbg
      (77dc0000 - 77dfe000) dll\advapi32.dbg
      (77f00000 - 77f5e000) dll\kernel32.dbg
      (77e70000 - 77ec4000) dll\user32.dbg
      (77ed0000 - 77efc000) dll\gdi32.dbg
      (77e10000 - 77e62000) dll\rpcrt4.dbg
      (78000000 - 7803d000)
      (50420000 - 50488000) jvm.dll
      (50240000 - 5024a000) hpi.dll
      (77fd0000 - 77ffa000) dll\winmm.dbg
      (6bd00000 - 6bd1a000) d:\c151a11\bin\i386\free\cs32ba11.dll
      (50270000 - 5029e000) java.dll
      (77c40000 - 77d7c000) dll\shell32.dbg
      (77bf0000 - 77c3f000) dll\comctl32.dbg
      (50400000 - 50414000) zip.dll
      (5f810000 - 5f817000) dll\rpcltc1.dbg
      (50390000 - 50390000)
      (50040000 - 50172000) awt.dll
      (77d80000 - 77db2000) dll\comdlg32.dbg
      (76ab0000 - 76ab5000) dll\imm32.dbg
      (77b20000 - 77bd2000) dll\ole32.dbg
      (501f0000 - 50240000) fontmanager.dll

      State Dump for Thread Id 0x150

      eax=00000000 ebx=007d0260 ecx=0012ff18 edx=007d0260 esi=007c5660 edi=007c5634
      eip=5043cd2d esp=0012fe44 ebp=0012fe5c iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: JVM_GetCPMethodModifiers
              5043cd12 8b542404 mov edx,[esp+0x4] ss:00d4e84b=????????
              5043cd16 8b442408 mov eax,[esp+0x8] ss:00d4e84b=????????
              5043cd1a 85c0 test eax,eax
              5043cd1c 740d jz JVM_GetCPMethodModifiers+0x1b268 (5043cd2b)
              5043cd1e 8b00 mov eax,[eax] ds:00000000=????????
              5043cd20 8b00 mov eax,[eax] ds:00000000=????????
              5043cd22 8b4008 mov eax,[eax+0x8] ds:00c1ea06=????????
              5043cd25 894a38 mov [edx+0x38],ecx ds:013eec66=????????
              5043cd28 c20800 ret 0x8
              5043cd2b 33c0 xor eax,eax
      FAULT ->5043cd2d 8b00 mov eax,[eax] ds:00000000=????????
              5043cd2f 8b4008 mov eax,[eax+0x8] ds:00c1ea06=????????
              5043cd32 894a38 mov [edx+0x38],ecx ds:013eec66=????????
              5043cd35 c20800 ret 0x8
              5043cd38 90 nop
              5043cd39 90 nop
              5043cd3a 90 nop
              5043cd3b 90 nop
              5043cd3c 90 nop
              5043cd3d 90 nop
              5043cd3e 90 nop
              5043cd3f 90 nop

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      0012fe40 5008083f 007d0260 00000000 007c5634 007d0260 jvm!JVM_GetCPMethodModifiers (FPO: [2,0,0])
      0012fe5c 50432972 00000000 0012fe84 007c5660 500420fe awt!<nosymbols>
      0012fe7c 5042a287 01602930 051077bc 00000002 007d0260 jvm!JVM_GetCPMethodModifiers (FPO: [EBP 0x500420fe] [4,0,4])
      0012fea0 5046dbbc 01602930 051077bc 00000002 00010001 jvm!JVM_GetCPMethodModifiers (FPO: [EBP 0x007c565c] [4,0,4])
      007c56d8 500420fe 00000000 00000000 04a99700 04a99bd7 jvm!JVM_GetCPMethodModifiers
      00000002 00000000 00000000 00000000 00000000 00000000 awt!Java_sun_awt_windows_WClipboard_setClipboardText

      *----> Raw Stack Dump <----*
      0012fe44 3f 08 08 50 60 02 7d 00 - 00 00 00 00 34 56 7c 00 ?..P`.}.....4V|.
      0012fe54 60 02 7d 00 60 56 7c 00 - bc 77 10 05 72 29 43 50 `.}.`V|..w..r)CP
      0012fe64 00 00 00 00 84 fe 12 00 - 60 56 7c 00 fe 20 04 50 ........`V|.. .P
      0012fe74 bc 77 10 05 60 02 7d 00 - e0 02 7d 00 87 a2 42 50 .w..`.}...}...BP
      0012fe84 30 29 60 01 bc 77 10 05 - 02 00 00 00 60 02 7d 00 0)`..w......`.}.
      0012fe94 5c 56 7c 00 e7 78 10 05 - 28 56 7c 00 34 56 7c 00 \V|..x..(V|.4V|.
      0012fea4 bc db 46 50 30 29 60 01 - bc 77 10 05 02 00 00 00 ..FP0)`..w......
      0012feb4 01 00 01 00 00 03 00 00 - b4 39 85 00 bc 55 7c 00 .........9...U|.
      0012fec4 60 02 7d 00 60 74 10 05 - bc 55 7c 00 60 02 7d 00 `.}.`t...U|.`.}.
      0012fed4 fe a9 43 50 fc fe 12 00 - 60 02 7d 00 b4 39 85 00 ..CP....`.}..9..
      0012fee4 b0 55 7c 00 00 00 00 00 - e7 14 42 50 60 02 80 8a .U|.......BP`...
      0012fef4 00 00 00 00 00 00 00 00 - d9 00 01 b1 00 00 00 00 ................
      0012ff04 00 00 00 00 60 02 7d 00 - f2 fe 12 00 b4 39 85 00 ....`.}......9..
      0012ff14 dc c9 43 50 60 02 7d 00 - b0 55 7c 00 b4 39 85 00 ..CP`.}..U|..9..
      0012ff24 30 ab 43 50 30 ff 12 00 - 0a 03 00 00 44 ff 12 00 0.CP0.......D...
      0012ff34 e1 14 40 00 60 02 7d 00 - b0 55 7c 00 b4 39 85 00 ..@.`.}..U|..9..
      0012ff44 b8 55 7c 00 b0 55 fa 77 - ca c1 f6 77 c0 ff 12 00 .U|..U.w...w....
      0012ff54 00 f0 fd 7f 60 02 7d 00 - d3 0e 7d 00 01 00 00 00 ....`.}...}.....
      0012ff64 00 00 00 00 64 96 47 50 - e7 14 42 50 4f 11 42 50 ....d.GP..BPO.BP
      0012ff74 af 2f 40 00 00 00 00 00 - 88 0e 7d 00 50 0b 7d 00 ./@.......}.P.}.

      State Dump for Thread Id 0xf9

      eax=78003659 ebx=00000000 ecx=007d0260 edx=00000000 esi=000000c0 edi=00000000
      eip=77f681ab esp=04c6ff18 ebp=04c6ff3c iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:0588e91f=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      04c6ff3c 77f04f85 000000c0 ffffffff 00000000 50242c8b ntdll!NtWaitForSingleObject
      04c6ffb8 77f04f2c 008287b0 50439a02 007c557c 008287b0 kernel32!WaitForSingleObject
      04c6ffec 00000000 00000000 00000000 00000000 00000000 kernel32!lstrcmpiW
      00000000 00000000 00000000 00000000 00000000 00000000 java!<nosymbols>

      State Dump for Thread Id 0x104

      eax=015f93c0 ebx=00000000 ecx=0000000b edx=00000000 esi=000000dc edi=00000000
      eip=77f681ab esp=04d6fdd8 ebp=04d6fdfc iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:0598e7df=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      04d6fdfc 77f04f85 000000dc ffffffff 00000000 50241c6b ntdll!NtWaitForSingleObject
      00000001 00000000 00000000 00000000 00000000 00000000 kernel32!WaitForSingleObject

      State Dump for Thread Id 0x15d

      eax=04e6fe50 ebx=00000000 ecx=503e8585 edx=00000000 esi=000000c4 edi=00000000
      eip=77f681ab esp=04e6fd4c ebp=04e6fd70 iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:05a8e753=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      04e6fd70 77f04f85 000000c4 ffffffff 00000000 50241c6b ntdll!NtWaitForSingleObject
      00000001 00000000 00000000 00000000 00000000 00000000 kernel32!WaitForSingleObject

      *----> Raw Stack Dump <----*
      04e6fd4c ba c5 f1 77 c4 00 00 00 - 00 00 00 00 00 00 00 00 ...w............
      04e6fd5c 20 6f 7c 00 60 ad 82 00 - ff ff ff ff 78 b5 a8 04 o|.`.......x...
      04e6fd6c 84 ff e6 04 01 00 00 00 - 85 4f f0 77 c4 00 00 00 .........O.w....
      04e6fd7c ff ff ff ff 00 00 00 00 - 6b 1c 24 50 c4 00 00 00 ........k.$P....
      04e6fd8c ff ff ff ff 60 ad 82 00 - e0 ac 82 00 bc fd e6 04 ....`...........
      04e6fd9c f4 fd e6 04 78 c1 45 50 - 60 ad 82 00 20 6f 7c 00 ....x.EP`... o|.
      04e6fdac ff ff ff ff ff ff ff ff - ff ff ff ff ff ff ff ff ................
      04e6fdbc 00 00 00 00 d6 bc 44 50 - e0 ac 82 00 38 93 5f 01 ......DP....8._.
      04e6fdcc ff ff ff ff ff ff ff ff - e0 ac 82 00 58 ce 7c 00 ............X.|.
      04e6fddc 00 00 00 00 54 a6 3e 50 - e0 ac 82 00 f4 fd e6 04 ....T.>P........
      04e6fdec 00 00 00 00 00 00 00 00 - 38 93 5f 01 38 93 5f 01 ........8._.8._.
      04e6fdfc 40 93 5f 01 00 00 00 00 - a5 50 e9 04 f0 b1 a8 04 @._......P......
      04e6fe0c 00 00 00 00 18 f0 62 01 - f0 b1 a8 04 38 93 5f 01 ......b.....8._.
      04e6fe1c f0 b1 a8 04 0e e4 3a 50 - 88 fe e6 04 50 b5 a8 04 ......:P....P...
      04e6fe2c 40 fe e6 04 e0 ac 82 00 - 3f 84 3e 50 00 00 00 00 @.......?.>P....
      04e6fe3c 00 00 00 00 00 00 00 00 - e0 ac 82 00 e0 ac 82 00 ................
      04e6fe4c f0 b1 a8 04 a8 ff e6 04 - a7 7a 3e 50 00 00 00 00 .........z>P....
      04e6fe5c ff ff ff ff 00 00 00 00 - 7f 02 05 05 20 b6 a8 04 ............ ...
      04e6fe6c 00 00 00 00 00 00 00 00 - 00 00 00 00 8c fe e6 04 ................
      04e6fe7c e0 fd e6 04 09 00 00 00 - 09 01 00 00 12 02 01 ff ................

      State Dump for Thread Id 0x167

      eax=78003659 ebx=00000000 ecx=0000000f edx=00000000 esi=0000010c edi=00000000
      eip=77f681ab esp=052ffdd8 ebp=052ffdfc iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:05f1e7df=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      052ffdfc 77f04f85 0000010c ffffffff 00000000 50241c6b ntdll!NtWaitForSingleObject
      00000001 00000000 00000000 00000000 00000000 00000000 kernel32!WaitForSingleObject

      State Dump for Thread Id 0x155

      eax=78003659 ebx=00000000 ecx=00000016 edx=00000000 esi=00000114 edi=00000000
      eip=77f681ab esp=053ffdd8 ebp=053ffdfc iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:0601e7df=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      053ffdfc 77f04f85 00000114 ffffffff 00000000 50241c6b ntdll!NtWaitForSingleObject
      00000001 00000000 00000000 00000000 00000000 00000000 kernel32!WaitForSingleObject

      State Dump for Thread Id 0x12c

      eax=00000000 ebx=04fd87a4 ecx=ffffffff edx=00000000 esi=501667e0 edi=77e7275f
      eip=77e7276a esp=054ffe74 ebp=008ab2e0 iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: WaitMessage
              77e7275f b802120000 mov eax,0x1202
              77e72764 8d542404 lea edx,[esp+0x4] ss:0611e87b=????????
              77e72768 cd2e int 2e
              77e7276a c3 ret
              77e7276b 56 push esi
              77e7276c 33c0 xor eax,eax
              77e7276e 8b742408 mov esi,[esp+0x8] ss:0611e87b=????????
              77e72772 8b4e10 mov ecx,[esi+0x10] ds:50d851e6=????????
              77e72775 03ce add ecx,esi
              77e72777 394608 cmp [esi+0x8],eax ds:50d851e6=????????
              77e7277a 760e jbe WaitMessage+0x2b (77e7278a)
              77e7277c 8b11 mov edx,[ecx] ds:ffffffff=????????
              77e7277e 40 inc eax
              77e7277f 83c104 add ecx,0x4
              77e72782 013432 add [edx+esi],esi ds:501667e0=00000001

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
      008ab2e0 05028ca0 05028d84 0162bf88 00000000 00000000 user32!WaitMessage

      State Dump for Thread Id 0x109

      eax=057b7ff0 ebx=00000000 ecx=057b1aec edx=00000000 esi=00000160 edi=00000000
      eip=77f681ab esp=0574fd5c ebp=0574fd80 iopl=0 nv up ei pl zr na po nc
      cs=001b ss=0023 ds=0023 es=0023 fs=0038 gs=0000 efl=00000246


      function: NtWaitForSingleObject
              77f681a0 b8c5000000 mov eax,0xc5
              77f681a5 8d542404 lea edx,[esp+0x4] ss:0636e763=????????
              77f681a9 cd2e int 2e
              77f681ab c20c00 ret 0xc
              77f681ae 8bc0 mov eax,eax

      *----> Stack Back Trace <----*

      FramePtr ReturnAd Param#1 Param#2 Param#3

            dmendenhsunw David Mendenhall (Inactive)
            skonchad Sandeep Konchady
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: