PyLucene
  1. PyLucene
  2. PYLUCENE-17

Possible race condition with pylucene attachCurrentThread

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Labels:
    • Environment:
      Linux 2.6.39
      Sun jdk 1.6.26

      Description

      It looks like there is a possible race that can cause null pointer exceptions in the JVM, making it crash

      Because its a race it is hard to reproduce, the best luck I have had so far is dropping my FS cache in the OS, which seems to slow down the initialisation of the JVM enough to make it easier to reproduce.

      Attached is my test case

      Test session follows
      ---------------------------------------------------------------
      greg@localhost ~/programming/python $ sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
      greg@localhost ~/programming/python $ python ./lucene-threadtest.py
      #

      1. A fatal error has been detected by the Java Runtime Environment:
        #
      2. SIGSEGV (0xb) at pc=0x00007f79226b35c8, pid=26581, tid=140158003312384
        #
      3. JRE version: 6.0_26-b03
      4. Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
      5. Problematic frame:
      6. V [libjvm.so+0x4b05c8] instanceKlass::cached_itable_index(unsigned long)+0x18
        #
      7. An error report file with more information is saved as:
      8. /home/greg/programming/python/hs_err_pid26581.log
        #
      9. If you would like to submit a bug report, please visit:
      10. http://java.sun.com/webapps/bugreport/crash.jsp
        #
        Aborted (core dumped)
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        greg@localhost ~/programming/python $ rm -r /tmp/test-index/
        greg@localhost ~/programming/python $ sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        #
      11. A fatal error has been detected by the Java Runtime Environment:
        [thread 139988165344768 also had an error][thread 139988165344768 also had an error]#
      1. SIGSEGV (0xb)
        at pc=0x00007f5197550a29, pid=27657, tid=139988039468800
        #
      2. JRE version: 6.0_26-b03
      3. Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
      4. Problematic frame:
      5. V [libjvm.so+0x4f2a29] unsigned+0x299
        #
      6. An error report file with more information is saved as:
      7. /home/greg/programming/python/hs_err_pid27657.log
        #
      8. If you would like to submit a bug report, please visit:
      9. http://java.sun.com/webapps/bugreport/crash.jsp
        #
        Aborted (core dumped)
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        greg@localhost ~/programming/python $ sudo bash -c 'echo 3 > /proc/sys/vm/drop_caches'
        greg@localhost ~/programming/python $ python ./lucene-threadtest.py
        #
      10. A fatal error has been detected by the Java Runtime Environment:
        #
      11. SIGSEGV (0xb) at pc=0x00007f51bc2eaa1e, pid=28124, tid=139988377052928
        #
      12. JRE version: 6.0_26-b03
      13. Java VM: Java HotSpot(TM) 64-Bit Server VM (20.1-b02 mixed mode linux-amd64 compressed oops)
      14. Problematic frame:
      15. V [libjvm.so+0x4f2a1e] unsigned+0x28e
        #
      16. An error report file with more information is saved as:
      17. /home/greg/programming/python/hs_err_pid28124.log
        #
      18. If you would like to submit a bug report, please visit:
      19. http://java.sun.com/webapps/bugreport/crash.jsp
        #
        Aborted (core dumped)
        greg@localhost ~/programming/python $
      1. PYLUCENE-17-4.patch
        53 kB
        Patrick J. McNerthney
      2. diff.17.txt
        49 kB
        Andi Vajda
      3. PYLUCENE-17-3.patch
        7 kB
        Patrick J. McNerthney
      4. backtrace
        113 kB
        Greg Bowyer
      5. lucene-threadtest.py
        1 kB
        Greg Bowyer

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Greg Bowyer
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development