Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 infinite loop for cyclic header include

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
lbreuss Posted - Nov 20 2006 : 10:41:41 AM
When I set an include directory to the samba share \\\\mylinux\\usr\\include, VA X while building up the cache makes an infinite loop in the files features.h and sys/cdefs.h. Both files include each other.

Any help on this? Am I doing evil things?

Cheers,
Leo

sys/cdefs.h:
-----------
#ifndef _SYS_CDEFS_H
#define _SYS_CDEFS_H 1

/* We are almost always included from features.h. */
#ifndef _FEATURES_H
# include <features.h>
#endif


features.h
-----------
[...]
/* This is here only because every header file already includes this one. */
#ifndef __ASSEMBLER__
# ifndef _SYS_CDEFS_H
# include <sys/cdefs.h>
# endif
10   L A T E S T    R E P L I E S    (Newest First)
lbreuss Posted - Nov 22 2006 : 3:49:59 PM
Hi feline,
thank you very much for your support.


Very interesting result, no problem with a mapped drive. VA X was able to parse the whole source and I didn't see this cyclic thing anymore. Altough this is a workaround I'll give up at this point. Hopefully I don't need to include other UNC paths.


MS VS intellisense is already disabled.

Best regards,
Leo
feline Posted - Nov 22 2006 : 3:30:42 PM
There are 3 formats for plain text files, windows, UNIX and Mac. They differ in how they signify the end of a line. I am not 100% certain off the top of my head but I think it goes:

Windows EOL = \\n\\r
Unix EOL = \\n
Mac EOL = \\r

I am aware that Samba can be configured to transparently convert between UNIX and Windows line endings, but I am not sure how this is done at the file level.

The EOL format *should not* matter, but something is going on here, and it is one possible factor.

Doing some tests here I am seeing something. Sitting inside a VMWare Win2k machine on a WinXP host I have a share, used to communicate between the host and virtual machines. When I set VA to custom include directories and add the item:

\\\\.host\\Shared Folders\\common_share\\code 2005\\mylinux\\usr\\include

I am getting fairly massive CPU spikes, but this is caused by the IDE, not VA. I disabled the IDE's intellisense and the CPU spike goes away completely. Interestingly I cannot make VA suggest "features.h" with this custom include directory.

However if I use windows to map E: to "\\\\.host\\Shared Folders\\" and add the custom include directory:

E:\\common_share\\code 2005\\mylinux\\usr\\include

Then the CPU spike goes away, even with the IDE's intellisense enabled, and VA is suggesting "features.h" when I type a #include <> line.

Can you try mapping a drive letter in windows to your Linux network share and then use this drive letter path in the custom include directories list instead, and see what difference this makes? My tests suggest that at least part of the problem is the IDE, not VA.

See here for details on disabling the IDE's intellisense if you are interested.
http://docs.wholetomato.com?W133
lbreuss Posted - Nov 22 2006 : 04:17:13 AM
quote:
Originally posted by feline


If you open the files over the samba share are they appearing as UNIX or Windows format?
The fact this only happens with the samba share suggests there is a problem with how the share is configured, but that does not get us very far on its own.


Windows format? What's that?
I don't think that samba is doing any conversions on the contents of the files. Besides that, the source code probably only consists of ASCII chars and line endings should be irrelevant to any C++ source parser.

Just in case, here is the relevant part of the samba config (I was using the [root] share):

[global]
workgroup = PDNTDOMAIN
server string = theserver (Samba 3.0.22)
map to guest = Bad User
printcap name = cups
logon path = \\\\%L\\profiles\\.msprofile
logon drive = P:
logon home = \\\\%L\\%U\\.9xprofile
wins server = eth0:172.20.0.111, eth0:172.20.0.112
ldap ssl = no
create mask = 0664
cups options = raw
include = /etc/samba/dhcp.conf

[homes]
comment = Home Directories
valid users = %S, %D%w%S
read only = No
inherit acls = Yes
browseable = No

[root]
path = /
feline Posted - Nov 21 2006 : 4:23:10 PM
I will ask and see if anyone else is running a Linux machine, or has any ideas.

If you open the files over the samba share are they appearing as UNIX or Windows format?
The fact this only happens with the samba share suggests there is a problem with how the share is configured, but that does not get us very far on its own.
lbreuss Posted - Nov 21 2006 : 10:05:33 AM
quote:
Originally posted by feline
What did you copy to your C: ? The actual files from the Linux box, or some test files?
If you copied the actual files from the Linux box did you copy all of them?


I copied the whole /usr/include/ directory (91MB, 2892 .h files) to my local drive.

quote:
Originally posted by feline
I have done work in the IDE using VA before, where the code sat on a UNIX machine over a Vision share and I never had any problems, and other people here use Linux. I am wondering if the problem is the files, not Linux or the samba share.


Well, I think the files are OK, as the local parsing on the same files worked. Do the other people have the code sitting on a samba share? Would they be able to set up a samba share for you? (...before you take the hassle of setting up a samba server ;-) BTW, there are some good, free, bootable Linux CD images you could use for that, e.g. Knoppix. It could possibly make a difference if you run it on a local VMware or have it on a remote machine.)

Best regards,
Leo
feline Posted - Nov 21 2006 : 08:34:28 AM
Testing with a samba drive will take a while since I do not have a Linux or UNIX box. I would have to setup a VMWare test system and learn how to configure it correctly.

What did you copy to your C: ? The actual files from the Linux box, or some test files?
If you copied the actual files from the Linux box did you copy all of them?

I have done work in the IDE using VA before, where the code sat on a UNIX machine over a Vision share and I never had any problems, and other people here use Linux. I am wondering if the problem is the files, not Linux or the samba share.
lbreuss Posted - Nov 21 2006 : 03:46:44 AM
quote:
Originally posted by feline

Can you try putting these files on your local C: and see if that makes a difference?



Makes a difference! I copied the include/ folder to C:/temp/include and VA X parses the whole directory without problems.

Are you able to test it from a samba drive? Let me know if you need my include.tgz.
We are using a SuSE Enterprise 10 Linux installation.
> smbstatus --version
Version 3.0.22-13.16-SUSE-SLES10
> uname -a
Linux pdlinux42 2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
feline Posted - Nov 20 2006 : 3:41:04 PM
So far I am not having any problems. For ease I have created the files:

C:\\mylinux\\usr\\include\\features.h
C:\\mylinux\\usr\\include\\sys\\cdefs.h

on my local windows drive. I then added "C:\\mylinux\\usr\\include\\" to VA's list of custom include directories, and told VA to rebuild its symbol database. Using VS2005 and VA 1540 I have opened and closed the IDE 3 times now, and no problems at all. I am including both files in a test C++ project as well, to make sure that VA is looking at them.

It is possible it is something else in the files that is causing the problem, or possibly some other file. Can you try putting these files on your local C: and see if that makes a difference?
lbreuss Posted - Nov 20 2006 : 11:14:52 AM
VA_X.dll file version 10.3.1540.0 built 2006.10.27
VAOpsWin.dll version 1.3.3.7
VATE.dll version 1.0.5.9
DevEnv.exe version 8.0.50727.42
msenv.dll version 8.0.50727.363
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Custom
Stable Includes:
\\\\pdlinux42\\root\\usr\\include;

Library Includes:
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
C:\\Programme\\Microsoft Visual Studio 8\\VC\\crt\\src;

Other Includes:

------------

A colleague earlier claiming to succeed with parsing the /usr/include/ has now the same problem.

> uname -a
Linux pdlinux42 2.6.16.21-0.8-smp #1 SMP Mon Jul 3 18:25:39 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
rhummer Posted - Nov 20 2006 : 11:09:28 AM
What version if VA X are you using? Do you know what version your friend uses?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000