Hi,

I was trying to use FvwmDebug with an amd64, running a 64 bit system, when I found that it wouldn't load but exit with an error message "command is too big (`64-bit integer`), limit is 1000". Investigating the error I found that the perl module interface uses pack with fixed lengths, and not native lengths. I changed all formats of all longs to native and got the module to load.

However, there is still something strange going on with events, that I haven't been able pinpoint yet. When using mask -1 and xmask -1 for FvwmDebug I get the followinf output, which indicates something strange going on with 64-bit integers: FvwmDebug: FVWM::EventNames: Unknown event type (1111111111111111111111111111111110000000000000000000000000000100).
 Exiting.
DESTROY created new reference to dead object 'FVWM::Module' during global destruction.

However, I still get some events reported.

/Viktor Griph
? patchfile.64bit
? patchfile.amd64
Index: AUTHORS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/AUTHORS,v
retrieving revision 1.102
diff -u -u -r1.102 AUTHORS
--- AUTHORS     5 Feb 2005 16:37:45 -0000       1.102
+++ AUTHORS     27 Jun 2005 22:47:38 -0000
@@ -2,6 +2,9 @@
 Maintainers of GNU Software" (maintain.texi), the section called
 "Recording Changes".
 
+Viktor Griph:
+Patch for Perl modules on 64 bit machines.
+
 Bjoern Steinbrink:
 Patch for FvwmScript tasks running too often.
 
Index: NEWS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.553
diff -u -u -r1.553 NEWS
--- NEWS        2 Jun 2005 20:54:53 -0000       1.553
+++ NEWS        27 Jun 2005 22:47:40 -0000
@@ -12,6 +12,7 @@
    - Mouse/Key command no args possible core dump.
    - Direction with no args possible core dump.
    - FvwmScript periodic tasks run too often.
+   - Perl modules did not work on 64 machines.
 
 * New module features:
 
Index: perllib/ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/ChangeLog,v
retrieving revision 1.50
diff -u -u -r1.50 ChangeLog
--- perllib/ChangeLog   12 Jul 2004 02:23:09 -0000      1.50
+++ perllib/ChangeLog   27 Jun 2005 22:47:41 -0000
@@ -1,3 +1,18 @@
+2005-06-27  Viktor Griph <[EMAIL PROTECTED]>
+
+       * FVWM/Module.pm.in:
+       changed format for pack in send to use native longs
+       changed format for unpack in readPacket to use native longs
+       
+       * FVWM/EventNames.pm: 
+       changed all formats in $EVENTS_INFO to use native long
+       
+       * FVWM/create-constants: 
+       changed INTSIZE to be $Config{longsize} for 64-bit compilance
+
+       * FVWM/Constants.pm: 
+       regenerated file
+
 2004-07-12  Mikhael Goikhman  <[EMAIL PROTECTED]>
 
        * FVWM/Tracker/WindowList.pm:
Index: perllib/FVWM/Constants.pm
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/Constants.pm,v
retrieving revision 1.7
diff -u -u -r1.7 Constants.pm
--- perllib/FVWM/Constants.pm   17 Sep 2002 01:51:13 -0000      1.7
+++ perllib/FVWM/Constants.pm   27 Jun 2005 22:47:41 -0000
@@ -2,6 +2,7 @@
 
 package FVWM::Constants;
 use Exporter;
+use Config;
 @ISA = qw(Exporter);
 
 use constant M_NEW_PAGE => (1);
@@ -50,7 +51,7 @@
 use constant RESPONSE_READY => "NOP FINISHED STARTUP";
 use constant RESPONSE_UNLOCK => "NOP UNLOCK";
 use constant ON_EXIT => '1e20';
