forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Array access in callback crashes App (OpenGL-related)

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Tue May 06, 2014 8:27 am    Post subject: Array access in callback crashes App (OpenGL-related) Reply with quote

Hello, the following application hangs when assigning an array element (on my system indices above 1100 hang, below 1000 it works fine).
Characteristics of the program: OpenGL-window (on nVidia it hangs, ATI and possibly non-gamer nVidia cards seem to be fine), virtual common is used (otherwise it works flawless)
Steps to reproduce: click on menu item, click on SetVal button, application hangs (noted by not being able to use the Close button which otherwise works)
Tested on several systems, latest ftn95 including the beta salflib.

Source (tester.f95):
Code:

module DataMod
  real*4, dimension(5000) :: tmp
end module DataMod

program tester
external MenuItem
integer*4 :: iw, MenuItem
  iw=winio@('%og&',640,480)
  iw=winio@('%mn[MenuItem]',MenuItem)
end

integer*4 function MenuItem()
implicit none
integer*4 :: iw
external  :: SetVal, CloseWin
integer*4 :: SetVal, CloseWin
  MenuItem = 2
  iw=winio@('%^6bt[SetVal] &',SetVal)
  iw=winio@('%^6bt[Close]',CloseWin)
end

integer*4 function SetVal()
use DataMod
  SetVal = 2
  tmp(1:5000) = 0.0 ! application hangs here
  tmp(1111) = 0.0   ! same effect
end

integer*4 function CloseWin()
  CloseWin = 0
end


Linkfile:
Code:

lo tester.obj
vc
file tester.exe


Thanks!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Tue May 06, 2014 9:39 am    Post subject: Reply with quote

I can not get this program to fail. I have tried it on two machines. One has NVidia GeForce GT 750M. The other display adapter is described as Mobile Intel 4 Series...
Back to top
View user's profile Send private message AIM Address
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Tue May 06, 2014 1:12 pm    Post subject: Reply with quote

Hm I don't have any laptops available for testing at the moment, yet all non-mobile nVidia graphics cards (excluding Quadro) could reproduce the hang. Did you use the linkfile, or any other means of assuring that virtual common is used?
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Wed May 07, 2014 1:13 am    Post subject: Reply with quote

All works fine here too.
Laptop (Intel/ATI switceable graphics) Win7 and
Nvidia GTX770 desktop Win8
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Wed May 07, 2014 7:43 am    Post subject: Reply with quote

I did omit to use virtual common. On retesting it does fail.

The failure depends on using VC.
It appears to be unrelated to %og and unrelated to the display driver.
Using a common block instead of a module does not appear to help.

Try USEing the module in the main program to see if this fixes it.

I will log this for investigation. My current tests are under Windows 7 and it would help to know if the same problem occurs under Windows XP.
Back to top
View user's profile Send private message AIM Address
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Wed May 07, 2014 7:48 am    Post subject: Reply with quote

As of our testings this is a regression since XP (though it does not occur on all systems), yet we don't have win8 available. All XP installations can run the application without problems.

USEing the module in the main program does not change anything.

On my tests it is necessary that there is an %og window, even if it may not directly be related.

Thanks for looking into this!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7927
Location: Salford, UK

PostPosted: Wed May 07, 2014 8:03 am    Post subject: Reply with quote

It may be worth reviewing the advantages of using VC (search for "virtual common" in the help file). If this regression depends on the operating system then it may be very difficult to fix.

In the mean time, any information about the behaviour for particular operating systems (32 bit or 64 bit) would be useful.
Back to top
View user's profile Send private message AIM Address
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Wed May 07, 2014 6:54 pm    Post subject: Reply with quote

I also missed VC which i used a lot before but not anymore.

And yes code hangs with VC with NVIDIA (on Win8 64bit OS even with all the compatibility settings with XP )

It works on Win7 64bit OS laptop with ATI but hangs when laptop switches on battery power and uses power saving Intel graphics
Back to top
View user's profile Send private message
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Mon Jun 23, 2014 9:39 am    Post subject: Reply with quote

This is not fixed in 7.10 and the differing behaviour as described in the original posting (works on ATI, fails on most nVidia gamer graphics Cards; XP is unaffected, buggy under win7+) has been verified on several PCs, workstations and mobile computers. Any Progress? Thanks!
Back to top
View user's profile Send private message
DanRRight



Joined: 10 Mar 2008
Posts: 2818
Location: South Pole, Antarctica

PostPosted: Mon Jun 23, 2014 2:07 pm    Post subject: Reply with quote

Will the code work without VC? I used this switch a lot couple decades ago but then later on found that it has no effect when the RAM sizes on PCs became larger then 2GB. In principle this switch will be potentially very useful again in the future if FTN95 will be finally 64bit (hope it will) which will allow user to run the codes allocating sparce matrices up to 256 TB which is the current OS/hardware temporal limit but I think its usefullness is gone with todays addressable memory size of 32bit compiler. Am I wrong?
Back to top
View user's profile Send private message
Sebastian



Joined: 20 Feb 2008
Posts: 177

PostPosted: Mon Jun 30, 2014 10:31 am    Post subject: Reply with quote

Yes it works when disabling VC. This is not relevant to me though since the bug may just be hidden by the changed Memory layout or whatever, but that's up to the developers to check out. I don't want to hit this bug randomly in a non-VC application and debug it again, or even worse have a customer experience it in hard to reproduce circumstances.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group