Results 1 to 6 of 6

Thread: MidletPascal - library error

  1. #1

    MidletPascal - library error

    Hello,
    i have problem with send mail (over smtp).
    I create library(in java for MidletPascal).
    Midlet pascal compils program OK, but when I run my program - it shut down and write error:
    Code:
    Running with storage root DefaultColorPhone 
    Running with locale: Czech_Czech Republic.1250 
    Error verifying method Lib_mylib sendmail(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/StringI 
    static Method............: 228ed64 'M.R (static)' 
    Stack Chunk.......: 20a125c 
    Frame Pointer.....: 20a1280 
    Current IP........: 228ec57 = 228ec18 + offset 63 
    Previous Frame....: 20a1268 
    Previous IP.......: 228eca7 (offset 3) 
    Approximate bytecode offset 9: Inconsistent or missing stackmap at target 
    Frame size........: 0 (0 arguments, 0 local variables) 
    Operand[1]........: 228ef30 
    Operand[2]........: 228eee4 
    Operand[3]........: 228eee4 
    Operand[4]........: 228eee4 
    Operand[5]........: 228eee4 
    
    Method............: 228ed04 'M.run (virtual)' 
    Stack Chunk.......: 20a125c 
    Frame Pointer.....: 20a1268 
    Current IP........: 228eca7 = 228eca4 + offset 3 
    Previous Frame....: 0 
    Previous IP.......: 1 
    Frame size........: 1 (1 arguments, 0 local variables) 
    Argument[0].......: 20a2d0c 
    
    VM status: 
    Instruction pointer.: 228ec57 (offset within invoking method: 63) 
    Next instruction....: 0xb8 
    Frame pointer.......: 20a1280 
    Local pointer.......: 20a1280 
    Stack size..........: 128; sp: 20a12a8; ranges: 20a1264-20a1464; 
    Contents of the current stack frame: 
    20a1280: 20a1268 (lp) (fp) 
    20a1284: 228eca7 
    20a1288: 20a127c 
    20a128c: 228ed64 
    20a1290: 20a125c 
    20a1294: 0 (end of frame) 
    20a1298: 228ef30 
    20a129c: 228eee4 
    ALERT: java/lang/VerifyError: Lib_mylib. 
    20a12a0: 228eee4 
    20a12a4: 228eee4 
    20a12a8: 228eee4 (sp) 
    Execution stack contains 72 items: 
    20a2d0c 
    0 
    1 
    228c318 
    228ed04 
    20a125c 
    0 
    20a1268 
    228eca7 
    20a127c 
    228ed64 
    20a125c 
    0 
    228ef30 
    228eee4 
    228eee4 
    228eee4 
    228eee4 
    
    Execution completed. 
    3473177 bytecodes executed 
    96 thread switches 
    1622 classes in the system (including system classes) 
    18222 dynamic objects allocated (555240 bytes) 
    4 garbage collections (477812 bytes collected) 
    Execution completed. 
    3473177 bytecodes executed 
    96 thread switches 
    1622 classes in the system (including system classes) 
    18222 dynamic objects allocated (555240 bytes) 
    4 garbage collections (477812 bytes collected)
    Do you want what it fix the problem?

    Sorry for my English, i'am from czech republic.

    MidletPascal:
    Code:
    program Test;
    uses mylib;
    
    var ok:integer;
    begin 
     ok:=MyLib.sendmail('smtp.etmail.cz','mmm.novak@seznam.cz','mmm.novak@seznam.cz','mmm.novak@seznam.cz','mmm.novak@seznam.cz');
      
      
     drawtext('bbb',50,50);
     repaint;
     
     delay(10000);
     end.
    Library:
    Code:
    import javax.microedition.lcdui.Command.*;
    import javax.microedition.lcdui.CommandListener.*;
    import javax.microedition.midlet.MIDlet.*;
    import javax.microedition.midlet.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import java.io.*;
    import java.util.*;
    
    public class Lib_mylib{
    
     public static int sendmail(String smtp, String from, String to, String subject, String msg)
        {
    
          SocketConnection sc;
          InputStream is;
          OutputStream os;
    
          sc=null;
          is=null;
          os=null;
    
          try {
    
                sc = (SocketConnection) Connector.open("socket://"+smtp+":25");
                is = sc.openInputStream();
                os = sc.openOutputStream();
    
                os.write(("HELO there" + "\r\n").getBytes()); 
                os.write(("mail FROM: "+ from +"\r\n").getBytes());
                os.write(("RCPT TO: "+ to + "\r\n").getBytes());
                os.write("DATA\r\n".getBytes());
                // stamp the msg with date
                os.write(("Date: " + new Date() + "\r\n").getBytes()); 
                os.write(("From: "+from+"\r\n").getBytes());
                os.write(("To: "+to+"\r\n").getBytes());
                os.write(("Subject: "+subject+"\r\n").getBytes());
                os.write((msg+"\r\n").getBytes()); // message body
                os.write(".\r\n".getBytes());
                os.write("QUIT\r\n".getBytes());
    
                // debug
                StringBuffer sb = new StringBuffer();
                int c = 0;
                while (((c = is.read()) != -1) )
                 {
                   sb.append((char) c);
                 }
              }
    
          catch(IOException e)
              {return 1;}
          finally
              {
                try
                  {
                   if(is != null)
                    {is.close();}
                   if(os != null)
                    {os.close();}
                   if(sc != null)
                    {sc.close();}
    
                  }
                catch(IOException e)
                  {
                    e.printStackTrace();
                    return 0;
                  }
              }
           return 1;
         }
    }
    Thank you.

  2. #2
    I bet you can find plenty of people blaming bugs in compilers in the competitive compiling disorder hosspital - the Gentoo forums. Seriously though, it very rare, but it happens. How rare depends on which compiler and how new the features are. Something like gcc is super solid, but it's not what i work with, at least not direcrly. Some CommonLisp compilers, which are essentially just giant piles of macros, are quite littered with //TODO fix this obscure bug comments, or casual mentions of deviations from standard.


    Last edited by salliborm12; 26-11-2025 at 10:14 PM.

  3. #3
    Your English is OK mmmnovak
    As for your mail problem I unfortunately have no solution to suggest.

  4. #4
    Can someone acknowledge that this was reply to a unsolved post from 2006?
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

  5. #5
    Quote Originally Posted by JernejL View Post
    Can someone acknowledge that this was reply to a unsolved post from 2006?
    It appears salliborm12 has a tenancy to post replies even on ancient threads. But his posts do seem a bit off.

  6. #6
    Oh dear. I totally missed the original post was decades old. Time sure flies.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •