FLTK logo

STR #3008

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]

STR #3008

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:2 - Low, e.g. a documentation error or undocumented side-effect
Scope:2 - Specific to an operating system
Subsystem:None
Summary:unitialized variables cause linux session to freeze requiring ctr+alt+delete to re-login
Version:1.3-current
Created By:daveh
Assigned To:matt
Fix Version:None
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:


Name/Time/Date Filename/Size  
 
#1 daveh
09:31 Nov 25, 2013
example.cpp
4k
 
     

Trouble Report Comments:


Name/Time/Date Text  
 
#1 daveh
09:31 Nov 25, 2013
Hello,
    Attached is an example file I found to illustrate drawing to a canvas in FLTK. While it compiles fine, when I run it, the computer freezes and the only way to get up and running again is to ctrl+alt+delete to force a re-login to my linux session.
   I narrowed the problem down to three variables (x, y, and button) which, if initialized to zero, fixes the problem and the program runs fine. If left uninitialized, they show up with large numbers (garbage) and cause the program to crash the linux session. While it is always good to initialize variables prior to use, leaving them unitialized should not crash the session. I suspect that if the offscreen buffer gets a value outside its size the problem shows up.
    I am using linux mint(15), gcc 4.7.3.
daveh
 
 
#2 AlbrechtS
15:36 Jan 29, 2015
Moved STR from FLTK Applications to FLTK Library.  
 
#3 matt
20:14 Apr 01, 2015
I am surprised that this works at all. In main(), you have the line:

static canvas *os_box = new canvas(5,5,(window_size-10),(window_size-10));

By making the variable 'static', it becomes a global variable that is only accessible within main(). It is initialized before main() is called, creating you 'canvas' floating in mid air, but not inside the Fl_Window.

Removing 'static' should fix everything.
 
 
#4 matt
17:00 May 23, 2015
This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.