SlideShare une entreprise Scribd logo
1  sur  13
Debugging YaST Scripts
Tips for debugging YaST modules
Ladislav Slezák
Ing.
© Novell Inc. All rights reserved2
Debugger in YaST
There is no debugger in YaST
There was a simple debugger in the past...
So how to debug a YaST script?
© Novell Inc. All rights reserved3
Debugging YaST
Use y2log (/var/log/YaST2/y2log)
• Put y2milestone() wherever it may be useful
• Use y2debug() – not logged by default, for details potentially needed
• Use y2internal() for testing, remove or change it to y2debug later
Use 'showy2log' colorizer
• Command: y2tool showy2log -v -- tail -f
• Displays y2log in colors depending on the log level (errors in red...)
• Formats YCP structures (lists, maps) – more readable output
• Open a separate terminal window with it
© Novell Inc. All rights reserved4
More verbose logging
Enabling debug messages
Set variable Y2DEBUG=1 (ZYPP_FULLLOG=1)
Press Shift+F7 in the Qt UI (dynamic switching on/off
decreases useless output)
Another shortcut
Shift+Ctrl+Alt+X in Qt UI opens an xterm window
with shell.
(That's useful when debugging the installer running from the installation medium, in a running system it
does not make much sense, a terminal can be opened manually very easily.)
© Novell Inc. All rights reserved5
Debugging in YCP
Logging an YCP Backtrace
Use -1 as the first parameter in y2loglevel() call
y2internal(-1, “Backtrace:”);
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:51 Backtrace:
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:157 extractUniqueKey (comment)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:224 read_modprobe (.modprobe_sound)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:516 read_save_info ()
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:710 Sound::ReadModulesConf ()
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/wizards.ycp:262 Sound::Read (true)
2007-10-10 15:21:54 <5> cyclops(14553) [YCP] clients/sound.ycp:588 CommandLine::Run (cmdline)
Breakpoints
Use e.g. Popup::Message() calls
Do not forget to remove them! (svn diff)
© Novell Inc. All rights reserved6
Modifying Installation System
Use /y2update for overriding the current files
YCP interpreter looks the files up in /y2update, $Y2DIR, $HOME/.yast2
and in $PREFIX (/usr)
Create e.g. /y2update/clients, copy the file from /usr there, don't
forget to compile YCP modules (ycpc -c)
Works also for non YCP parts (agents, package-bindings...), very convenient
for debugging YCP clients (clients are reloaded when executed)
Use start_shell=1 boot option to modify the system before start
© Novell Inc. All rights reserved7
Modifying Installation System
Use mount for overlaying the files
Mount with -o option can be used for overriding the original files:
mount -o bind /tmp/foo.ycp /usr/share/YaST2/clients/foo.ycp
Modifying the installation system (inst-sys)
Use Driver Update
See dud Linuxrc option, basically any RPM can be added to the installation
system
Create an addon-product
Similar to y2update
Also for adding packages to the inst-sys
© Novell Inc. All rights reserved8
Debugging YaST Agents
For interactive debugging run
/usr/lib/YaST2/bin/y2base stdio scr
Use `Read(.path), `Write(.path,...),
`Execute(.path,...), `Dir(.path) commands
instead of e.g. SCR::Read() in YCP script
Note: rlwrap (readline wrapper) provides easy editing with history for any
command line tool, use it this way:
rlwrap /usr/lib/YaST2/bin/y2base stdio scr
© Novell Inc. All rights reserved9
Debugging a crash
Crash – usually SIGSEGV (11), SIGABORT (6), see y2log
Backtrace – probably the most valuable information,
tells the exact location of the crash and program stack
When YaST crashes it saves the backtrace to
/var/log/YaST2/signal file.
Use c++filt tool for converting the internal C++ symbols to
a readable form:
cat /var/log/YaST2/signal | c++filt
(Note: The backtrace is created by a standard glibc function, it is not YaST specific.)
© Novell Inc. All rights reserved10
Debugging a crash
GNU gdb can be also used debugging YaST
*-debuginfo packages are required for full debug output
How to get a backtrace?
Start YaST in gdb debugger
gdb /usr/lib/YaST2/bin/y2base
run <module> qt
Attach gdb to running YaST
gdb /usr/lib/YaST2/bin/y2base <PID>
Reproduce the crash
Use 'bt' command in gdb
See http://en.opensuse.org/Bugs/YaST for more details
© Novell Inc. All rights reserved11
UI Debugging
Debugging functions
UI::DumpWidgetTree() - dumps UI tree to y2log
UI::FakeUserInput() - simulates user input (clicking buttons)
© Novell Inc. All rights reserved12
Questions?
Do you have another tip for debugging?
YaST Debugging

Contenu connexe

Tendances

bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesIO Visor Project
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Anne Nicolas
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFBrendan Gregg
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackKernel TLV
 
“Linux Kernel CPU Hotplug in the Multicore System”
“Linux Kernel CPU Hotplug in the Multicore System”“Linux Kernel CPU Hotplug in the Multicore System”
“Linux Kernel CPU Hotplug in the Multicore System”GlobalLogic Ukraine
 
Linux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLinux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLubomir Rintel
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernellcplcp1
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementKenny (netman)
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedBrendan Gregg
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)yang firo
 
Kernel development
Kernel developmentKernel development
Kernel developmentNuno Martins
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityBrendan Gregg
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareBrendan Gregg
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionlinuxlab_conf
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudAndrea Righi
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Anne Nicolas
 
“Automation Testing for Embedded Systems”
“Automation Testing for Embedded Systems” “Automation Testing for Embedded Systems”
“Automation Testing for Embedded Systems” GlobalLogic Ukraine
 

Tendances (20)

bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
Kernel Recipes 2018 - KernelShark 1.0; What's new and what's coming - Steven ...
 
Ha opensuse
Ha opensuseHa opensuse
Ha opensuse
 
Kernel crashdump
Kernel crashdumpKernel crashdump
Kernel crashdump
 
Kernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPFKernel Recipes 2017: Performance Analysis with BPF
Kernel Recipes 2017: Performance Analysis with BPF
 
Specializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network StackSpecializing the Data Path - Hooking into the Linux Network Stack
Specializing the Data Path - Hooking into the Linux Network Stack
 
“Linux Kernel CPU Hotplug in the Multicore System”
“Linux Kernel CPU Hotplug in the Multicore System”“Linux Kernel CPU Hotplug in the Multicore System”
“Linux Kernel CPU Hotplug in the Multicore System”
 
Linux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshopLinux Kernel Debugging Essentials workshop
Linux Kernel Debugging Essentials workshop
 
Performance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux KernelPerformance Analysis Tools for Linux Kernel
Performance Analysis Tools for Linux Kernel
 
Linux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware ManagementLinux fundamental - Chap 12 Hardware Management
Linux fundamental - Chap 12 Hardware Management
 
Performance Wins with BPF: Getting Started
Performance Wins with BPF: Getting StartedPerformance Wins with BPF: Getting Started
Performance Wins with BPF: Getting Started
 
Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)Linux kernel debugging(ODP format)
Linux kernel debugging(ODP format)
 
Kernel development
Kernel developmentKernel development
Kernel development
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
UM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of SoftwareUM2019 Extended BPF: A New Type of Software
UM2019 Extended BPF: A New Type of Software
 
Davide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruptionDavide Berardi - Linux hardening and security measures against Memory corruption
Davide Berardi - Linux hardening and security measures against Memory corruption
 
Linux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloudLinux kernel tracing superpowers in the cloud
Linux kernel tracing superpowers in the cloud
 
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
Embedded Recipes 2018 - Finding sources of Latency In your system - Steven Ro...
 
“Automation Testing for Embedded Systems”
“Automation Testing for Embedded Systems” “Automation Testing for Embedded Systems”
“Automation Testing for Embedded Systems”
 
BPF Tools 2017
BPF Tools 2017BPF Tools 2017
BPF Tools 2017
 

Similaire à YaST Debugging

NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)Igalia
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Igalia
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notificationMahendra M
 
Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathDennis Chung
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Giovanni Bechis
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Pierre-jean Texier
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...VirtualTech Japan Inc.
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptxssuserfcf43f
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory AnalysisMoabi.com
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentMohammed Farrag
 
You're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareYou're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareCylance
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenLex Yu
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http acceleratorno no
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1Hajime Tazaki
 

Similaire à YaST Debugging (20)

NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)NIR on the Mesa i965 backend (FOSDEM 2016)
NIR on the Mesa i965 backend (FOSDEM 2016)
 
App container rkt
App container rktApp container rkt
App container rkt
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)Embedded Graphics Drivers in Mesa (ELCE 2019)
Embedded Graphics Drivers in Mesa (ELCE 2019)
 
Kqueue : Generic Event notification
Kqueue : Generic Event notificationKqueue : Generic Event notification
Kqueue : Generic Event notification
 
Swug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainathSwug July 2010 - windows debugging by sainath
Swug July 2010 - windows debugging by sainath
 
Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)Linux seccomp(2) vs OpenBSD pledge(2)
Linux seccomp(2) vs OpenBSD pledge(2)
 
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
 
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
NTTドコモ様 導入事例 OpenStack Summit 2015 Tokyo 講演「After One year of OpenStack Cloud...
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Dpdk applications
Dpdk applicationsDpdk applications
Dpdk applications
 
hacking-embedded-devices.pptx
hacking-embedded-devices.pptxhacking-embedded-devices.pptx
hacking-embedded-devices.pptx
 
[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis[CCC-28c3] Post Memory Corruption Memory Analysis
[CCC-28c3] Post Memory Corruption Memory Analysis
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
Lecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports DevelopmentLecture 6 Kernel Debugging + Ports Development
Lecture 6 Kernel Debugging + Ports Development
 
You're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security SoftwareYou're Off the Hook: Blinding Security Software
You're Off the Hook: Blinding Security Software
 
Crash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_TizenCrash_Report_Mechanism_In_Tizen
Crash_Report_Mechanism_In_Tizen
 
Varnish http accelerator
Varnish http acceleratorVarnish http accelerator
Varnish http accelerator
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1LibOS as a regression test framework for Linux networking #netdev1.1
LibOS as a regression test framework for Linux networking #netdev1.1
 

Plus de lslezak

openSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST NewsopenSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST Newslslezak
 
openSUSE Conference 2017 - The Docker at Travis Presentation
openSUSE Conference 2017 - The Docker at Travis PresentationopenSUSE Conference 2017 - The Docker at Travis Presentation
openSUSE Conference 2017 - The Docker at Travis Presentationlslezak
 
openSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom PresentationopenSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom Presentationlslezak
 
Integrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTIntegrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTlslezak
 
WebYaST (openSUSE conference 2010)
WebYaST (openSUSE conference 2010)WebYaST (openSUSE conference 2010)
WebYaST (openSUSE conference 2010)lslezak
 
DBus PolicyKit and YaST
DBus PolicyKit and YaSTDBus PolicyKit and YaST
DBus PolicyKit and YaSTlslezak
 
WebYaST presentation at LinuxTag 2010
WebYaST presentation at LinuxTag 2010WebYaST presentation at LinuxTag 2010
WebYaST presentation at LinuxTag 2010lslezak
 

Plus de lslezak (7)

openSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST NewsopenSUSE Conference 2017 - YaST News
openSUSE Conference 2017 - YaST News
 
openSUSE Conference 2017 - The Docker at Travis Presentation
openSUSE Conference 2017 - The Docker at Travis PresentationopenSUSE Conference 2017 - The Docker at Travis Presentation
openSUSE Conference 2017 - The Docker at Travis Presentation
 
openSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom PresentationopenSUSE Conference 2017 - The Atom Presentation
openSUSE Conference 2017 - The Atom Presentation
 
Integrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaSTIntegrating the Ruby Debugger into YaST
Integrating the Ruby Debugger into YaST
 
WebYaST (openSUSE conference 2010)
WebYaST (openSUSE conference 2010)WebYaST (openSUSE conference 2010)
WebYaST (openSUSE conference 2010)
 
DBus PolicyKit and YaST
DBus PolicyKit and YaSTDBus PolicyKit and YaST
DBus PolicyKit and YaST
 
WebYaST presentation at LinuxTag 2010
WebYaST presentation at LinuxTag 2010WebYaST presentation at LinuxTag 2010
WebYaST presentation at LinuxTag 2010
 

Dernier

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...Karmanjay Verma
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Dernier (20)

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

YaST Debugging

  • 1. Debugging YaST Scripts Tips for debugging YaST modules Ladislav Slezák Ing.
  • 2. © Novell Inc. All rights reserved2 Debugger in YaST There is no debugger in YaST There was a simple debugger in the past... So how to debug a YaST script?
  • 3. © Novell Inc. All rights reserved3 Debugging YaST Use y2log (/var/log/YaST2/y2log) • Put y2milestone() wherever it may be useful • Use y2debug() – not logged by default, for details potentially needed • Use y2internal() for testing, remove or change it to y2debug later Use 'showy2log' colorizer • Command: y2tool showy2log -v -- tail -f • Displays y2log in colors depending on the log level (errors in red...) • Formats YCP structures (lists, maps) – more readable output • Open a separate terminal window with it
  • 4. © Novell Inc. All rights reserved4 More verbose logging Enabling debug messages Set variable Y2DEBUG=1 (ZYPP_FULLLOG=1) Press Shift+F7 in the Qt UI (dynamic switching on/off decreases useless output) Another shortcut Shift+Ctrl+Alt+X in Qt UI opens an xterm window with shell. (That's useful when debugging the installer running from the installation medium, in a running system it does not make much sense, a terminal can be opened manually very easily.)
  • 5. © Novell Inc. All rights reserved5 Debugging in YCP Logging an YCP Backtrace Use -1 as the first parameter in y2loglevel() call y2internal(-1, “Backtrace:”); 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:51 Backtrace: 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:157 extractUniqueKey (comment) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/read_routines.ycp:224 read_modprobe (.modprobe_sound) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:516 read_save_info () 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] Sound.ycp:710 Sound::ReadModulesConf () 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] sound/wizards.ycp:262 Sound::Read (true) 2007-10-10 15:21:54 <5> cyclops(14553) [YCP] clients/sound.ycp:588 CommandLine::Run (cmdline) Breakpoints Use e.g. Popup::Message() calls Do not forget to remove them! (svn diff)
  • 6. © Novell Inc. All rights reserved6 Modifying Installation System Use /y2update for overriding the current files YCP interpreter looks the files up in /y2update, $Y2DIR, $HOME/.yast2 and in $PREFIX (/usr) Create e.g. /y2update/clients, copy the file from /usr there, don't forget to compile YCP modules (ycpc -c) Works also for non YCP parts (agents, package-bindings...), very convenient for debugging YCP clients (clients are reloaded when executed) Use start_shell=1 boot option to modify the system before start
  • 7. © Novell Inc. All rights reserved7 Modifying Installation System Use mount for overlaying the files Mount with -o option can be used for overriding the original files: mount -o bind /tmp/foo.ycp /usr/share/YaST2/clients/foo.ycp Modifying the installation system (inst-sys) Use Driver Update See dud Linuxrc option, basically any RPM can be added to the installation system Create an addon-product Similar to y2update Also for adding packages to the inst-sys
  • 8. © Novell Inc. All rights reserved8 Debugging YaST Agents For interactive debugging run /usr/lib/YaST2/bin/y2base stdio scr Use `Read(.path), `Write(.path,...), `Execute(.path,...), `Dir(.path) commands instead of e.g. SCR::Read() in YCP script Note: rlwrap (readline wrapper) provides easy editing with history for any command line tool, use it this way: rlwrap /usr/lib/YaST2/bin/y2base stdio scr
  • 9. © Novell Inc. All rights reserved9 Debugging a crash Crash – usually SIGSEGV (11), SIGABORT (6), see y2log Backtrace – probably the most valuable information, tells the exact location of the crash and program stack When YaST crashes it saves the backtrace to /var/log/YaST2/signal file. Use c++filt tool for converting the internal C++ symbols to a readable form: cat /var/log/YaST2/signal | c++filt (Note: The backtrace is created by a standard glibc function, it is not YaST specific.)
  • 10. © Novell Inc. All rights reserved10 Debugging a crash GNU gdb can be also used debugging YaST *-debuginfo packages are required for full debug output How to get a backtrace? Start YaST in gdb debugger gdb /usr/lib/YaST2/bin/y2base run <module> qt Attach gdb to running YaST gdb /usr/lib/YaST2/bin/y2base <PID> Reproduce the crash Use 'bt' command in gdb See http://en.opensuse.org/Bugs/YaST for more details
  • 11. © Novell Inc. All rights reserved11 UI Debugging Debugging functions UI::DumpWidgetTree() - dumps UI tree to y2log UI::FakeUserInput() - simulates user input (clicking buttons)
  • 12. © Novell Inc. All rights reserved12 Questions? Do you have another tip for debugging?