[PATCH 5/9] add a mode commandline option

Charlie Brej plymouth at brej.org
Tue Feb 24 03:26:23 PST 2009


william.jon.mccann at gmail.com wrote:
> Initially supports modes: boot, shutdown.  This allows the
> progress cache to be loaded from the appropriate file.

A couple weeks back I had a bit of a hack around with the idea of showing 
plymouth on shutdown and although I could get it to do its stuff I was a bit 
scared of starting the splash before X had finished. Also I wasn't sure about 
the sequence of unmounting disks and the killall and trying to shutdown plymouth 
before it gets killed. Might be easiest to let plymouth be killed and let the 
shutdown duration file not be updated. It's probably all fine and I'm just 
fretting. Thanks for doing this.

Do we want the splashes to be aware that they are in shutdown mode? What would 
they do different?

In main, state.mode is not explicitly set to a default (PLY_MODE_BOOT is 0 so it 
works anyway).

Ray Strode wrote:
 >no bool in structs please. Instead:
 >uint32_t was_set : 1;
 >It packs better that way.
Just wondering, what happens when you ask for a pointer to a packed value?

With all patches applied I am getting segfaults. I may have skipped one of the 
patches so if you're not getting them then ignore and I will re-check once it's 
in git.

[root at localhost plymouth]# valgrind plymouth quit
==26165== Memcheck, a memory error detector.
==26165== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==26165== Using LibVEX rev 1804, a library for dynamic binary translation.
==26165== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==26165== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==26165== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==26165== For more details, rerun with: -v
==26165==
==26165== Conditional jump or move depends on uninitialised value(s)
==26165==    at 0x402795C: ply_command_parser_get_options_for_command 
(ply-command-parser.c:482)
==26165==    by 0x40281A5: ply_command_parser_get_command_options 
(ply-command-parser.c:583)
==26165==    by 0x804B796: on_quit_request (plymouth.c:580)
==26165==    by 0x4028085: on_command_dispatch_timeout (ply-command-parser.c:842)
==26165==    by 0x4026393: ply_event_loop_process_pending_events 
(ply-event-loop.c:1145)
==26165==    by 0x4026877: ply_event_loop_run (ply-event-loop.c:1251)
==26165==    by 0x804AD8A: main (plymouth.c:839)
==26165==
==26165== Use of uninitialised value of size 4
==26165==    at 0x40074FB: strcmp (mc_replace_strmem.c:337)
==26165==    by 0x40278DA: ply_command_get_option (ply-command-parser.c:321)
==26165==    by 0x4027968: ply_command_parser_get_options_for_command 
(ply-command-parser.c:486)
==26165==    by 0x40281A5: ply_command_parser_get_command_options 
(ply-command-parser.c:583)
==26165==    by 0x804B796: on_quit_request (plymouth.c:580)
==26165==    by 0x4028085: on_command_dispatch_timeout (ply-command-parser.c:842)
==26165==    by 0x4026393: ply_event_loop_process_pending_events 
(ply-event-loop.c:1145)
==26165==    by 0x4026877: ply_event_loop_run (ply-event-loop.c:1251)
==26165==    by 0x804AD8A: main (plymouth.c:839)
==26165==
==26165== Invalid read of size 1
==26165==    at 0x40074FB: strcmp (mc_replace_strmem.c:337)
==26165==    by 0x40278DA: ply_command_get_option (ply-command-parser.c:321)
==26165==    by 0x4027968: ply_command_parser_get_options_for_command 
(ply-command-parser.c:486)
==26165==    by 0x40281A5: ply_command_parser_get_command_options 
(ply-command-parser.c:583)
==26165==    by 0x804B796: on_quit_request (plymouth.c:580)
==26165==    by 0x4028085: on_command_dispatch_timeout (ply-command-parser.c:842)
==26165==    by 0x4026393: ply_event_loop_process_pending_events 
(ply-event-loop.c:1145)
==26165==    by 0x4026877: ply_event_loop_run (ply-event-loop.c:1251)
==26165==    by 0x804AD8A: main (plymouth.c:839)
==26165==  Address 0x3f847ae1 is not stack'd, malloc'd or (recently) free'd
==26165==
==26165== Process terminating with default action of signal 11 (SIGSEGV)
==26165==  Access not within mapped region at address 0x3F847AE1
==26165==    at 0x40074FB: strcmp (mc_replace_strmem.c:337)
==26165==    by 0x40278DA: ply_command_get_option (ply-command-parser.c:321)
==26165==    by 0x4027968: ply_command_parser_get_options_for_command 
(ply-command-parser.c:486)
==26165==    by 0x40281A5: ply_command_parser_get_command_options 
(ply-command-parser.c:583)
==26165==    by 0x804B796: on_quit_request (plymouth.c:580)
==26165==    by 0x4028085: on_command_dispatch_timeout (ply-command-parser.c:842)
==26165==    by 0x4026393: ply_event_loop_process_pending_events 
(ply-event-loop.c:1145)
==26165==    by 0x4026877: ply_event_loop_run (ply-event-loop.c:1251)
==26165==    by 0x804AD8A: main (plymouth.c:839)
==26165==
==26165== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 18 from 1)
==26165== malloc/free: in use at exit: 3,118 bytes in 173 blocks.
==26165== malloc/free: 175 allocs, 2 frees, 3,240 bytes allocated.
==26165== For counts of detected errors, rerun with: -v
==26165== searching for pointers to 173 not-freed blocks.
==26165== checked 84,780 bytes.
==26165==
==26165== LEAK SUMMARY:
==26165==    definitely lost: 0 bytes in 0 blocks.
==26165==      possibly lost: 0 bytes in 0 blocks.
==26165==    still reachable: 3,118 bytes in 173 blocks.
==26165==         suppressed: 0 bytes in 0 blocks.
==26165== Rerun with --leak-check=full to see details of leaked memory.
Segmentation fault
[root at localhost plymouth]# valgrind plymouth ask-question
==26166== Memcheck, a memory error detector.
==26166== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==26166== Using LibVEX rev 1804, a library for dynamic binary translation.
==26166== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==26166== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==26166== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==26166== For more details, rerun with: -v
==26166==
==26166==
==26166== Process terminating with default action of signal 11 (SIGSEGV)
==26166==  Bad permissions for mapped region at address 0x804C6C0
==26166==    at 0x4027956: ply_command_parser_get_options_for_command 
(ply-command-parser.c:539)
==26166==    by 0x40281A5: ply_command_parser_get_command_options 
(ply-command-parser.c:583)
==26166==    by 0x804B944: on_question_request (plymouth.c:480)
==26166==    by 0x4028085: on_command_dispatch_timeout (ply-command-parser.c:842)
==26166==    by 0x4026393: ply_event_loop_process_pending_events 
(ply-event-loop.c:1145)
==26166==    by 0x4026877: ply_event_loop_run (ply-event-loop.c:1251)
==26166==    by 0x804AD8A: main (plymouth.c:839)
==26166==
==26166== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 18 from 1)
==26166== malloc/free: in use at exit: 3,118 bytes in 173 blocks.
==26166== malloc/free: 175 allocs, 2 frees, 3,240 bytes allocated.
==26166== For counts of detected errors, rerun with: -v
==26166== searching for pointers to 173 not-freed blocks.
==26166== checked 84,784 bytes.
==26166==
==26166== LEAK SUMMARY:
==26166==    definitely lost: 0 bytes in 0 blocks.
==26166==      possibly lost: 0 bytes in 0 blocks.
==26166==    still reachable: 3,118 bytes in 173 blocks.
==26166==         suppressed: 0 bytes in 0 blocks.
==26166== Rerun with --leak-check=full to see details of leaked memory.
Segmentation fault



More information about the plymouth mailing list