-use constant INTSIZE => 4;
+use constant INTSIZE => $Config{longsize};
 @EXPORT = qw(
   M_NEW_PAGE
   M_NEW_DESK
Index: perllib/FVWM/EventNames.pm
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/EventNames.pm,v
retrieving revision 1.11
diff -u -u -r1.11 EventNames.pm
--- perllib/FVWM/EventNames.pm  12 Jul 2004 14:04:02 -0000      1.11
+++ perllib/FVWM/EventNames.pm  27 Jun 2005 22:47:41 -0000
@@ -35,7 +35,7 @@
 $EVENTS_INFO = {
 
        &M_NEW_PAGE             => {
-               format => "l3L4",
+               format => "l!3L!4",
                fields => [
                        vp_x         => number,
                        vp_y         => number,
@@ -51,7 +51,7 @@
        },
 
        &M_NEW_DESK             => {
-               format => "l",
+               format => "l!",
                fields => [
                        desk_n       => number,
                ],
@@ -64,7 +64,7 @@
 #      },
 
        &M_RAISE_WINDOW         => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -73,7 +73,7 @@
        },
 
        &M_LOWER_WINDOW         => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -85,7 +85,7 @@
 #      },
 
        &M_FOCUS_CHANGE         => {
-               format => "L5",
+               format => "L!5",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -96,7 +96,7 @@
        },
 
        &M_DESTROY_WINDOW       => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -105,7 +105,7 @@
        },
 
        &M_ICONIFY              => {
-               format => "L3l8",
+               format => "L!3l!8",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -122,7 +122,7 @@
        },
 
        &M_DEICONIFY            => {
-               format => "L3l8",
+               format => "L!3l!8",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -139,7 +139,7 @@
        },
 
        &M_WINDOW_NAME          => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -149,7 +149,7 @@
        },
 
        &M_ICON_NAME            => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -159,7 +159,7 @@
        },
 
        &M_RES_CLASS            => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -169,7 +169,7 @@
        },
 
        &M_RES_NAME             => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -185,7 +185,7 @@
        },
 
        &M_ICON_LOCATION        => {
-               format => "L3l4",
+               format => "L!3l!4",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -198,7 +198,7 @@
        },
 
        &M_MAP                  => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -207,7 +207,7 @@
        },
 
        &M_ERROR                => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -217,7 +217,7 @@
        },
 
        &M_CONFIG_INFO          => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -233,7 +233,7 @@
        },
 
        &M_ICON_FILE            => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -243,7 +243,7 @@
        },
 
        &M_DEFAULTICON          => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -253,7 +253,7 @@
        },
 
        &M_STRING               => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -263,7 +263,7 @@
        },
 
        &M_MINI_ICON            => {
-               format => "L9a*",
+               format => "L!9a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -279,7 +279,7 @@
        },
 
        &M_WINDOWSHADE          => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -288,7 +288,7 @@
        },
 
        &M_DEWINDOWSHADE        => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -297,7 +297,7 @@
        },
 
        &M_VISIBLE_NAME         => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -310,14 +310,14 @@
 #      },
 
        &M_RESTACK              => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
                        ptr          => number,
                        low_windows  => looped,
                ],
-               loop_format => "L3a*",
+               loop_format => "L!3a*",
                loop_fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -326,7 +326,7 @@
        },
 
        &M_ADD_WINDOW           => {
-               format => "L3l6l8L2lL2l3S4a*",
+               format => "L!3l!6l!8L!2l!L!2l!3S4a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -362,7 +362,7 @@
        },
 
        &M_CONFIGURE_WINDOW     => {
-               format => "L3l6l8L2lL2l3S4a*",
+               format => "L!3l!6l!8L!2l!L!2l!3S4a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -401,7 +401,7 @@
 #      },
 
        &MX_VISIBLE_ICON_NAME   => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -411,7 +411,7 @@
        },
 
        &MX_ENTER_WINDOW        => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -420,7 +420,7 @@
        },
 
        &MX_LEAVE_WINDOW        => {
-               format => "L3",
+               format => "L!3",
                fields => [
                        win_id       => window,
                        frame_id     => window,
@@ -429,7 +429,7 @@
        },
 
        &MX_PROPERTY_CHANGE     => {
-               format => "L3a*",
+               format => "L!3a*",
                fields => [
                        type         => number,
                        value        => number,
Index: perllib/FVWM/Module.pm.in
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/Module.pm.in,v
retrieving revision 1.31
diff -u -u -r1.31 Module.pm.in
--- perllib/FVWM/Module.pm.in   12 Nov 2003 04:13:24 -0000      1.31
+++ perllib/FVWM/Module.pm.in   27 Jun 2005 22:47:42 -0000
@@ -357,7 +357,7 @@
                my $len = length $line;
                $SIG{PIPE} = sub { $self->debug("Failed send [$line]\n", 1); };
                $self->{ostream}->print(
-                       pack("lla${len}l", $winId, $len, $line, $continue)
+                       pack("l!l!a${len}l!", $winId, $len, $line, $continue)
                );
        }
        return $self;
@@ -422,7 +422,7 @@
        }
 
        my ($magic, $type, $len, $timestamp) =
-               unpack(sprintf("L%d", HEADER_SIZE), $header);
+               unpack(sprintf("L!%d", HEADER_SIZE), $header);
        $self->internalDie("Bad magic number $magic in packet")
                unless $magic == START_FLAG;
 
Index: perllib/FVWM/create-constants
===================================================================
RCS file: /home/cvs/fvwm/fvwm/perllib/FVWM/create-constants,v
retrieving revision 1.6
diff -u -u -r1.6 create-constants
--- perllib/FVWM/create-constants       17 Sep 2002 01:51:13 -0000      1.6
+++ perllib/FVWM/create-constants       27 Jun 2005 22:47:42 -0000
@@ -10,6 +10,7 @@
        echo ""; \
        echo "package FVWM::Constants;"; \
        echo "use Exporter;"; \
+        echo "use Config;"; \
        echo "@ISA = qw(Exporter);"; \
        echo ""; \
 ) \
@@ -31,7 +32,7 @@
 
 ( \
        echo "use constant ON_EXIT => '1e20';"; \
-       echo "use constant INTSIZE => 4;" \
+       echo "use constant INTSIZE => \$Config{longsize};" \
 ) \
        >>$outfile
 

Reply via email to