Loading ...
Sorry, an error occurred while loading the content.

Perl error

Expand Messages
  • Octavian Rasnita
    Hi all, I ve tried to use a fork function in a CGI program to run another perl script, but it gives me a bad error: perl.exe - Application Error The
    Message 1 of 11 , Jan 30, 2003
    • 0 Attachment
      Hi all,

      I've tried to use a fork function in a CGI program to run another perl
      script, but it gives me a bad error:

      perl.exe - Application Error The instruction at "0x28068533" referenced
      memory at "0x00000004". The memory could not be "read". Click on OK to
      terminate the program Click on CANCEL to debug the program OK Cancel

      Here is the part of the script that forks (without it, the program works
      fine):

      $| = 1;
      $SIG{CHLD} = "IGNORE";
      fork;
      close STDOUT;close STDIN;close STDERR;
      exec 'perl m.pl';

      Please tell me what could be the problem.

      I am using Perl 5.8.0 under Windows 2000 with Apache 2.0.44.

      Thank you.

      Teddy,
      Teddy's Center: http://teddy.fcc.ro/
      Email: orasnita@...
    • Ben Maynard
      Someone is bound to correct me on this but as I recall the fork function has some major issues on win32 platforms ie. it doesn t work. If I am wrong on this or
      Message 2 of 11 , Jan 30, 2003
      • 0 Attachment
        Someone is bound to correct me on this but as I recall
        the fork function has some major issues on win32
        platforms ie. it doesn't work.

        If I am wrong on this or it has been corrected in more
        recent versions I apologise I haven't used win32 perl
        for several years.

        Regardless I don't think that code would work for a
        fork anyway try:

        # Untested

        if($pid = fork)
        {
        # do parent stuff
        }
        elsif (defined($pid))
        {
        exec 'perl m.pl';
        }
        else
        {
        print "Cannot fork: $!";
        }

        HTH

        Ben

        --- Octavian Rasnita <orasnita@...> wrote: > Hi
        all,
        >
        > I've tried to use a fork function in a CGI program
        > to run another perl
        > script, but it gives me a bad error:
        >
        > perl.exe - Application Error The instruction at
        > "0x28068533" referenced
        > memory at "0x00000004". The memory could not be
        > "read". Click on OK to
        > terminate the program Click on CANCEL to debug the
        > program OK Cancel
        >
        > Here is the part of the script that forks (without
        > it, the program works
        > fine):
        >
        > $| = 1;
        > $SIG{CHLD} = "IGNORE";
        > fork;
        > close STDOUT;close STDIN;close STDERR;
        > exec 'perl m.pl';
        >
        > Please tell me what could be the problem.
        >
        > I am using Perl 5.8.0 under Windows 2000 with Apache
        > 2.0.44.
        >
        > Thank you.
        >
        > Teddy,
        > Teddy's Center: http://teddy.fcc.ro/
        > Email: orasnita@...
        >
        >
        >
        > Unsubscribing info is here:
        > http://help.yahoo.com/help/us/groups/groups-32.html
        >
        > Your use of Yahoo! Groups is subject to
        > http://docs.yahoo.com/info/terms/
        >
        >

        __________________________________________________
        Do You Yahoo!?
        Everything you'll ever need on one web page
        from News and Sport to Email and Music Charts
        http://uk.my.yahoo.com
      • Jenda Krynicky
        From: Ben Maynard ... Well it does work. Kind of. It just does something a little different because the underlying OS is different. Same
        Message 3 of 11 , Jan 30, 2003
        • 0 Attachment
          From: Ben Maynard <liliafan@...>

          > Someone is bound to correct me on this but as I recall
          > the fork function has some major issues on win32
          > platforms ie. it doesn't work.

          Well it does work. Kind of. It just does something a little different
          because the underlying OS is different. Same for exec().

          > --- Octavian Rasnita <orasnita@...> wrote: > Hi
          > all,
          > >
          > > I've tried to use a fork function in a CGI program
          > > to run another perl
          > > script, but it gives me a bad error:
          > >
          > > perl.exe - Application Error The instruction at
          > > "0x28068533" referenced
          > > memory at "0x00000004". The memory could not be
          > > "read". Click on OK to
          > > terminate the program Click on CANCEL to debug the
          > > program OK Cancel
          > >
          > > Here is the part of the script that forks (without
          > > it, the program works
          > > fine):
          > >
          > > $| = 1;
          > > $SIG{CHLD} = "IGNORE";
          > > fork;
          > > close STDOUT;close STDIN;close STDERR;
          > > exec 'perl m.pl';
          > >
          > > Please tell me what could be the problem.

          Are you aware of the fact that you execute the exec() in BOTH
          threads/processes? Try to only exec() in the child as shown in the
          Ben's example.

          Jenda
          ===== Jenda@... === http://Jenda.Krynicky.cz =====
          When it comes to wine, women and song, wizards are allowed
          to get drunk and croon as much as they like.
          -- Terry Pratchett in Sourcery
        • Octavian Rasnita
          I ve tried this way first, but it gave me the same error. If I use just that code for forkin in a separate program, it works, but in the program I want to put
          Message 4 of 11 , Jan 30, 2003
          • 0 Attachment
            I've tried this way first, but it gave me the same error.

            If I use just that code for forkin in a separate program, it works, but in
            the program I want to put it, it doesn't work.

            Thanks.


            Teddy,
            Teddy's Center: http://teddy.fcc.ro/
            Email: orasnita@...

            ----- Original Message -----
            From: "Ben Maynard" <liliafan@...>
            To: <perl-beginner@yahoogroups.com>
            Sent: Thursday, January 30, 2003 6:56 PM
            Subject: Re: [PBML] Perl error


            Someone is bound to correct me on this but as I recall
            the fork function has some major issues on win32
            platforms ie. it doesn't work.

            If I am wrong on this or it has been corrected in more
            recent versions I apologise I haven't used win32 perl
            for several years.

            Regardless I don't think that code would work for a
            fork anyway try:

            # Untested

            if($pid = fork)
            {
            # do parent stuff
            }
            elsif (defined($pid))
            {
            exec 'perl m.pl';
            }
            else
            {
            print "Cannot fork: $!";
            }

            HTH

            Ben

            --- Octavian Rasnita <orasnita@...> wrote: > Hi
            all,
            >
            > I've tried to use a fork function in a CGI program
            > to run another perl
            > script, but it gives me a bad error:
            >
            > perl.exe - Application Error The instruction at
            > "0x28068533" referenced
            > memory at "0x00000004". The memory could not be
            > "read". Click on OK to
            > terminate the program Click on CANCEL to debug the
            > program OK Cancel
            >
            > Here is the part of the script that forks (without
            > it, the program works
            > fine):
            >
            > $| = 1;
            > $SIG{CHLD} = "IGNORE";
            > fork;
            > close STDOUT;close STDIN;close STDERR;
            > exec 'perl m.pl';
            >
            > Please tell me what could be the problem.
            >
            > I am using Perl 5.8.0 under Windows 2000 with Apache
            > 2.0.44.
            >
            > Thank you.
            >
            > Teddy,
            > Teddy's Center: http://teddy.fcc.ro/
            > Email: orasnita@...
            >
            >
            >
            > Unsubscribing info is here:
            > http://help.yahoo.com/help/us/groups/groups-32.html
            >
            > Your use of Yahoo! Groups is subject to
            > http://docs.yahoo.com/info/terms/
            >
            >

            __________________________________________________
            Do You Yahoo!?
            Everything you'll ever need on one web page
            from News and Sport to Email and Music Charts
            http://uk.my.yahoo.com

            Unsubscribing info is here:
            http://help.yahoo.com/help/us/groups/groups-32.html

            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          • Octavian Rasnita
            I ve tried that, but it is the same. I ve cut the script to see where is the problem and I found it though I don t know how to solve it. The problem is in the
            Message 5 of 11 , Jan 31, 2003
            • 0 Attachment
              I've tried that, but it is the same.
              I've cut the script to see where is the problem and I found it though I
              don't know how to solve it.

              The problem is in the DBI module.

              If I use the following script, it gives me that error.
              If I comment out the line
              use DBI;
              then the script works fine.

              Here is the script:

              #!/perl/bin/perl

              use DBI;

              print "Content-type: text/html\n\n";

              $| = 1;
              my $pid;

              if ($pid = fork()) {

              }
              elsif (defined $pid) {

              }
              else {

              }

              I use Perl 5.8.0 under Windows 2000.
              I guess it might be a bug in the DBI module, or... I don't know.

              I don't even know where to report it, because I'm sure it is a bug
              somewhere.

              Thank you.


              Teddy,
              Teddy's Center: http://teddy.fcc.ro/
              Email: orasnita@...

              ----- Original Message -----
              From: "Jenda Krynicky" <Jenda@...>
              To: <perl-beginner@yahoogroups.com>
              Sent: Thursday, January 30, 2003 7:11 PM
              Subject: Re: [PBML] Perl error


              From: Ben Maynard <liliafan@...>

              > Someone is bound to correct me on this but as I recall
              > the fork function has some major issues on win32
              > platforms ie. it doesn't work.

              Well it does work. Kind of. It just does something a little different
              because the underlying OS is different. Same for exec().

              > --- Octavian Rasnita <orasnita@...> wrote: > Hi
              > all,
              > >
              > > I've tried to use a fork function in a CGI program
              > > to run another perl
              > > script, but it gives me a bad error:
              > >
              > > perl.exe - Application Error The instruction at
              > > "0x28068533" referenced
              > > memory at "0x00000004". The memory could not be
              > > "read". Click on OK to
              > > terminate the program Click on CANCEL to debug the
              > > program OK Cancel
              > >
              > > Here is the part of the script that forks (without
              > > it, the program works
              > > fine):
              > >
              > > $| = 1;
              > > $SIG{CHLD} = "IGNORE";
              > > fork;
              > > close STDOUT;close STDIN;close STDERR;
              > > exec 'perl m.pl';
              > >
              > > Please tell me what could be the problem.

              Are you aware of the fact that you execute the exec() in BOTH
              threads/processes? Try to only exec() in the child as shown in the
              Ben's example.

              Jenda
              ===== Jenda@... === http://Jenda.Krynicky.cz =====
              When it comes to wine, women and song, wizards are allowed
              to get drunk and croon as much as they like.
              -- Terry Pratchett in Sourcery


              Unsubscribing info is here:
              http://help.yahoo.com/help/us/groups/groups-32.html

              Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            • Jenda Krynicky
              From: Octavian Rasnita ... What version of DBI do you have? This DOES look like a problem in DBI, but I think this has already been solved
              Message 6 of 11 , Feb 3, 2003
              • 0 Attachment
                From: "Octavian Rasnita" <orasnita@...>
                > I've tried that, but it is the same.
                > I've cut the script to see where is the problem and I found it though
                > I don't know how to solve it.
                >
                > The problem is in the DBI module.
                >
                > If I use the following script, it gives me that error.
                > If I comment out the line
                > use DBI;
                > then the script works fine.

                What version of DBI do you have?
                This DOES look like a problem in DBI, but I think this has already
                been solved in the newest version.

                Would it be possible to use DBI only in one thread and only AFTER the
                fork()? I have a service with two threads in 5.6.1 (build 631) and it
                works very fine this way. The easiest way is to have one "main"
                script that does whatever startup necessary (in my case creates some
                semaphores and a pipe), fork()s and requires a different script in
                parent and child. As long as I use DBI and DBD::ODBC only in one
                thread it worked all right.

                Jenda
                ===== Jenda@... === http://Jenda.Krynicky.cz =====
                When it comes to wine, women and song, wizards are allowed
                to get drunk and croon as much as they like.
                -- Terry Pratchett in Sourcery
              • Octavian Rasnita
                Thank you. I will try to use DBI only after forking. I have DBI.pm,v 11.18 2002/07/18 14:23:44 timbo Exp $ running under Windows 2000 and Perl 5.8.0. Teddy,
                Message 7 of 11 , Feb 3, 2003
                • 0 Attachment
                  Thank you. I will try to use DBI only after forking.

                  I have DBI.pm,v 11.18 2002/07/18 14:23:44 timbo Exp $
                  running under Windows 2000 and Perl 5.8.0.

                  Teddy,
                  Teddy's Center: http://teddy.fcc.ro/
                  Email: orasnita@...

                  ----- Original Message -----
                  From: "Jenda Krynicky" <Jenda@...>
                  To: <perl-beginner@yahoogroups.com>
                  Sent: Monday, February 03, 2003 4:47 PM
                  Subject: Re: [PBML] Perl error


                  > From: "Octavian Rasnita" <orasnita@...>
                  > > I've tried that, but it is the same.
                  > > I've cut the script to see where is the problem and I found it though
                  > > I don't know how to solve it.
                  > >
                  > > The problem is in the DBI module.
                  > >
                  > > If I use the following script, it gives me that error.
                  > > If I comment out the line
                  > > use DBI;
                  > > then the script works fine.
                  >
                  > What version of DBI do you have?
                  > This DOES look like a problem in DBI, but I think this has already
                  > been solved in the newest version.
                  >
                  > Would it be possible to use DBI only in one thread and only AFTER the
                  > fork()? I have a service with two threads in 5.6.1 (build 631) and it
                  > works very fine this way. The easiest way is to have one "main"
                  > script that does whatever startup necessary (in my case creates some
                  > semaphores and a pipe), fork()s and requires a different script in
                  > parent and child. As long as I use DBI and DBD::ODBC only in one
                  > thread it worked all right.
                  >
                  > Jenda
                  > ===== Jenda@... === http://Jenda.Krynicky.cz =====
                  > When it comes to wine, women and song, wizards are allowed
                  > to get drunk and croon as much as they like.
                  > -- Terry Pratchett in Sourcery
                  >
                  >
                  > Unsubscribing info is here:
                  http://help.yahoo.com/help/us/groups/groups-32.html
                  >
                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  >
                  >
                  >
                • Jenda Krynicky
                  From: Octavian Rasnita ... This is the version inside whatever version control system Tim Bunce uses. It would be better if you gave me
                  Message 8 of 11 , Feb 4, 2003
                  • 0 Attachment
                    From: "Octavian Rasnita" <orasnita@...>
                    > Thank you. I will try to use DBI only after forking.
                    >
                    > I have DBI.pm,v 11.18 2002/07/18 14:23:44 timbo Exp $
                    > running under Windows 2000 and Perl 5.8.0.

                    This is the version inside whatever version control system Tim Bunce
                    uses. It would be better if you gave me the one on

                    $DBI::VERSION = "..."
                    line.

                    Anyway the current is 1.32, but ActiveState still has 1.30.
                    I did compile DBI for myself, all tests passed and everything looks
                    normal. I can make it available in my repository if needed.

                    Jenda
                    P.S.: 1.32 is
                    # $Id: DBI.pm,v 11.23 2002/12/01 22:34:29 timbo Exp $

                    ===== Jenda@... === http://Jenda.Krynicky.cz =====
                    When it comes to wine, women and song, wizards are allowed
                    to get drunk and croon as much as they like.
                    -- Terry Pratchett in Sourcery
                  • Octavian Rasnita
                    I ve took a look, and I saw that I have the version 1.30 as you said. Can you tell me the address of your repository where I can find the DBI module? Thank
                    Message 9 of 11 , Feb 4, 2003
                    • 0 Attachment
                      I've took a look, and I saw that I have the version 1.30 as you said.
                      Can you tell me the address of your repository where I can find the DBI
                      module?

                      Thank you.

                      Teddy,
                      Teddy's Center: http://teddy.fcc.ro/
                      Email: orasnita@...

                      ----- Original Message -----
                      From: "Jenda Krynicky" <Jenda@...>
                      To: <perl-beginner@yahoogroups.com>
                      Sent: Tuesday, February 04, 2003 10:11 PM
                      Subject: Re: [PBML] Perl error


                      > From: "Octavian Rasnita" <orasnita@...>
                      > > Thank you. I will try to use DBI only after forking.
                      > >
                      > > I have DBI.pm,v 11.18 2002/07/18 14:23:44 timbo Exp $
                      > > running under Windows 2000 and Perl 5.8.0.
                      >
                      > This is the version inside whatever version control system Tim Bunce
                      > uses. It would be better if you gave me the one on
                      >
                      > $DBI::VERSION = "..."
                      > line.
                      >
                      > Anyway the current is 1.32, but ActiveState still has 1.30.
                      > I did compile DBI for myself, all tests passed and everything looks
                      > normal. I can make it available in my repository if needed.
                      >
                      > Jenda
                      > P.S.: 1.32 is
                      > # $Id: DBI.pm,v 11.23 2002/12/01 22:34:29 timbo Exp $
                      >
                      > ===== Jenda@... === http://Jenda.Krynicky.cz =====
                      > When it comes to wine, women and song, wizards are allowed
                      > to get drunk and croon as much as they like.
                      > -- Terry Pratchett in Sourcery
                      >
                      >
                      >
                      > Unsubscribing info is here:
                      http://help.yahoo.com/help/us/groups/groups-32.html
                      >
                      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                      >
                      >
                      >
                    • Jenda Krynicky
                      From: Octavian Rasnita ... You can now install it from http://Jenda.Krynicky.cz/perl/ I only have a 5.8 version there, the 5.6.1 one did
                      Message 10 of 11 , Feb 5, 2003
                      • 0 Attachment
                        From: "Octavian Rasnita" <orasnita@...>

                        > I've took a look, and I saw that I have the version 1.30 as you said.
                        > Can you tell me the address of your repository where I can find the
                        > DBI module?

                        You can now install it from http://Jenda.Krynicky.cz/perl/

                        I only have a 5.8 version there, the 5.6.1 one did not pass all
                        tests. (Well even the 5.8 skipped some, but that should be fine.)

                        Jenda
                        ===== Jenda@... === http://Jenda.Krynicky.cz =====
                        When it comes to wine, women and song, wizards are allowed
                        to get drunk and croon as much as they like.
                        -- Terry Pratchett in Sourcery
                      • Octavian Rasnita
                        Thank you! Teddy, Teddy s Center: http://teddy.fcc.ro/ Email: orasnita@home.ro ... From: Jenda Krynicky To:
                        Message 11 of 11 , Feb 6, 2003
                        • 0 Attachment
                          Thank you!

                          Teddy,
                          Teddy's Center: http://teddy.fcc.ro/
                          Email: orasnita@...

                          ----- Original Message -----
                          From: "Jenda Krynicky" <Jenda@...>
                          To: <perl-beginner@yahoogroups.com>
                          Sent: Wednesday, February 05, 2003 10:05 PM
                          Subject: Re: [PBML] Perl error


                          > From: "Octavian Rasnita" <orasnita@...>
                          >
                          > > I've took a look, and I saw that I have the version 1.30 as you said.
                          > > Can you tell me the address of your repository where I can find the
                          > > DBI module?
                          >
                          > You can now install it from http://Jenda.Krynicky.cz/perl/
                          >
                          > I only have a 5.8 version there, the 5.6.1 one did not pass all
                          > tests. (Well even the 5.8 skipped some, but that should be fine.)
                          >
                          > Jenda
                          > ===== Jenda@... === http://Jenda.Krynicky.cz =====
                          > When it comes to wine, women and song, wizards are allowed
                          > to get drunk and croon as much as they like.
                          > -- Terry Pratchett in Sourcery
                          >
                          >
                          >
                          > Unsubscribing info is here:
                          http://help.yahoo.com/help/us/groups/groups-32.html
                          >
                          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                          >
                          >
                          >
                        Your message has been successfully submitted and would be delivered to recipients shortly.