Issues and Their Causes in WebAssembly Applications : An Empirical Study
Full text
This is a self-archived version of an original article. This version may differ from the original in pagination and typographic details. Author(s): Title: Year: Version: Copyright: Rights: Rights url: Please cite the original version: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/ Issues and Their Causes in WebAssembly Applications : An Empirical Study © 2024 the Authors Published version Waseem, Muhammad; Das, Teerath; Ahmad, Aakash; Liang, Peng; Mikkonen, Tommi Waseem, M., Das, T., Ahmad, A., Liang, P., & Mikkonen, T. (2024). Issues and Their Causes in WebAssembly Applications : An Empirical Study. In Proceedings of 2024 28th International Conference on Evaluation and Assessment in Software Engineering (EASE 2024) (pp. 170-180). ACM. https://doi.org/10.1145/3661167.3661227 2024
Issues and Their Causes in WebAssembly Applications: An Empirical Study Muhammad Waseem Faculty of Information Technology University of Jyväskylä Jyväskylä, Finland [email protected] Teerath Das Faculty of Information Technology University of Jyväskylä Jyväskylä, Finland [email protected] Aakash Ahmad School of Computing and Communications Lancaster University Leipzig Leipzig, Germany [email protected] Peng Liang School of Computer Science Wuhan University Wuhan, China [email protected] Tommi Mikkonen Faculty of Information Technology University of Jyväskylä Jyväskylä, Finland [email protected] ABSTRACT WebAssembly (Wasm) is a binary instruction format designed for secure and efficient execution within sandboxed environments - predominantly web apps and browsers - to facilitate performance, security, and flexibility of web programming languages. In recent years, Wasm has gained significant attention from the academic research community and industrial development projects to engineer high-performance web applications. Despite the offered benefits, developers encounter a multitude of issues rooted in Wasm (e.g., faults, errors, failures) and are often unaware of their root causes that impact the development of web applications. To this end, we conducted an empirical study that mines and documents practitioners’ knowledge expressed as 385 issues from 12 open-source Wasm projects deployed on GitHub and 354 question-answer posts via Stack Overflow. Overall, we identified 120 types of issues, which were categorized into 19 subcategories and 9 categories to create a taxonomical classification of issues encountered in Wasm-based applications. Furthermore, root cause analysis of the issues helped us identify 278 types of causes, which have been categorized into 29 subcategories and 10 categories as a taxonomy of causes. Our study led to first-of-its-kind taxonomies of the issues faced by developers and their underlying causes in Wasm-based applications. The issue-cause taxonomies - identified from GitHub and SO, offering empirically derived guidelines - can guide researchers and practitioners to design, develop, and refactor Wasm-based applications. CCS CONCEPTS •Software and its engineering → Designing software;•General and reference →Empirical studies. This work is licensed under a Creative Commons Attribution International 4.0 License. EASE 2024, June 18–21, 2024, Salerno, Italy ©2024 Copyright held by the owner/author(s). ACM ISBN 979-8-4007-1701-7/24/06 https://doi.org/10.1145/3661167.3661227 KEYWORDS WebAssembly, Wasm, Issues, Causes, Mining Software Repositories ACM Reference Format: Muhammad Waseem, Teerath Das, Aakash Ahmad, Peng Liang, and Tommi Mikkonen. 2024. Issues and Their Causes in WebAssembly Applications: An Empirical Study. In 28th International Conference on Evaluation and Assessment in Software Engineering (EASE 2024), June 18–21, 2024, Salerno, Italy. ACM, New York, NY, USA, 11 pages. https://doi.org/10.1145/3661167. 3661227 1 INTRODUCTION WebAssembly (Wasm) as a binary instruction format enhances the performance and security of applications in web-based execution environments [ 16 ]. It serves as a potential compilation target for a variety of programming languages including C, C++, and Rust, marking a significant milestone in web development [ 8 ]. Wasm enables developers to employ their chosen programming languages and execute them swiftly in browsers, elevating the overall web experience that can range from gaming to multimedia and scientific simulations [ 12 ]. One of the key features of Wasm is its sandboxed execution environment - a compelling alternative to JavaScript, generally regarded as default language for web applications - offering an efficient and secure web interactions [7]. Recent research (e.g., [ 14 ][ 13 ]) has shown a significant rise in the utilization of Wasm beyond web browsers. This entails adapting code from various programming languages to operate on a range of devices via the Wasm Interpreter, aiming to establish a unified software architecture for web systems, softwares, and services. Despite these advantages, a thorough understanding of the challenges encountered by developers working with Wasm applications is yet to be fully explored. Wasm is a promising technology, however; its ecosystem and associated tools are in a phase of continuous evolution and often regarded as unstable that can impede the development practices for web applications [ 9 ]. Wasm applications may have an additional or specific set of issues. Borrowing the idea from [ 31 ] [ 30 ], we define issues in this study as errors, faults, failures, and bugs that occur in Wasm applications and consequently impact their quality and functionality. 170
EASE 2024, June 18–21, 2024, Salerno, Italy Waseem et al. To address this knowledge gap, we conducted an empirical study of developer interactions on GitHub and Stack Overflow (SO) concerning Wasm applications. By scrutinizing the information within these exchanges, we aim to identify the common problems faced by developers and the underlying causes of these issues. This initiative will help identify the common issues and their causes, which can also highlight areas requiring further research. Motivating Scenario: To contextualise the issues and causes in Wasm, we have provided a representative example in Figure 1. The particular example is taken from the Assemblyscript project, an open-source Wasm based project hosted on GitHub (see Table 1). Figure 1 provides essential information about Assemblyscript, including its project description, the number of stars it has received, and its contributor count. As demonstrated in the example, a contributor not only writes code but may also provide additional explanations through comments. Once the code has been compiled, if issues arise, any contributor can report an issue, such as “How to support function callback and Polymorphism”. It is also possible that the same or another contributor may identify the cause of the issue, for instance, stating that “Class inheritance features are not complete. Operation not supported error when using super() keyword”. A TypeScript-like language for WebAssembly 16 Stars Issues Contributors Forks Branches 16K 661 6 153 Name Assembly Script https://github.com/AssemblyScript/assemblyscript How to support function callback and Polymorphism #113 @MaxGraey Thanks for your reply. I tested that function callback supported. ... export function say():void{ saySomething(new Base()); saySomething(new Concrete()); } ... That's my code, I compile it to wast and run on wasm vm. I got the result "Base sayBase say". It seem that it's not supporting Polymorphism. 1 Identifies Issue "Class inheritance features are not complete. Operation not supported error when using super() keyword" caused by 2 Issue Cause Figure 1: Example: Github based Issue and its Cause in Wasm Objectives and key Findings: This work aims to analyse developers’ knowledge (available GitHub projects and SO posts) to systematically and comprehensively classify the issues and root causes associated with Wasm-based applications. To this end, we conducted an empirical investigation on 385 issues from projects hosted on GitHub and 354 issue releated questions and answers posts from SOF. The key findings of the study are structured as taxonomies of issues and their causes indicating (1) the issues in Wasm application are classified into 9 categories, of which Infrastructure and Compatibility Issues (28.16%), Language Features and Documentation Issues (18.00%), and Code Implementation and Build Issues (13.83%) are the most frequently reported; and (2) the leading causes behind these issues are Syntactic and Semantic Errors (25.77%), Configuration and Compatibility Constraints (20.1%), and Operational Limitations (12.98%). Primary contributions of this research are: • Mining GitHub (social coding platform) and SO (Q&A forum) to collect and analyze practitioners’ perspectives, such as code snippets, comments, scripts, queries, and responses, on predominant issues and their most frequent causes. • Taxonomic classification of issue-cause types, synthesizing available evidence (Figure 3, Figure 4), to categorize, visualize, and understand the nature of issues and causes. • Providing publicly available data [ 29 ] and outlining research implications as recommended guidelines for researching, designing, developing, and refactoring WebAssembly-based applications. The issue-cause taxonomies lay the foundation for discovering and documenting recurring solutions as patterns to address these issues (ongoing future work). The taxonomies of issues and causes derived from our study offer a structured framework that can guide developers in diagnosing and addressing several types of problems in Wasm applications. Furthermore, these findings provide an empirical foundation for researchers to target specific areas for tool and language improvement, enhancing the overall robustness and usability of the WebAssembly ecosystem. 2 RESEARCH METHOD The methodology employed for this study is divided into three phases, elaborated below and illustrated in Figure 2. RQ1 Issues Faced by Developers RQ2 Causes of the Issues issues have causes Phase I - Research Questions GitHub Stack Overflow "WebAssembly" "Wasm" - Stars - Forks - Contributors - Language Search Terms Search Filters Projects Retrieved Issues 12 SO Posts 3400 (385) Selected 8713 354 Phase II - Data Collection Extraction and Synthesis GitHub Projects SO Posts - General data - Enhancement proposal - Duplicates - ... Exclusion Criteria Extraction Synthesis - Index - Title - Link - Issue - Cause - Data Familiarization - Initial Codes - Search Issues/Causes - Review Issues/Causes - Naming and Category 385 354 Phase III - Data Figure 2: Overview of the research method 2.1 Phase I - Research Questions (RQs) • RQ1:What issues do developers face when working with WebAssembly applications? The objective of this RQ is to systematically identify and categorize the issues faced by developers in working with WebAssembly applications. • RQ2:What are the causes of issues that occur in WebAssembly applications? The objective of this RQ is to systematically investigate the root causes of the identified issues in WebAssembly applications. 2.2 Phase II - Data Collection Data for this study was gathered from two primary platforms. 171
Issues and Their Causes in WebAssembly Applications: An Empirical Study EASE 2024, June 18–21, 2024, Salerno, Italy GitHub: We collected data from a diverse range of open-source Wasm applications hosted on GitHub (see Table 1). To explore Wasm projects as in 1, we executed the search with the terms “WebAssembly” and “Wasm” in the GitHub search bar, yielding 11,366 repository results as of March 26, 2023. We then filtered these results based on “languages” using the GitHub sidebar, resulting in 392 repositories. We discovered that several projects were aimed at developing Wasm applications but utilized other programming languages (e.g., Go, Java). To exclude such projects, we manually examined the 392 repositories, selecting only those that (i) utilized the Wasm language for over 50% of the project, and (ii) had more than 100 closed issues. Ultimately, we identified 12 projects (see Table 1). Our selected projects range from Runtime Environments like Wasmer, which serves as a critical platform for executing Wasm code, to Specifications and Proposals such as WebAssembly/spec and WebAssembly/simd that guide the platform’s evolution. We also explored Toolchains and Compilers, exemplified by projects like WebAssembly/binaryen and AssemblyScript/assemblyscript , which facilitate the development and optimization of Wasm modules. Our study also investigates Applications related to Wasm like torch2424/wasmboy , a Game Boy emulator that showcases Wasm’s performance capabilities, as well as Blockchain and Smart Contract systems like near/nearcore , which demonstrate Wasm’s versatility. Similarly, we also found UI and Frontend frameworks for Wasm like unoplatform/Uno.Wasm.Bootstrap , which leverage Wasm to extend traditional web development boundaries.We extracted the developer discussions with the help of issue tracking systems of the identified 12 projects, encompassing on closed issues, in order to enhance the likelihood of discovering Wasm-related discussions. In total, we obtained 6,448 closed issues. Stack Overflow: We also collected Question and Answer (Q&A) pairs related to Wasm from SO. We initiated our data collection process by conducting an automated search on SO using two terms (i.e., “WebAssembly”, “Wasm”) aligning with our GitHub search criteria. We then implemented a custom script to extract the relevant Q&A posts retrieved from SO and store the information in data extraction sheets [ 29 ]. This encompassed posts where the terms appeared in the post title, body of questions, and contents of answers. Initially, this search yielded 4,518 posts as of April 12, 2023. Random Sampling: To conduct a comprehensive analysis of the 6,448 issue discussions from GitHub and 4,518 Q&As from SO, we employed a random sampling formula: 𝑛= 𝑁·𝑋 𝑋+𝑁−1,with 𝑋= 𝑍2·𝑃· (1−𝑃) 𝐸2 In this formula, 𝑁 is the population size, which is 6,448 and 4,518 , 𝑍 is the Z-score, which is 1.96, 𝑃 is the assumed population proportion, which is 0.5, and 𝐸 is the margin of error, which is 0.05. This approach facilitated a balanced subset selection from our dataset, thereby mitigating bias and ensuring the generalizability of our findings. Additionally, it allowed for equitable comparisons among various groups within the dataset, all while optimizing resource utilization. Our selection procedure involved the random sampling of 385 issues from a pool of 6,448 issue discussions and 354 Q&As posts from SO. These samples were drawn while maintaining a 95% confidence level and a 5% margin of error [10]. Table 1: List of Identified WebAssembly Applications # Project Name Closed Issues Fork Star 1 Wasmerio/wasmer 917 631 14.7K 2 WebAssembly/spec 517 438 2.9K 3 WebAssembly/binaryen 693 640 6.3K 4 AssemblyScript/assemblyscript 1169 636 15.3K 5 Torch2424/wasmboy 120 55 1.3K 6 WebAssembly/simd 120 46 503 7 WebAssembly/gc 258 51 700 8 WebAssembly/exception-handling 89 33 115 9 Near/nearcore 2201 436 2K 10 PollRobots/scheme 283 5 141 11 Unoplatform/Uno.Wasm.Bootstrap 91 49 312 12 Brson/wasm-opt-rs 13 6 22 Table 2: Data items extracted # Data item Description D1 Index ID of the GitHub discussion and SO post D2 Title Title of the discussion and SO post D3 Link Weblink of the the discussion and SO post D4 Issue Key point(s) of the issue from discussion and posts D5 Cause Key point(s) for the cause from discussion and posts 2.3 Phase III - Extract and Synthesize Data Issues and Causes Extraction: After selecting 12 projects, 385 developer discussions from GitHub, and 354 Q&A posts from SO, the first and second authors manually retrieved the background information (e.g., issue label, URL) about the developer discussions and Q&A posts from SO. In the case of GitHub, we only selected closed issues that could potentially provide answers to our research questions. During this step, the first and second authors thoroughly analyzed each of the 385 issues and 354 Q&A, and excluded all those that consisted of (i) general questions, opinions, feedback, and ideas; (ii) enhancement proposals; (iii) general announcements; (iv) duplicated issues or repeated questions; and (v) issues and Q&A posts without detailed descriptions. During the data extraction, there were several discussions from GitHub and Q&A posts from SO where the first and second authors were not able to decide whether to include them for further analysis. In such situations, the first and second authors discussed those issues with all authors to gather their opinions about inclusion or exclusion. Any disagreements about the results of the screening process were discussed among all the authors to reach a consensus. Data Extraction: We defined a set of data items (see Table 2) to answer the RQs formulated in Section 2.1. The first and second authors of the study conducted a pilot data extraction involving 30 GitHub discussions and 30 SO Q&A posts, and the remaining authors evaluated the extracted data. Subsequently, the first and second authors employed a revised set of data items for formal data extraction from the selected issues. Data items (D1-D3) provide basic information, while data items (D4, D5) used to extract data to answer RQ1 and RQ2. Data Synthesis: We employed the thematic analysis approach [ 5 ] to analyze and classify issues and causes which is consists of five key steps: (i)Familiarizing with data: The first and second authors thoroughly reviewed the GitHub discussion and SO pots and documented the key points related to issues and causes. (ii) Preparing initial codes: After familiarizing, the same authors compiled an initial list of codes for the identified issues and causes (refer to 172
EASE 2024, June 18–21, 2024, Salerno, Italy Waseem et al. the Initial Codes sheet in [ 29 ]). (iii) Searching for the types of issues and causes: Following the preparation of the initial codes, both the first and second authors analyzed them and categorized them into specific types of issues and causes. (iv) Reviewing types of issues and causes: All authors collaboratively reviewed and refined the coding results, organizing them under the relevant types of issues and causes. During this process, we engaged in discussions, separating, merging, or discarding several issues and causes. (v) Defining and naming categories: We precisely defined and further refined all types of issues and causes by creating clear subcategories and categories. By following these steps, we established three levels of categories for effectively managing the identified issues and causes for Wasm applications. 3 RESULTS – ISSUES AND CAUSES IN WASM This section presents the study results, addressing the two RQs outlined in Section 2.1. The results are organized into categories, subcategories, and types. Categories are presented in boldface, subcategories in italic, and types in small capitals. At the end of each section, based on the study results, a ‘Takeaways’ box provides the key messages for Wasm researchers and practitioners. 3.1 Types of Issues (RQ1) The taxonomy of Wasm application issues is shown in Figure 3. Developed from analyzing GitHub developer discussions and SO Q&As, it categorizes 739 issues into 9 main categories with 19 subcategories, totaling 120 types. Descriptions of each category are provided below, with detailed data in our replication package [ 29 ]. 1. Infrastructure and Compatibility Issues: This category broadly covers issues related to system architecture, integration of various components, and compatibility issues in Wasm applications. It is composed of three subcategories: Infrastructure Management Issues, which collect concerns in setting up and maintaining the infrastructure necessary for Wasm; Application Integration Issues, which gather problems in the integration of Wasm with various programming languages and platforms; and Compatibility and Configuration Issues, which amass issues related to the compatibility of Wasm across different systems. In total, there are 169 issues, constituting 28.16% of all identified issues. Examples of issues within these subcategories include testing issues,tooling issues, and integration issues, which are related to compromising the reliability and efficiency of the infrastructure. Additionally, compatibility issues and symbol renaming issues, are crucial to ensure that Wasm modules operate correctly across different environments. Tackling these issues is critical for the robust deployment and functioning of Wasm applications. 2. Language Features and Documentation Issues: This category encompasses concerns related to the features of the programming languages that are available in Wasm, along with issues pertaining to the associated documentation. It consists of two subcategories: Language Feature Issues, which collects challenges related to language use, specifications, and the introduction of new features, and Documentation Issues, which aggregates problems involving existing documentation, licensing, intellectual property rights, and queries regarding pricing. Altogether, there are 108 issues noted, which constitute 18.00% of all issues identified. Within these subcategories, examples of issues such as language usage issues,language specification issues, and language feature reqests are significant, as they directly influence the efficacy with which developers can leverage Wasm. In parallel, documentation issues and license/intellectual property issues underscore the importance of having clear, accessible, and legally robust support materials to facilitate the adoption and effective use of Wasm. Addressing these issues is essential for fostering a comprehensive understanding and application of Wasm within the developer community. 3. Code Implementation and Build Issue: This category is concerned with challenges encountered during the coding and build phases in software development, which are especially pertinent for Wasm given its need for compilation. It includes two main subcategories: Code Implementation Issues, representing the range of problems that can arise during the actual coding process, and Build Issues, that pertain to complications that occur during the software build process, such as dependency management. This category has a total of 83 issues, representing 13.83% of all the issues identified. Issues within these subcategories, such as code qality issues, code analysis issues, and code review and feedback issues, are crucial as they directly impact the efficacy and maintainability of Wasm modules. The compilation process and associated challenges, including build issues and dependency management, are important to address because they affect the performance, reliability, and the smooth deployment of Wasm applications, thus influencing their stability and the cycle of updates. 4. User Interface and Performance Issue: This category encapsulates concerns with the user-facing aspects and the efficiency of Wasm applications. It is divided into User Interface Issues, which pertains to the design and interactivity components, including elements like button functionality and UI customization, and Performance Issue, which deals with the speed and responsiveness of the application, including performance optimization and graphics rendering. In total, this category includes 68 issues, constituting 11.33% of all issues identified. Within these subcategories, specific challenges like ui rendering issues and ui design issues are crucial as they directly influence user engagement and satisfaction. Performance concerns, such as performance optimization issues and timing and synchronization issues, are fundamental to the functionality of Wasm applications, affecting their operational capability and the user experience. Addressing these issues is critical to enhancing both the interface and the performance of Wasm applications for end users. 5. Error Management and Debugging Issues: This category addresses the crucial aspects of identifying, handling, and resolving errors in Wasm applications. It is categorized into Debugging Issues, which includes problems like bug regressions, debugging intricacies, and bug fuzzing, and Error Management Issue, which covers the systematic approach to error and exception handling, and issues arising from unexpected behavior or integrity errors. There are 65 issues in total, accounting for 10.83% of all issues documented. Specifically, within these subcategories, challenges such as execution errors,error/exception handling, and unexpected behavior are pivotal, as they impact the stability and reliability of Wasm applications. Issues like function signature mismatch error,type mismatch error, and value assignment 173
Issues and Their Causes in WebAssembly Applications: An Empirical Study EASE 2024, June 18–21, 2024, Salerno, Italy error underscore the complexities of ensuring accurate execution and data integrity. Effective management and resolution of these issues are essential for the development of robust, error-resistant Wasm applications. 6. Network and Operational Issues: This category pertains to challenges associated with networking and the day-to-day operational aspects of Wasm applications. It is subdivided into Functional & Operational Issues, which comprise problems affecting application functionality and operations such as event handling, module imports, and system integrations, and Network and Communication Issues, which deal with data transmission, protocol adherence, and network requests. There are 40 documented issues in total, which account for 6.66% of all issues reported. In these subcategories, specific concerns like functionality issues,prerendering issues, and socket integration issues are significant as they directly influence the operational effectiveness of Wasm applications. Network-related issues such as network/protocol issues and network communication issues are critical for maintaining robust communication channels within and across Wasm applications. 7. Security Issues: This category encompasses the various aspects of security within Wasm applications. It includes Authentication Issues, which cover problems related to user verification, assertion checks, certificate integration, cryptographic operations, and role-based authorization. Another critical area is Compliance Issues, comprising 13 issues related to adherence to platform standards, browser compatibility, and environmental regulations, as well as the challenges in porting applications while maintaining compliance. There are 29 documented issues in total, which account for 4.83% of all issues reported. Specific challenges within these subcategories, such as authentication issues and cryptographic operations, are fundamental to the secure operation of Wasm applications. Compliance concerns, including platform compatibility issues and advertising compliance, are crucial for the applications to operate within the legal and technical frameworks of various environments. Effectively managing these security and compliance issues is paramount for the integrity and reliability of Wasm applications. 8. Concurrency and Memory Management Errors: This category addresses critical issues related to the simultaneous operation of multiple processes and the efficient management of memory in Wasm applications. It accounts for 20 issues in total, comprising 3.33% of all recorded problems. Within this category, there are Concurrency Issues, which include challenges like managing asynchronous execution and synchronization, and Memory Management Errors, which involve a variety of concerns ranging from memory access and allocation issues to questions about memory usage and the limitations inherent in dynamic loading. There are 20 issues in total, comprising 3.33% of all recorded problems. 9. State and Data Management: This category is concerned with issues related to maintaining the state of applications and the management of data within Wasm applications, accounting for 18 issues and representing 3% of all issues. It is divided into State Management Issues, which includes problems like state serialization and general state management concerns, and Data Management Issues, which covers a broader range of data-related challenges such as database integration, caching strategies, asset management, cookie handling, and file management issues. Within these subcategories, issues such as state serialization issues and serialization issues are critical because they affect how application state is maintained and restored, which is vital for the user experience. On the data management side, issues like database issues,caching issues, and file management issues are essential for the efficient operation and scalability of Wasm applications. Takeaways 1Infrastructure and Compatibility: Leading issues include system architecture and API complexities, affecting Wasm’s seamless integration with existing systems. 2 Operational Issues: Networking and communication issues notably impact the stability and reliability of Wasm applications. 3 Code and Build Issues: Implementation, optimization, and dependency management are key areas needing attention for quality Wasm application development. 3.2 Causes of Wasm Issues (RQ2) The taxonomy of causes of Wasm issues is detailed in Figure 4. The cause taxonomy is based on data mined from developer discussions on GitHub and SO. It is important to note that not all discussions on these platforms provide cause information. Therefore, we identified only 516 cause instances from both sources. This analysis identified 278 cause types, categorized into 10 main categories and 29 subcategories. Detailed information is available in the dataset [29]. 1. Syntactic and Semantic Errors: This cause category encompasses causes that originate from syntactic and semantic inconsistencies within Wasm code, often leading to compilation and runtime issues , or unexpected behavior. It includes a total of 133 reported causes. Subcategories within this category are Syntax Errors and Inconsistencies,Initialization and File Handling Anomalies,Type Mismatches and Inconsistencies, and Logic Errors and Bugs. Some of the leading key types of causes such as bug in the code,internal error, and syntax unfamiliarity within Syntax Errors and Inconsistencies are critical as they directly affect the correct interpretation and execution of Wasm code. In Initialization and File Handling Anomalies, causes like mismanagement of data buffers and segmentation fault issues are significant, as they can lead to crashes and unpredictable behavior. Type Mismatches and Inconsistencies include crucial causes such as missing identifiers and functions, which can prevent code from compiling or running correctly, while Logic Errors and Bugs, with causes like branching logic in transactions and component initialization issues, can result in flawed application logic and runtime errors. 2. Configuration and Compatibility: This cause category is central to issues that arise from the setup and interoperability of Wasm systems, featuring 104 reported causes. Within this category, we have three subcategories: Compatibility and Specification Issues,Build and Configuration Conflicts, and Environment & Setup Issues. Notable causes within Compatibility and Specification Issues include interoperability challenges and library compatibility issues, which are critical for ensuring that Wasm modules work across different platforms and with various libraries. In Build and Configuration Conflicts, causes such as environment variable issues and ssl configuration issues can lead to significant deployment problems. Moreover, Environment & Setup Issues like logging configuration conflicts affect the operational aspect of Wasm 174
EASE 2024, June 18–21, 2024, Salerno, Italy Waseem et al. Error Management and Debugging Issues Error/Exception Handling Exception Handling Issue Bug/Regression Debugging Issues Bug/Fuzzing Issue Security Issues Authentication Issues Certificate Integration Assertion Failure Role-Based Authorization Issue Cryptographic Operations Platform Compatibility Issues Security Errors Compatibility Issues Functionality Issue Import Function Error Socket Integration Issue Event Handling Issue Implementation Issue Module Import Issue Prerendering Issue Network and Operational Issues Network/Protocol Issue Network Communication Issues Networking Issue Network Request Issue Game Development Issue Logging Issue Limitation Issues Audio Processing Infrastructure and Compatibility Issues Infrastructure Management Issues (138) Application Integration Issues (24) API Issues Integration Errors Development Environment Issues Language Integration Issue Language Interoperability Issue Blazor Application Setup Issue JavaScript Integration Issue External Library Integration Issue Language Features and Documentation Issues Language Usage Issue Language Specification issue Language Feature Request Language Proposal Language Selection Issue Documentation Issues License/Intellectual Property Issue Pricing Inquiry Known Issue User Interface and Performance Issue Code Implementation and Build Issue Build Issues Dependency Injection Compilation Issues Code Refactoring Issue Code Optimization Issue Code Quality Issue Code Analysis Styling and Scripting Customization Issue Button Functionality State and Data Management Issues Concurrency and Memory Management Errors §§ Category Taxonomy Legend Type of Issues Taxonomy 65 (10.83%) 20 (3.33%) 40 (6.66%) 169 (28.16%) 108 (18%) Taxonomy of Issues in WebAssembly-based Systems 68 (11.33%) 18 (3%) Number of Issues (Percentage) Python Integration Issue 29 (4.83%) (Number of Issues) Subcategory Deployment Issues Testing Issues Tooling Issues Continuous Integration Installation Issue Project Setup and Launch Project Structure Technology Selection Loading Order Issue Project Configuration Rust API and Dependency Issue Rust Language Integration Issue Compatibility and Configuration Issues (7) Compatibility Issue Library Compatibility Issue MIME Type Compatibility Issue Renaming and IntelliSense Issue Symbol Renaming Issue 83 (13.83%) Code Implementation and Optimization (72) Build and Dependency Management (11) Release Management Issue Code Review Code Behavior Issue Code Modification Issue Code Organization and Structure Issue Language Features Issue (91) Documentation Issue (17) Language Issues Performance Issue (36) User Interface Issues UI Rendering Issue Theme Change Error UI Blocking Issue Performance Comparison Issue Performance Optimization Issue Graphics Rendering Optimization Timing and Synchronization Issue User Interface Issue (32) UI Design Issue UI Event Handling Issue UI Framework Integration UI Integration Issue UI Styling Issue Error Management Issue (43) Debugging Issue (22) Unexpected Behavior Upgrade and Integrity Error Function Signature Mismatch Error Type Mismatch Error Value Assignment Error Execution Error Functional & Operational Issues (28) Network and Communication (12) Monitoring Requirement Virtualization Error WebAssembly Detection Issue WebAssembly Library Distribution Authentication Issues (16) Compliance Issue (13) Browser Compatibility Advertising Compliance Environment Compatibility Issue Porting and Compatibility Issue Concurrency Issues (4) Concurrency Issues (16) Memory Management Issue Memory Access Failure Memory Exhaustion Issue Memory Access Issue Memory Management Limitation Memory Allocation Limitations Memory and Safety Mechanism Queries Dynamic Loading and Memory Access issue Memory Limitations Memory Usage Question Concurrency Issues Asynchronous Execution Synchronization Issue Data Management Issue (14) Data Issues Asset Management Database Issues Caching Issues Cookie Management File Management Issue State Serialization Issue State Management Issue Serialization Issue State Management Issue (4) Swift Integration Issue Application Integration Issue Cross-Platform Integration Issue Figure 3: A Taxonomy of Issues in Wasm Applications applications, highlighting the need for meticulous configuration management. Addressing these configuration and compatibility causes is essential to prevent disruptions in Wasm application development and deployment. 3. Operational Limitations: This cause category deals with constraints that impact the functionality and security of Wasm applications during their operation, totaling 62 reported causes. Within this category, we have two subcategories: Performance deficiencies,Technical Limitations, and Security Constraints. Key types of causes within Performance deficiencies, such as performance limitation and performance regression, are critical as they can significantly degrade user experience and application responsiveness. Within Technical Limitations, causes like lack of support for global variables and absence of specification tests pose challenges for developers by restricting the functionality and verifiability of Wasm modules. Security Constraints involve issues like authentication/token issues and security/browser policy issues, which are essential for maintaining the integrity and trustworthiness of applications. Effectively addressing these operational limitations is crucial for the advancement and secure deployment of Wasm applications. 4. Infrastructure Limitations: This cause category encompasses foundational concerns that impact the operation of Wasm applications. It includes two subcategories: Network and Platform limitation,I/O Handling limitation and Synchronization Limitation. Significant causes within Network and Platform limitation involve challenges like network connection issues and platform-specific compatibility issues, which can severely restrict an application’s functional scope and connectivity. I/O Handling limitation is vital for the application’s interface with the user and the system, where issues such as HTTP response handling and CORS issues are key operational concerns. In the realm of Synchronization Limitation, causes such as single-threading constraints and deadlocks highlight the complexities of managing concurrent operations in Wasm. Effectively tackling these infrastructure limitations is essential for the seamless operation and scalability of Wasm applications. 5. Low Code Quality: Gathers the causes related to inadequately maintained and poor-quality codebases in JavaScript and Wasm interactions, along with a deficiency in essential supportive elements such as libraries and documentation. It includes Poor Code Quality and Maintenance and Poor Dependency and Integration Limitations subcategories. Key causes such as script path issues and inefficiencies in original coding design from the Poor Code Quality and Maintenance subcategory are pivotal, as they can directly impact the functionality and extendibility of the code. Additionally, Poor Dependency and Integration Limitations present significant 175
Issues and Their Causes in WebAssembly Applications: An Empirical Study EASE 2024, June 18–21, 2024, Salerno, Italy causes like authentication integration shortcomings and service container dependency misconfigurations, which can complicate the integration process and affect the stability of the application. Addressing these causes is essential for the development of high-quality, maintainable Wasm applications that are well-integrated within their respective ecosystems. 6. Language and Library Constraints:Consolidates the causes related to the limitations within programming languages and their associated libraries in the context of Wasm. This category combines causes into three subcategories API and Functionality Constraints, Language & Library Limitations, and Web Platform Limitations subcategories. For example, API and Functionality Constraints involve critical causes such as API limitations that can significantly hamper the integration and operational capabilities of Wasm modules. Language & Library Limitations highlight causes like language interoperability issues, which affect the seamless integration of Wasm with other programming environments. Furthermore, Web Platform Limitations bring attention to causes such as tooling limitations, emphasizing the need for up-to-date and compatible tools to support the evolving landscape of Wasm. Navigating these causes is key to enhancing Wasm’s adaptability and ensuring its effective deployment across various platforms. 7. Documentation and Technologies Causes: This category identifies causes related to informational discrepancies and technical limitations that affect the use and development of Wasm. This category combines causes into two subcategories: Documentation Inaccuracy and Technological and Licensing Constraints. For instance, Documentation inaccuracy covers causes such as lack of clear definition and errors in document, which can create barriers to correctly implementing and leveraging Wasm’s functionalities. Technological and Licensing Constraints highlight issues like rust segmentation fault and rust/wasm interoperability mismatch, pinpointing the technical hurdles that can arise due to language-specific features or the integration of different technologies. These constraints underscore the importance of accurate documentation and adaptable technology solutions to support the evolving needs of Wasm applications and their users. Addressing these causes is essential to foster a clear understanding and effective utilization of Wasm across various domains. 8. Data Handling and Design Anomalies: This category captures causes concerning the integrity and structure of data within Wasm applications. It category combines causes into three subcategories: Data inconsistency,Database Anomalies,File Access and Handling Anomalies, and Serialization Anomalies. For example, causes such as anomalies in atomic type implementation and state management issues within the Data inconsistency subcategory can directly affect the accuracy and reliability of data processes. Causes in Database Anomalies, like data conversion errors and missing database files, are pivotal as they influence the robustness of database operations. Within File Access and Handling Anomalies, causes such as I/O constraints and file system access restrictions can severely limit application functionality. Causes in Serialization Anomalies, including discrepancies in serialization of memory operations offset, can lead to data integrity concerns. 9. Memory and Storage Anomalies: This category collects causes associated with the mismanagement and technical challenges of memory and storage within Wasm applications. It combines causes into two subcategories Memory and Storage Anomalies and Block and Caching Anomalies. Causes like mismanagement of memory resources and issues with garbage collection within the Memory and Storage Anomalies subcategory are critical as they directly influence the application’s stability and resource optimization. In the Block and Caching Anomalies subcategory, causes such as block download failures and cache problems highlight the importance of reliable data storage and efficient retrieval mechanisms. Addressing these memory and storage causes is fundamental to ensuring that Wasm applications maintain their integrity and provide a responsive user experience. 10. User Interaction Anomalies: This category encompasses causes that negatively impact the user’s ability to interact with Wasm applications effectively. It includes UI Control Inconsistencies, UI Rendering Anomalies, and Browser-Specific Limitations subcategories. For instance, within UI Control Inconsistencies, causes such as compatibility issues with UI controls and confusion due to formatting can disrupt the user’s navigation and interaction with the application. UI Rendering Anomalies highlight causes like animation and timing flaws, which are crucial for a seamless and intuitive user interface. Browser-Specific Limitations bring to light causes such as security constraints in browser, which can limit functionality and affect the overall accessibility of Wasm applications. Takeaways 4 Diversity in Language Compilation: The diversity of source languages compilable to Wasm causes inconsistencies and errors in resultant applications. 5 Security Vulnerabilities due to Wasm’s Structure and Execution Model: Wasm’s structure and execution model are inherent causes of new security vulnerabilities in applications. 6 Complexities in Optimizing Compiled Code: The inherent complexities in optimizing Wasm code cause performance bottlenecks affecting user experience. 4 DISCUSSION AND IMPLICATIONS This section presents the discussion on the key takeaways along with implications for researchers and practitioners based on the study results. Section 4.1 outlines the potential implications associated with WebAssembly issues, while section 4.2 discusses into the various WebAssembly causes. 4.1 Wasm Issues 1Infrastructure and Compatibility Issues: Among the key insights gained from mining GitHub and SO discussions is the recurring theme of infrastructure and compatibility issues with Wasm. The consistent mention of these challenges among developers suggests that integrating Wasm into existing systems remains a significant obstacle. This aligns with existing studies (e.g., [ 18 ]) highlight the difficulty in adopting new technologies due to system architecture complexities [ 18 ] and API-related issues [ 17 ]. The online developer discussions illuminate a gap between academic understanding and real-world practice. Although the academic literature may describe the theoretical benefits of Wasm [ 6 ], the actual 176
EASE 2024, June 18–21, 2024, Salerno, Italy Waseem et al. Documentation and Technologies Causes Ambiguity in WebAssembly Documentation Documentation/Compatibility Mismatch Problem with ASP.NET Zipping of Published Files Problem with near package's testnet functionality Problem with OCaml's x87 Arithmetic Memory and Storage Anomalies Mismanagement of Memory Resources Unaddressed Host- Created Memory Programming Errors Affecting Memory Storage Leakage in Memory Problems with Garbage Collection Block Download Failures Retrieval Anomalies in Block Headers Issues in Retrieving Blocks Performance limitation (Animation, Caching, etc.) Suboptimal Performance Exceeding RPC Performance Limit Optimization Problem Lack of Performance Data Uncertain efficiency Division Optimization Operational limitations Coverage Failure during CI Process Crash with -g Option Future of the Platform is Uncertain Authentication/Token problem Security restriction Security/Browser policy problem Security/Content Security Policy (CSP) problem Syntactic and Semantic Errors Syntax Errors and Inconsistencies (61) Initialization and File Handling Anomalies (14) Mismanagement of Data Buffers Internal Error Bug in the Code Inaccessibility of Locals with Large Indices Erroneous Calculation of Percentages Incorrect File Paths Short Transaction Validity Periods Incorrect Configuration of table.grow Size Configuration and Compatibility Build Configuration Conflicts Compilation Compatibility Problems Interoperability Challenges Multiple Compatibility Issues During Compilation System and Tool Incompatibility Problems General Environment Concerns Logging Configuration Conflicts Localization/Resource File Challenges User Interaction Anomalies Data Handling and Design Anomalies Custom Sections Misaligned with AST Design Contradiction in Field Access and Ordering Errors in File Format or Content I/O Constraints Failure in File Opening in Rust to Wasm Compilation File System Access Restrictions Low Code Quality §§ Category Taxonomy Legend Type of Issues Taxonomy 27 (5.13%) 39 (7.41%) 62 (11.78%) 133 (25.28%) 104 (19.77%) Taxonomy of Causes of WebAssembly Issues 20 (3.80%) Number of Issues (Percentage) Insufficient Type Inference Mechanisms 29 (5.51%) (Number of Causes) Subcategory Duplicate Identifier Array Export Error AssertionError Unknown Causes Comparison problem Linking problems During Compilation Duplicated Expressions Form/Binding/API problem Dispose method problem Circular reference Function Invocation Re-rendering issue Async issue Control flow issue Infinite Loop Validation Failure in Module Too Many Open Files Version Mismatch in WebAssembly Instantiation 28 (5.32%) File Access and Handling Anomalies (5) Serialization Anomalies (3) Disagreement in Serialization of Memory Operations Offset File Upload or Progress Inconsistencies Compatibility and Specification Issues (54) Environment & Setup Problems (3) Library Compatibility Problems UI Rendering Anomalies (8) Difficulty Handling Interactions of Different Types Difficulty Identifying Selected Seat Price in EpochManager Compatibility Issues with UI Controls Virtualization Issues in UI Controls Rendering Inconsistencies Canvas Initialization Failures Paint Rendering Issues UI Compatibility Concerns UI Control Inconsistencies (8) State Management Issues in UI Controls Validation Problems in UI Forms Confusing Local Network Commands Confusion Due to Formatting Documentation inaccuracy (9) Technological and Licensing Constraints (18) Documentation/Contradictory information Documentation/Implementation Flaw Lack of Clear Definition and Errors in Document Lack of Clarity in Proposal Lack of Understanding of Interface and C APIs Problem with Wasmer's WasmPtr & Memory Accesses Security & Policy Constraints (19) Technical Limitations (9) Performance deficiencies (34) Security/Platform-specific problem Security/Same-Origin Policy problem Security/Secure storage limitation problem DoS Workaround Memory and Storage Anomalies (15) Block and Caching Anomalies (5) Absence of Effective Caching Cache problem Poor Dependency and Integration Limitations (19) Poor Code Quality and Maintenance (20) Interop problem JavaScript limitation Inefficiencies in Original Coding Design and Assembly Script Script path problem WebAssembly interaction problem Lack of library support Wrapping up and Implementing New API Need for Better ES6 Module Building and Tree Shaking Lack of Duplicate Transaction Check Lack of Reference Docs ABP Framework Integration Lacks ASP Classic Integration Inefficiency Authentication Integration Shortcoming Logic Errors and Bugs (23) Component initialization issue Branching Logic in Transactions JS.md and Handling of funcidx limitation call_indirect and function pointers issue GlobalI64 Absence Bikeshed Dev issue Bit and Type Errors Function and Value Misuse Missing identifiers and Functions Type Mismatches and Inconsistencies (35) Syntax/configuration issue Import-related flaw Code correctness problem Code organization problem Syntax Unfamiliarity Code Generation for Each Assertion Expression Collapse problem Function Blocks in Binaryen AST Enum Value Return Error Compiler Errors in Arrow Expressions Import Path Error Code File Type Mismatch TypeScript Syntax Limitations Initialization issue Pointer issue Segmentation fault issue Concerns about Start Function Failure Lack of knowledge Code structure issue Naming conflict Non-idiomatic Bindings Inconsistent Functions Misunderstanding of Specified Limit Erroneous Parameter Enclosure Non-UTF-8 Characters in Log Message Inherit/Dispatch Confusion Double Rounding Issue in OCaml Implementation Lack of Validation and Evaluation Support Refactoring and Code Quality Problem DCE Optimization and Tree-Shaking Excessive Log Addition Inefficient Handling of Strings Lack of Code Comments and Outdated Code Negative Focus on GC Lack of Configuration Optimization Limitations Symbol Not Found Connection String Handling Flaw React Native Compatibility Mismatch Integration Decision With Project Maintainers Dependency Injection Misuse Dependency Library Import Misuse Dependency Compatibility Mismatch Dependency Execution Order Problem Dependency Configuration Oversight Service Container Dependency Misconfig Deployment Config Deficit Lack of Understanding on Making Host-Created Memory Accessible Licensing Constraints Limitations of Technology Limited Support for Dynamic Field Access Rust API Handling Fault Rust Segmentation Fault Rust Segmentation Fault Rust Std Library or GitHub Actions Configuration Problems Rust/Wasm Interoperability mismatch Unavailability Guarantee for State-Based Accounts Unreachable Code in Rust Wrapping Bindings on Guest and Host Side Performance Regression Slow Response Time Ambiguities in Data Tag Definitions Inadequate Type Structure Absence of Specification Tests Lack of Support for Global Variables Unimplemented Functions s2wasm Error with LLVM syntax Design Constraints Limiting Memory Unauthorized or Incorrect Memory Access Lack of Sufficient Memory Early Validation and Memory Cost Anomalies Buffer Overflow in wasmbinary.cpp Differences in mem init file generation Uncontrolled Memory Growth Mismatch in Memory Models Control State Instability in UI Virtualization Limitations in UI UI Form Validation Problems Animation and Timing Flaws Browser-Specific Limitations (4) Privacy Settings Issues in Browser Security Constraints in Browser Font Blocking and Display Problems in Browser Data Conversion Errors Issues in Data Initialization or Navigation Visibility Issues During Data Loading Data Transfer Limitations Database Anomalies (9) Inadequate Handling of Queries Missing Database Files Concurrency Anomalies in Database Anomalies in Atomic Type Implementation Upcasting Issues Breaking Opacity Anomalies with Immediates for Lane Indices Excessive Shift Count for Lane Bits Data inconsistency (11) Sign- Extending Variants in Packed Loads Issues in Handling Historical Data Requests Insufficient Epoch Time State management issue State management/ Programming error State Splitting Delay Rent_paid Field in Block and Chunk Headers Always 0 Contract Cost Dependency Cross-Contract Compatibility and RPC Modifications Compatibility Challenges in Compilation Platform-Specific Compatibility Problems Specification Limitations Affecting Compilation General Configuration Problems Configuration Conflicts During Build Dependency Configuration Problems Environment Variable Problems Build and Configuration Conflicts (47) Unsupported Features Causing Compilation Problems Continuous Addition of New Operations Hindering Standardization Backward Compatibility Problems Conflicts When Setting LTO and Codegen-Units Versioning Problems in Build Process SSL Configuration Problems Lack of Proper Configuration Validation and Evaluation Support Absence Duplicate Transaction Check Absence Lack of Library Support Language and Library Constraints 38 (7.22%) DOM Manipulation Limitations WebAssembly- Language Tooling Limitations Web Platform Limitations (5) Language- Specific Limitations Language Interoperability Problems Language/Runtime Limitations Unsupported Language Features Language & Library Limitations (13) Library Compatibility Conflicts Feature/Library Limitations Absence of ucontext_t in libc Crate for powerpc64- linux-gnu C Library Not Found in Hyperledger Fabric Peer Compression Configuration Problems Deprecated Functionality & Wasmer Clarity Problems Deprecated Trait Object & Default Trait Absence Deprecation Risks Authentication and Token Problems Asynchronous Handling Problems Import/Export Function Limitations API and Functionality Constraints (20) Export Function Errors Audio Processing Deficiencies API Limitations Infrastructure Limitations 55 (10.45%) Image Format/Processing Problems Audio Processing Problems HTTP Response Handling Problems Platform-specific Subissues (Compatibility, Dependency, etc.) Networking/Various Sub-issues (Event loop, HTTP, Routing, etc.) Network Capability Limitations Network Connection Issues Causing Sentry Failures Network and Platform limitation (44) I/O Handling limitation (4) Network/File size issue Network/Port conflict issue Ethereum's Web3 API Endpoints I/O-Related Problems First Block/Chunk Requested for Given Height Forks and State Computation Result Dependence Handling Epoch Switches in Finality Gadget Gas Deduction for Host Operations Genesis Records in Memory Incorrect Validator Count Server Constraints (4) CORS/HttpClient problem Server/Restart problem Congestion in WASM Runner or Runtime Components Server Constraints (3) Lack of Synchronization Single-Threading Constraints Deadlocks Figure 4: A Taxonomy of Causes of Issues in Wasm Applications integration into existing architectures proves to be a complex issue not fully addressed [ 2 ]. Implications : The persistent nature of these issues highlights the need for academic research that bridges theory and practice, focusing on creating more robust integration methods or frameworks for Wasm. Practitioners can benefit from more actionable guidance, possibly in the form of best practice documents. 2 Operational Issues: A critical aspect uncovered pertains to operational challenges in networking and communication, as highlighted in discussions across platforms like GitHub and SO. Developers have raised concerns about the reliability of these aspects in Wasm [ 8 ], echoing literature that points to new technologies often grappling with underdeveloped networking protocols (e.g.,[ 23 ]). There is a discernible lack of literature focusing specifically on Wasm’s operational capabilities in these areas. Insights from realworld scenarios, as seen in the aforementioned platforms, are crucial in bridging this knowledge gap [ 25 ]. Implications : This presents a fertile ground for researchers to delve into Wasm’s networking functionalities and suggest improvements. Similarly, practitioners are advised to examine the operational elements of Wasm meticulously, potentially utilizing external libraries or modules as interim solutions. 3Code Implementation and Optimization Issues: Data mined from developer conversations also highlight challenges in code implementation and optimization, including build and dependency management. The online discussions complement the literature (e.g., [ 8 , 27 ]) which often talks about the lack of mature toolsets for new technologies, emphasizing that Wasm development is still in its infancy stage [ 19 , 25 ]. Although academic discourse may emphasize the computational efficiency of Wasm, it seems to overlook the practical aspects of code implementation and optimization, an area clearly fraught with challenges according to GitHub and SO data. Implications : Researchers could aim to develop better tools for Wasm development, possibly in collaboration with industry stakeholders, to address the implementation challenges. Practitioners could consider incorporating emerging best practices and tools as they become available, staying up-to-date through both academic and community channels. 4.2 Causes of Wasm Issues 4 Diversity in Language Compilation: We find the diversity in language compilation to Wasm is causing significant discrepancies and anomalies in the resultant applications, creating inconsistencies in application behavior and functionality. This issue is consistent 177