Xlib: extension "MIT-SHM" = ?

Xlib: extension "MIT-SHM" = ?

Post by USENE » Tue, 23 Mar 1999 04:00:00



# ./xfqcam
Xlib:  extension "MIT-SHM" missing on display "123.56.78.7:0.0".
Segmentation fault (core dumped)        

I am running eXceed v6.1 for WinNT (Workstation SP4).  What does this error
mean for the UNIX machine?  My kernel is 2.2.3 btw...

 
 
 

Xlib: extension "MIT-SHM" = ?

Post by Josh Ste » Tue, 23 Mar 1999 04:00:00


Quote:>Xlib:  extension "MIT-SHM" missing on display "123.56.78.7:0.0".
>Segmentation fault (core dumped)    

>I am running eXceed v6.1 for WinNT (Workstation SP4).  What does this error
>mean for the UNIX machine?  My kernel is 2.2.3 btw...

It sounds like you are running a buggy X program that assumes the X Server
it is talking to will operate using the MIT Shared memory extensions with
it and it dies when this doesn't work.  Note that even if the X Server
implements MIT shared memory extensions, they can't be used (for obvious
reasons) if the client and the display are on two different machines.  
A well written program will normally check whether the extension is there
and the X Server is on the same machine, and will use a different
display strategy where one of these conditions fails.

- Josh

 
 
 

Xlib: extension "MIT-SHM" = ?

Post by President Bill Clinto » Wed, 24 Mar 1999 04:00:00




Subject: mit-shm
Date: Mon, 22 Mar 1999 13:10:14 -0500
Reply   Reply All       Forward         Delete          Previous        Next            Close  
Dear Mr. Pascal:

You can enable MIT-SHM extension by going into XCONFIG, PROTOCOL,
EXTENSIONS, then place a checkmark beside MIT-SHM, and hit ok.

I would very much appreciate any details you can give me concerning your
company name, address, and telephone number so that I may add this
information to our records.

Please let me know if you experience any problems.

I tried calling you but was unable to get a line through.

Jawad Hussain
Technical Support
Hummingbird Communications Ltd.
(416) 496-2200 x 2403



Quote:> # ./xfqcam
> Xlib:  extension "MIT-SHM" missing on display "123.56.78.7:0.0".
> Segmentation fault (core dumped)  

> I am running eXceed v6.1 for WinNT (Workstation SP4).  What does this
error
> mean for the UNIX machine?  My kernel is 2.2.3 btw...

 
 
 

Xlib: extension "MIT-SHM" = ?

Post by USENE » Wed, 24 Mar 1999 04:00:00




Subject: mit-shm
Date: Mon, 22 Mar 1999 13:10:14 -0500

Dear Mr. Pascal:

You can enable MIT-SHM extension by going into XCONFIG, PROTOCOL,
EXTENSIONS, then place a checkmark beside MIT-SHM, and hit ok.

I would very much appreciate any details you can give me concerning your
company name, address, and telephone number so that I may add this
information to our records.

Please let me know if you experience any problems.

I tried calling you but was unable to get a line through.

Jawad Hussain
Technical Support
Hummingbird Communications Ltd.
(416) 496-2200 x 2403



Quote:> # ./xfqcam
> Xlib:  extension "MIT-SHM" missing on display "123.56.78.7:0.0".
> Segmentation fault (core dumped)  

> I am running eXceed v6.1 for WinNT (Workstation SP4).  What does this
error
> mean for the UNIX machine?  My kernel is 2.2.3 btw...

 
 
 

Xlib: extension "MIT-SHM" = ?

Post by Josh Ste » Wed, 24 Mar 1999 04:00:00


Quote:>I have the source code to this program.
>http://www.1000klub.com/~loomer/qcam.html is the URL.

>Think it'd be possible to hack it to check whether the extension is there
>and the X server is on the same machine, and use a different display
>strategy where one of these conditions fails?

Of course.  I don't have time to look at your code in detail but
I took a quick glance and it looks like it tries to figure out
at compile time whether to use shared memory or not.  So
basically you should be able to do the test at run time and
replace the #ifdef's with real ifs (assuming there are not
other bugs).

The runtime test would look something like this:

Display* disp  = XOpenDisplay(displayName);
int has_Shared = XShmQueryExtension(disp);

int ok = has_Shared && onSameMachine(displayName);

- Josh

/** Not Debugged **/

int onSameMachine(char* displayName)
{
int ret=0;
#define inetAddrLength 4
if (displayName) {
    char* whereColon = strchr(dispName,':');
    if (whereColon) {
      if (whereColon == dispName) {
           ret = true;
      }
      else {
           const size_t BIGHOSTNAME=256;
           char arr1[BIGHOSTNAME];
           char arr2[BIGHOSTNAME];
           ptrdiff_t sz=0;
           if (gethostname(arr1,BIGHOSTNAME-1) == 0) {
                // arr should hold the name of the local host
                sz = whereColon - dispName;
                char* tptr;
                if (sz > 127) {
                  tptr = new char[sz+1];
                }
                else {
                  tptr = arr2;
                }      
                strncpy(tptr,dispName,sz);
                tptr[sz] = '\0';

                struct hostent* he = gethostbyname(tptr);
                char iaddr1[inetAddrLength];
                if (he) {
                  if (strcmp(arr1,tptr)==0) {
                    ret = true;
                  }
                  else {
                    char* aptr = he->h_addr_list[0];
                    strncpy(iaddr1,aptr,inetAddrLength);
                    he = gethostbyname(arr1);
                    if (strncmp(iaddr1,aptr,inetAddrLength)==0) {
                    {
                         ret = true;
                    }
                  }
                }
                if (tptr != arr2) {
                  delete [] tptr;
                }
           }
      }
    }
  }
  return ret;

Quote:}

 
 
 

Xlib: extension "MIT-SHM" = ?

Post by USENE » Wed, 24 Mar 1999 04:00:00


As you can see by my other post, I figured out how to enable MIT-SHM
extension in eXceed v6.1 for NT.

Now the problem is this:

# modprobe bw-qcam
/lib/modules/2.2.3-5/misc/bw-qcam.o: init_module: Device or resource busy
parport: Device or resource busy

Why is it saying this?  I don't have a printer or anything on my parport,
just the BW QuickCam.  Howcome it is saying that parport is busy?
p.s.:  Here is an lsmod output:

# lsmod
Module                  Size  Used by
parport_probe           2852   0  (autoclean)
parport_pc              5012   0  (autoclean)
parport                 6996   0  [parport_probe parport_pc]
videodev                2368   0
sound                  58552   0  (autoclean) (unused)
soundcore               2404   3  (autoclean) [sound]
soundlow                 300   0  (autoclean) [sound]
ne                      6448   1  (autoclean)
8390                    5888   0  (autoclean) [ne]



Quote:> >I have the source code to this program.
> >http://www.1000klub.com/~loomer/qcam.html is the URL.

> >Think it'd be possible to hack it to check whether the extension is
there
> >and the X server is on the same machine, and use a different display
> >strategy where one of these conditions fails?

> Of course.  I don't have time to look at your code in detail but
> I took a quick glance and it looks like it tries to figure out
> at compile time whether to use shared memory or not.  So
> basically you should be able to do the test at run time and
> replace the #ifdef's with real ifs (assuming there are not
> other bugs).

> The runtime test would look something like this:

> Display* disp  = XOpenDisplay(displayName);
> int has_Shared = XShmQueryExtension(disp);

> int ok = has_Shared && onSameMachine(displayName);

> - Josh

> /** Not Debugged **/

> int onSameMachine(char* displayName)
> {
> int ret=0;
> #define inetAddrLength 4
> if (displayName) {
>     char* whereColon = strchr(dispName,':');
>     if (whereColon) {
>       if (whereColon == dispName) {
>       ret = true;
>       }
>       else {
>       const size_t BIGHOSTNAME=256;
>       char arr1[BIGHOSTNAME];
>       char arr2[BIGHOSTNAME];
>       ptrdiff_t sz=0;
>       if (gethostname(arr1,BIGHOSTNAME-1) == 0) {
>            // arr should hold the name of the local host
>            sz = whereColon - dispName;
>            char* tptr;
>            if (sz > 127) {
>              tptr = new char[sz+1];
>            }
>            else {
>              tptr = arr2;
>            }      
>            strncpy(tptr,dispName,sz);
>            tptr[sz] = '\0';

>            struct hostent* he = gethostbyname(tptr);
>            char iaddr1[inetAddrLength];
>            if (he) {
>              if (strcmp(arr1,tptr)==0) {
>                ret = true;
>              }
>              else {
>                char* aptr = he->h_addr_list[0];
>                     strncpy(iaddr1,aptr,inetAddrLength);
>                he = gethostbyname(arr1);
>                if (strncmp(iaddr1,aptr,inetAddrLength)==0) {
>                {
>                     ret = true;
>                }
>              }
>            }
>            if (tptr != arr2) {
>              delete [] tptr;
>            }
>       }
>       }
>     }
>   }
>   return ret;
> }