All Forums |
Register |
Login |
Search |
Subscriptions |
My Profile |
Inbox |
Tool Warehouse |
FAQs |
Resources |
Help |
Member List |
Address Book |
Logout |
|
|
File path conversion issue with old Interix vs Interix imbedded in SFU
|
Logged in as: Guest |
Users viewing this topic: none |
|
Login  |
|
|
File path conversion issue with old Interix vs Interix ... - May 18, '06, 3:06:40 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
I have a big GUI written using Motif library. This program calles a prgram written in fortran. GUI one can choose or create a data file (it is ascii txt file) then fortran exe file uses this ASCII file to run.
The original Fortran program was written and compiled with msfortran compiler before. Then it was compiled with PGI fortran version 3.0 on Windows 2000 PC. Had no problem when this executable called from a GUI written in C and Motif library under interix (before Microsoft’s SFU came along).
Now I cannot run this program with SFU Interix and Windows XP plotform. I compiled it with PGI fortran using both the version 3.0 and version 6.0 on my computer. Either way, compiler gave me error for the line “USE msflib”.
When I commented out this line program compiled. But when it was called from unix shell (I have to use SFU interix to run the GUI) it did not recognize the file path passed to *.exe file from this GUI.
Is there a file will do the same thing what msflib does for PGI Fortran? Or is ther a library file for file conversion between SFU Unix and MW windows?
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 18, '06, 3:23:56 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Well, Interix isn't going to have any influence on the Fortran compiler.
I'm not sure what "msflib" exactly did, but it sounds like it allowed your Win32
Fortran program to work with Unix pathnames instead of Win32 pathnames. And not
having this is the crux of the problem.
There are two programs for switching pathnames between Unix and Win32 syntax.
They are based on API's of the same names: unixpath2win and winpath2unix.
So from a shell you would do something close to:
myfortran.exe "`unixpath2win /tmp/dog`"
The quotes are to keep the path together in case the Win32 path has spaces in it.
The backtick's urun the command in-place.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 19, '06, 7:40:10 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
I solved one problem, then had new ones.
The working part of my GUI is not working now. Before I start disecting the program I like to hear from anybody might have similar problems.
Now I am getting "Segmentation fault (core dumped)" message again.
The previous segmentation fault errors we solved by setting "NoExecute = Allways off".
This time, just calling a data file and reading routine giving me this error. This portion used to work. Parts of it still workes.
Have any idea?
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 20, '06, 2:36:11 AM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
Try compiling with the "-g" option to gcc.
Then you can use gdb (the debugger) to see what's going on directly.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 22, '06, 6:56:17 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
I run using debugger. It run without an error. But when I run the same program without the debugger, it gives me segmentation fault.
Older version doesn't give me that error. There is still something incompatible between old and new interix.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 22, '06, 9:33:19 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
If you get a core dump then you can look at the core dump with gdb:
gdb fooprog core
That the program runs with the debugger active and SEGV's without usually indicates
a write or read that has gone too far. For example, an array that is exceeded by 1
can do this. If you get a stack that shows itself to be junk then the problem will
be with a variable that is placed on the stack.
Try using gdb on the core file first. Refer to the gdb man page too.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 12:31:02 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
The fallowing lines from the messages I got after I run:
"gdb myprogram core"
__________________________
This GDB was configured as ‘i586-pc-interix3:..
warning: exec file is newer than core file.
Core was generated by ‘emmodel’
Reading symbols from //usr/X11R6/lib/libXp.so.3.5…done.
Loaded symbols for // usr/X11R6/lib/libXp.so.3.5
Reading symbols from //usr/X11R6/lib/libXext.so.3.5…done
Loaded symbols for // usr/X11R6/lib/ libXext.so.3.5
Reading symbols from //usr/X11R6/lib/libICE.so.3.5…done
Loaded symbols for // usr/X11R6/lib/ libICE.so.3.5
Reading symbols from //usr/X11R6/lib/libSM.so.3.5…done
Loaded symbols for // usr/X11R6/lib/ libSM.so.3.5
Reading symbols from //usr/X11R6/lib/libX11.so.3.5…done
Loaded symbols for // usr/X11R6/lib/ libX11.so.3.5
Reading symbols from /usr/ lib/libm.so.3.5…done
Loaded symbols for / usr/ lib/ libm.so.3.5
Reading symbols from /usr/ lib/libc.so.3.5…done
Loaded symbols for / usr/ lib/ libc.so.3.5
#0 0x77da7816 in strcmp <> from /usr/lib/libc.so.3.5
<gdb>
_____________________________
This is where I stopped.
Then I used “insight myprogram core” , so I could see where it is crashing. These debugging utilities didn’t tell me anything more than what I new. I get “segmentation fault” and my program crashes, at certain point. I already knew where that point was. I wanted to know why? This problem is still old versus new interix, motif or both issue.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 1:15:03 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
Before I do any thing you write right now, here is something:
I was reading gdb.pdf, (I just found it).
Without insight, I run gdb, then enter the comment run, and then picked the option on main gui, where the program was crashing.
It showed me popup, not fully filled up. Now I know how far that popup going.
"Program received signal SIGSEGV segmentation fault
0x77da7816 in strcmp,. from /usr/lib/libc.so.3.5 "
Then I enter <gdb> s. It crashed with this message:
"Program terminated with signal SIGSEGV segmentation fault.
The program no longer exists.
Cannot acces memory at address 0x0"
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 1:24:23 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
I forgot to give one more information:
After I enter <gdb> n,
I get this message:
"Single stepping until exit from function strcmp, which has no line number information"
Then I get
"Program terminated with signal SIGSEGV segmentation fault.
The program no longer exists.
Cannot acces memory at address 0x0"
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 2:37:35 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
So you have a call in your code to strcmp() where one or both of the args is
not terminated with a nul (\0). You should use strncmp() as it's safer from
this happening.
Look at the stack ("bt") before doing step ("n"). That'll show you which one specifically.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 3:24:23 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
Here is the stack.
I used <gdb. bt command to get this.
#0 0X77da7816 in strcmp() from /usr/lib/libc.so.3.5
#1 0x004e3076 in _XmStringIsCurrentCharsey()
#2 0x00579acd in _XmRenderTableFindFallback ()
#3 0x00579960 in _XmRenditionMerge ()
#4 0x004d97a7 in OptLineMetrics ()
#5 0x004dfa3d in _render ()
#6 0x004df8d4 in _draw ()
#7 0x004e397f in XmStringDraw ()
#8 0x004bec45 in _XmRedisplayLabG ()
#9 0x004be326 in Redisplay ()
#10 0x00549283 in XmeRedisplayGadgets ()
#11 0x004b35a8 in Redisplay ()
#12 0x0060b03c in SendExposureEvent ()
#13 0x0060ae70 in ComplexExposure ()
#14 0x0060ab72 in XtDispatchEventToWidget ()
#15 0x0060b301 in _XtDefaultDispatcher ()
#16 0x0060b533 in XtDispatchEvent ()
#17 0x0060b76f in XtAppMainLoop ()
#18 0x0040222b in main (argc=1, argv=0x10730) at sheets.c:985
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 5:08:00 PM
|
|
|
Rodney
Posts: 3728
Joined: Jul. 9, '02,
From: /Tools lab
Status: offline
|
What are you linking against?
XmRenderTableFindFallback is in the Motif library, but XmStringlsCurrentCharsey isn't for Motif 2.
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 5:49:59 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
Rodney,
There is nowhere in the my code I am calling strcmp ().
_XmStringIsCurrentCharset () is called by one of Motif functions obviously. This function calls strcmp (). I have no way of changing that portion of the program.
One thing is different between the program compiled with the older version of interix and the newer one is: font file. Default set for the font file was "7x13bold" it was in old iterix/usr/.../font/misc directory, now in the new interix there is still C:\sfu\usr\X11R6\lib\X11\fonts\misc directory, but not this font file. I assumed "7x13B.pcf" is substitue for the other font. My new GUI has some problems with the fonts.
I was wondering that might be the problem!
when I <gdb> bt, it only gave me the list I posted earlier. Mean time there are a lot of functions called by the program, but none of them in that list except the main ().
|
|
|
RE: File path conversion issue with old Interix vs Inte... - May 23, '06, 5:52:19 PM
|
|
|
cerenaksu
Posts: 49
Joined: May 3, '06,
Status: offline
|
Rodney,
we have been posting messages almost at the same time. You posted while I was writing.
I made a spelling mistake,
that file is:
_XmStringIsCurrentCharset();
|
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
|
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts |
|
|
|