net.tcp.* connection problems leading to consistent crashes


    Jun 17 2006 | 9:13 am
    Hello,
    I have reported this problem a couple of months ago to the general
    Max list but have never received an answer.
    My problem concerns mxj net.tcp.send, and is as follows:
    1. I have computer A sitting behind a NAT router connecting to
    computer B on the Internet via net.tcp.send.
    2. On computer B I have a Max patch running with an instance of mxj
    net.tcp.recv.
    3. This instance now receives instructions from computer A to open
    another patch and to send some messages to the originating computer
    (i.e. A), after setting an instance of mxj net.tcp.send to computer
    A's IP address.
    The problem arises when
    1. the address computer B receives computer A's local IP address
    (instead of its public address) and tries to send messages to this IP
    address.
    2. upon noticing the error, computer B terminates the connection and
    closes the Max patch with the mxj net.tcp.send instance with 30
    active packets waiting to be delivered.
    3. Max crashes after approx. 90 seconds with the following crash log:
    Thread 4 Crashed:
    0 libjvm.dylib 0x9a757c74 JVM_GetLastErrorString
    + 8420
    1 libjvm.dylib 0x9a63e998 JNI_CreateJavaVM_Impl
    + 44252
    2 libjvm.dylib 0x9a63e88c JNI_CreateJavaVM_Impl
    + 43984
    3 libSystem.B.dylib 0x9002ba68 _pthread_body + 96
    It seems to me that the problem exists due to a miscommunication
    between Max and JVM.
    Georg

    • Jun 18 2006 | 4:58 pm
      > I have reported this problem a couple of months ago to the general
      > Max list but have never received an answer.
      The answer I gave you then was that I can't reproduce this crash. I
      just tried to emulate the situation you describe and I still can't
      reproduce the crash. Until you can create an example patch that
      reproducibly crashes we will probably not make much progress.
      Ben
    • Jun 19 2006 | 10:16 am
      Would it help if I gave you VNC access to our server? Because,
      otherwise, you may never be able to witness the crash, as it involves
      a remote XServe server running Max/MSP. Have you ever used Chicken of
      the VNC? If you're fine with my suggestion I'll send you the access
      data offline.
      Georg
    • Jun 20 2006 | 11:12 am
      Hello Ben,
      I painstakingly created after much trial and error a patch which will
      most likely demonstrate the crash on your machine with no need for an
      external server. It crashes my machine (Powerbook G4 1.25 GHz, Mac OS
      X 10.4.6, Max 4.5.7, Java 1.4.2) and a XServe (G4 1.0 GHz, Mac OS X
      Server 10.4.6, Max 4.5.7, Java 1.5). Please move the enclosed folder
      into the patches folder after moving the Java classes to the net->tcp
      folder.
      I'm realizing that the crash may even have something to do with the
      printing of an error message to the Max window, but I'll leave this
      to you to figure this out, as this is only an educated guess.
      Georg
      On Jun 18, 2006, at 6:58 PM, Ben Nevile wrote:
      >> I have reported this problem a couple of months ago to the general
      >> Max list but have never received an answer.
      >
      > The answer I gave you then was that I can't reproduce this crash. I
      > just tried to emulate the situation you describe and I still can't
      > reproduce the crash. Until you can create an example patch that
      > reproducibly crashes we will probably not make much progress.
      >
      > Ben
      >
      >
      >
      >
      >> My problem concerns mxj net.tcp.send, and is as follows:
      >>
      >> 1. I have computer A sitting behind a NAT router connecting to
      >> computer B on the Internet via net.tcp.send.
      >> 2. On computer B I have a Max patch running with an instance of mxj
      >> net.tcp.recv.
      >> 3. This instance now receives instructions from computer A to open
      >> another patch and to send some messages to the originating computer
      >> (i.e. A), after setting an instance of mxj net.tcp.send to computer
      >> A's IP address.
      >>
      >> The problem arises when
      >> 1. the address computer B receives computer A's local IP address
      >> (instead of its public address) and tries to send messages to this IP
      >> address.
      >> 2. upon noticing the error, computer B terminates the connection and
      >> closes the Max patch with the mxj net.tcp.send instance with 30
      >> active packets waiting to be delivered.
      >> 3. Max crashes after approx. 90 seconds with the following crash log:
      >>
      >> Thread 4 Crashed:
      >> 0 libjvm.dylib 0x9a757c74
      >> JVM_GetLastErrorString
      >> + 8420
      >> 1 libjvm.dylib 0x9a63e998
      >> JNI_CreateJavaVM_Impl
      >> + 44252
      >> 2 libjvm.dylib 0x9a63e88c
      >> JNI_CreateJavaVM_Impl
      >> + 43984
      >> 3 libSystem.B.dylib 0x9002ba68 _pthread_body + 96
      >>
      >> It seems to me that the problem exists due to a miscommunication
      >> between Max and JVM.
      >>
      >> Georg
      >>
      >>
    • Jun 20 2006 | 12:39 pm
      I wonder if it is related to a crash I found when trying to openConnection() or openStream() to a URL. If I would post, I would crash, however System.out.println would work fine. Perhaps try that? Total shot in the dark.
      Ah.. Max and idiosyncrasies.
    • Jun 20 2006 | 9:07 pm
      I simply extended the existing net.tcp.send and receive objects by
      some simple list processing stuff. The problem probably lies in the
      sheer size of the packets not being able to be delivered when the IP
      address doesn't exist. After time-out net.tcp.packer (as I call my
      pbject) prints an error message to the Max window and I'm wondering
      whether that's where the problems lies. Unfortunately, I can't modify
      the TcpSender class.
      Best,
      Georg
      On Jun 20, 2006, at 2:39 PM, vade wrote:
      >
      > I wonder if it is related to a crash I found when trying to
      > openConnection() or openStream() to a URL. If I would post, I would
      > crash, however System.out.println would work fine. Perhaps try
      > that? Total shot in the dark.
      >
      > Ah.. Max and idiosyncrasies.