bugGnash - The GNU Flash player - Bugs: bug #46949, fb-gnash left console in unusable...

 
 

bug #46949: fb-gnash left console in unusable state after exiting

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Fri 22 Jan 2016 07:52:02 AM UTC
   
 
Category:  gui-fb Severity:  3 - Normal
Release:  master Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 01 Feb 2016 09:00:55 AM UTC, comment #8: 

thanks !

Sandro Santilli <strk>
Group Member
Sun 31 Jan 2016 11:10:02 AM UTC, comment #7: 

Current git version of Framebuffer Gnash now turn console back to text mode
properly when stopped by `fscommand("quit")` ActionScript, `--once`
command line switch, SIGINT (Ctrl+C), and SIGTERM (`killall fb-gnash`).

Screenshot after running `fb-gnash -v secondframeexit12-repaint.swf`:
(Test SWF from file #36046, bug #27981; with `set ignoreFSCommand false` in `~/.gnashrc`)
http://i.imgur.com/c1vyBWi.png

Screenshot after running `fb-gnash -v --once 12frames.swf`:
http://i.imgur.com/q0vAF8S.png

Screenshot after running `fb-gnash -v 12frames.swf` and pressed Ctrl+C:
http://i.imgur.com/MynEvRE.png

Screenshot after running `fb-gnash -v 12frames.swf` and used `killall fb-gnash`:
http://i.imgur.com/eyYM83G.png

You'd see that in every case, the console came back to text mode when Gnash
terminated. You'd also see that there's a "Segmentation fault" error shown
at the end of each run too.

Screenshots are attached in `fb-gnash_postrun-roundup.e705394.zip` as a reference.

This bug could be now marked as fixed.
The segmentation fault problem is filed separately as bug #47029.

Gnash: 0.8.11dev (git e705394 29-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36217)

Nutchanon Wetchasit <nachanon>
Fri 29 Jan 2016 07:11:11 AM UTC, comment #6: 

The 3 patches in patch #8887 have been pushed, this is ready for test.

Sandro Santilli <strk>
Group Member
Sat 23 Jan 2016 01:46:34 PM UTC, comment #5: 

Patch included, see patch #8887.

After applied the patches, you'll see that either running
`fb-gnash --once 12frames.swf` and wait for it to terminate,
or running `fb-gnash 12frames.swf` and press Ctrl+C
bring console back to text mode properly.

Note: The patches does not fix the segmentation fault error in fb-gnash's
normal exit procedure. The reason that segmentation fault appears now is
that the patches make Gnash terminate in the normal exit path, which is
the same as one already used in termination by signal handler.

This segmentation fault issue is still remaining to be investigated.

Gnash: 0.8.11dev (patched git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sat 23 Jan 2016 11:12:42 AM UTC, comment #4: 

After testing around, I found three problems in fb-gnash's code which prevent
framebuffer from properly returning to text mode:

1. fb-gnash's self termination (due to `fb-gnash --once` or
`fscommand("quit")`) does not trigger a proper cleanup, as `Gui::quitUI()`
is not overridde; it simply call `std::exit()` straight away, so console is left
in unusable state as the cleanup code is not run.

On the other hand, if Gnash is terminating by signal (SIGINT or SIGTERM),
it will try to trigger exit cleanup; though this does not successfully
return console to usable state, due to...

2. FBGui's destructor calls wrong function, the right one should be
`FBGui::enable_terminal()` which restores console to text mode. And...

3. fb-gnash's `FBGui::_fd` integer which is used for deciding
whether to enter console cleanup, is not properly initialized. According to current
`FBGui::disable_terminal()` and `FBGui::enable_terminal()` code, it doesn't
seems to be used anymore. Both function just open current TTY, set video mode,
and closed it, without really doing anything meaningful with class's
`_fd` variable.

Gnash: 0.8.11dev (git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>
Sat 23 Jan 2016 05:52:28 AM UTC, comment #3: 

There seems to be another issue too: if `--once` option was not used, and
user quitted Framebuffer Gnash with SIGINT (pressed Ctrl+C on keyboard),
it will terminate with Segmentation Fault in addition to unusable console.

Exact steps to reproduce:

  1. Switch the machine to text console (using Ctrl+Alt+F1 on keyboard).
  2. Login, and go to the directory which `12frames.swf` resides.
  3. Run `ulimit -c unlimited` to enable memory dump on segmentation fault.
  4. Run `fb-gnash 12frames.swf`, wait until five yellow boxes appear on the screen.
  5. Wait around 3 seconds.
  6. Press Ctrl+C on keyboard; Gnash would terminate (but the screen would not change).
  7. Blindly type commands to restart the machine, or press Ctrl+Alt+Del, or run `fbtotext` to restore the display.
  8. You'll see that there is a file named `core` in the same directory as `12frames.swf`. If you run `fbtotext` instead of restarting, you might also see the "Segmentation fault (core dumped)" message on the console and/or "segfault" log entry in `dmesg` output too.


Debug log (verbosity 2 + action error) of this case is attached as
`12frames_gnash0.8.11dev-62cfdfe_normal.log`, and full GDB backtrace is
attached as `12frames_gnash0.8.11dev-62cfdfe_normal.gdb.log`.

Gnash: 0.8.11dev (git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36138, file #36139)

Nutchanon Wetchasit <nachanon>
Fri 22 Jan 2016 10:12:17 AM UTC, comment #2: 

I have written a small C program that issues `KDSETMODE` ioctl on
current console, restoring it back to text mode. In case anyone tried
to test this issue and stuck in graphics mode, he or she could run
this program to restore the console instead of rebooting.

See the attached `fbtotext.c`.

Gnash: 0.8.11dev (git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36129)

Nutchanon Wetchasit <nachanon>
Fri 22 Jan 2016 10:00:23 AM UTC, comment #1: 

I have made a dummy 12-frames 1.0-sec SWF file `12frames.swf`
(with SWFTools' SWFC) to demonstrate this; see the attached `12frames.zip`.

Exact steps to reproduce:

  1. Switch the machine to text console (using Ctrl+Alt+F1 on keyboard).
  2. Login, and go to the directory which `12frames.swf` resides.
  3. Run `fb-gnash --once 12frames.swf`.
  4. You'll see that after 1 sec, the screen still show five orange boxes instead of switching back to command line.


Note: after the last step, the command line is still usable (even it is not visible),
you can type commands to restart the machine (or just use Ctrl+Alt+Del).

Screenshot is attached as `12frames_gnash0.8.11dev-62cfdfe.png`,
debug log (verbosity 2 + action error log) is attached as
`12frames_gnash0.8.11dev-62cfdfe.log`.

Gnash: 0.8.11dev (git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36126)

Nutchanon Wetchasit <nachanon>
Fri 22 Jan 2016 07:52:02 AM UTC, original submission:  

This is a follow-up to bug #46308 comment 7.

While I was testing Gnash's FrameBuffer UI in bug #46308, I found that
when `fb-gnash` is run on FrameBuffer console, as it finished running,
the screen would not go back to command line display; instead, it just
continue showing the last SWF frame, and switching back to X11 or other console
using Alt+Fn key doesn't work.

Currently, one must blindly type commands to switch to root user and run
`shutdown -r now`, `init 6`, pressing Ctrl+Alt+Del, or issue magic SysRq
on keyboard to reboot the machine in order to get the display back to usable state.

Gnash: 0.8.11dev (git 62cfdfe 16-Jan-2016)
Framebuffer: inteldrmfb `/dev/fb0` 1366x768 32-bit RGBA
X11: xorg 1:7.7+3~deb7u1 with xserver-xorg-video-intel 2:2.19.0-6 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Note: `textmode` command from `svgalib-bin` package and `reset` command
from `ncurses-bin` package didn't seem to help in this case.

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #36217:  fb-gnash_postrun-roundup.e705394.zip added by nachanon (18KiB - application/zip - Screenshots after running Framebuffer Gnash 0.8.11dev git e705394)
file #36138:  12frames_gnash0.8.11dev-62cfdfe_normal.log added by nachanon (4KiB - text/x-log - Verbosity=2 debug log and full GDB backtrace from Framebuffer Gnash 0.8.11dev (git 62cfdfe 16-Jan-2016) running `12frames.swf` in normal (non-oneshot) mode)
file #36139:  12frames_gnash0.8.11dev-62cfdfe_normal.gdb.log added by nachanon (14KiB - text/x-log - Verbosity=2 debug log and full GDB backtrace from Framebuffer Gnash 0.8.11dev (git 62cfdfe 16-Jan-2016) running `12frames.swf` in normal (non-oneshot) mode)
file #36129:  fbtotext.c added by nachanon (1KiB - text/x-csrc - Utility for resetting framebuffer console to text mode)
file #36128:  12frames_gnash0.8.11dev-62cfdfe.log added by nachanon (4KiB - text/x-log - Verbosity=2 debug log from Framebuffer Gnash 0.8.11dev (git 62cfdfe 16-Jan-2016) running `12frames.swf`)
file #36127:  12frames_gnash0.8.11dev-62cfdfe.png added by nachanon (2KiB - image/png - Screenshot from Framebuffer Gnash 0.8.11dev (git 62cfdfe 16-Jan-2016) running `12frames.swf`)
file #36126:  12frames.zip added by nachanon (1KiB - application/zip - Dummy 12-frames Flash file, with source code and build script)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-02-01 strk StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2016-01-31 nachanon Attached File- Added fb-gnash_postrun-roundup.e705394.zip, #36217
    2016-01-29 strk StatusNone Ready For Test
    2016-01-23 nachanon Attached File- Added 12frames_gnash0.8.11dev-62cfdfe_normal.log, #36138
        Attached File- Added 12frames_gnash0.8.11dev-62cfdfe_normal.gdb.log, #36139
    2016-01-22 nachanon Attached File- Added fbtotext.c, #36129
    2016-01-22 nachanon Attached File- Added 12frames_gnash0.8.11dev-62cfdfe.log, #36128
    2016-01-22 nachanon Attached File- Added 12frames_gnash0.8.11dev-62cfdfe.png, #36127
    2016-01-22 nachanon Attached File- Added 12frames.zip, #36126

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code