Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • wayland wayland
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 149
    • Issues 149
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 58
    • Merge requests 58
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • waylandwayland
  • waylandwayland
  • Issues
  • #208
Closed
Open
Issue created May 14, 2021 by Pekka Paalanen@pqMaintainer

wayland-scanner does not handle <description> inside enum <entry>

wayland-protocols pointer-constraints-unstable-v1.xml and xdg-shell.xml contain <description> elements nested inside <entry> elements. wayland-scanner does not handle these. I suspect they also lead to ASan reporting:

==12170==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7fe5c6c75518 in calloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x564b714aa1c4 in zalloc ../../git/wayland/src/scanner.c:272
    #2 0x564b714aa1c4 in xzalloc ../../git/wayland/src/scanner.c:278
    #3 0x564b714aa1c4 in start_element ../../git/wayland/src/scanner.c:891
    #4 0x7fe5c6b5a679  (/lib/x86_64-linux-gnu/libexpat.so.1+0xb679)

Indirect leak of 390 byte(s) in 2 object(s) allocated from:
    #0 0x7fe5c6c75330 in __interceptor_malloc (/lib/x86_64-linux-gnu/libasan.so.5+0xe9330)
    #1 0x7fe5c6c3fd5d  (/lib/x86_64-linux-gnu/libasan.so.5+0xb3d5d)
    #2 0x564b714af075 in end_element ../../git/wayland/src/scanner.c:999
    #3 0x564b714af075 in end_element ../../git/wayland/src/scanner.c:989
    #4 0x7fe5c6b5aa15  (/lib/x86_64-linux-gnu/libexpat.so.1+0xba15)

Indirect leak of 71 byte(s) in 2 object(s) allocated from:
    #0 0x7fe5c6bc6810 in strdup (/lib/x86_64-linux-gnu/libasan.so.5+0x3a810)
    #1 0x564b714a6cbc in xstrdup ../../git/wayland/src/scanner.c:284
    #2 0x564b714aa1d9 in start_element ../../git/wayland/src/scanner.c:892
    #3 0x7fe5c6b5a679  (/lib/x86_64-linux-gnu/libexpat.so.1+0xb679)

I guess the test corpus in libwayland test suite does not contain any example of description inside entry, which is why !139 (merged) finds no problem.

But if I install ASan enabled libwayland and try to build Weston, the build fails with the above.

We'd need a test case in the suite, and decide what to do with those description tags, which I think are just ignored for now.

Looking at the DTD, it seems to allow description in many more places than what wayland-scanner supports.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking