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

Re: [PBML] Perl error

Expand Messages
  • 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 1 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 2 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 3 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 4 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 5 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 6 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 7 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.