Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when url is data URI #561

Closed
2 tasks done
bbhtt opened this issue Sep 16, 2023 · 4 comments
Closed
2 tasks done

Crash when url is data URI #561

bbhtt opened this issue Sep 16, 2023 · 4 comments

Comments

@bbhtt
Copy link
Contributor

bbhtt commented Sep 16, 2023

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

flatpak-builder version

1.3.3

Flatpak version

Flatpak 1.15.4

How to reproduce

flatpak-builder build --force-clean test.json

{
    "id": "org.example.test",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "22.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "echo",
    "finish-args": [
        "--share=ipc"
    ],
    "modules": [
        {
            "name": "test",
            "buildsystem": "simple",
            "sources": [
                {
                    "type": "file",
                    "dest-filename": "test",
                    "url": "data:xyz"
                }
            ]
        }
    ]
}

Expected Behavior

It shouldn't crash. It should print out that data: is not supported and exit.

Actual Behavior

Crashes

Additional Information

warning: Section `.reg-xstate/19484' in core file too small.
#0  0x00007ff049d97b8f in g_log_structured_array () from /lib64/libglib-2.0.so.0
[Current thread is 1 (Thread 0x7ff048688940 (LWP 19484))]
(gdb) bt
#0  0x00007ff049d97b8f in g_log_structured_array () at /lib64/libglib-2.0.so.0
#1  0x00007ff049d97e7c in g_log_default_handler () at /lib64/libglib-2.0.so.0
#2  0x00007ff049d98120 in g_logv () at /lib64/libglib-2.0.so.0
#3  0x00007ff049d98403 in g_log () at /lib64/libglib-2.0.so.0
#4  0x0000558a77d05895 in builder_manifest_deserialize_property
    (serializable=<optimized out>, property_name=<optimized out>, value=0x7ffdb22cef60, pspec=<optimized out>, property_node=<optimized out>)
    at ../src/builder-manifest.c:1255
#5  0x00007ff049aecc06 in json_gobject_new (gtype=Python Exception <class 'gdb.error'>: No type named TypeNode.
, object=0x7ff034000cc0) at ../json-glib/json-gobject.c:296
#6  0x00007ff049aecdc8 in json_gobject_deserialize (gtype=<optimized out>, node=<optimized out>) at ../json-glib/json-gobject.c:805
#7  0x0000558a77d23734 in builder_gobject_from_data (gtype=Python Exception <class 'gdb.error'>: No type named TypeNode.
, relpath=<optimized out>, contents=<optimized out>, error=0x7ffdb22cf120)
    at ../src/builder-utils.c:542
#8  0x0000558a77cf1d2f in main (argc=<optimized out>, argv=<optimized out>) at ../src/builder-manifest.c:120

The invalid url is being generated by https://github.com/flatpak/flatpak-builder-tools/blob/30db60f6a086ed0457b774cc0dc7fa11b9045fcf/npm/flatpak-npm-generator.py#L189 due to it being obsolete. But still I don't think builder should crash here.

@TingPing
Copy link
Member

TingPing commented Sep 18, 2023

I can't reproduce in git master:

> ./flatpak-builder _build ./test.json --force-clean
Emptying app dir '_build'
Downloading sources
Starting build of org.example.test
Cache miss, checking out last cache hit
========================================================================
Building module test in /home/tingping/Projects/flatpak-builder/.flatpak-builder/build/test-4
========================================================================
Error: module test: URL using bad/illegal format or missing URL

I did find a related error though: #562

@TingPing
Copy link
Member

TingPing commented Sep 18, 2023

Turns out download_data_uri() is completely broken so I'll look into fixing that.

@TingPing
Copy link
Member

See also: #563

@bbhtt
Copy link
Contributor Author

bbhtt commented Oct 21, 2023

I think this is fixed considering above is merged, closing. Thanks.

@bbhtt bbhtt closed this as completed Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants