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

Double free when running appstream-generator #255

Closed
antonio-rojas opened this issue Sep 24, 2019 · 3 comments
Closed

Double free when running appstream-generator #255

antonio-rojas opened this issue Sep 24, 2019 · 3 comments

Comments

@antonio-rojas
Copy link
Contributor

With both AS 0.12.8 + asgen 0.7.7 and AS 0.12.9 + asgen 0.8.0

#0  0x00007f08599da755 in raise () at /usr/lib/libc.so.6
#1  0x00007f08599c5851 in abort () at /usr/lib/libc.so.6
#2  0x00007f0859a1ca38 in __libc_message () at /usr/lib/libc.so.6
#3  0x00007f0859a2325a in  () at /usr/lib/libc.so.6
#4  0x00007f0859a24c1d in _int_free () at /usr/lib/libc.so.6
#5  0x00007f085b177d88 in g_autoptr_cleanup_generic_gfree (p=0x7ee85492b108) at /usr/include/glib-2.0/glib/glib-autocleanups.h:28
#6  0x00007f085b177d88 in as_xml_dump_node_content (node=node@entry=0x7ee82c0df220) at ../AppStream-0.12.9/src/as-xml.c:120
#7  0x00007f085b178249 in as_xml_parse_metainfo_description_node
    (ctx=ctx@entry=0x5646c4e332e0, node=node@entry=0x7ee82c0ded40, func=func@entry=0x7f085b1863a0 <as_xml_metainfo_description_to_cpt>, entity=entity@entry=0x5646c4da2880) at ../AppStream-0.12.9/src/as-xml.c:374
#8  0x00007f085b188f9c in as_component_load_from_xml
    (cpt=cpt@entry=0x5646c4da2880, ctx=ctx@entry=0x5646c4e332e0, node=node@entry=0x7ee82c033e00, error=error@entry=0x7ee85492b2e8)
    at ../AppStream-0.12.9/src/as-component.c:3651
#9  0x00007f085b183b05 in as_metadata_parse (metad=<optimized out>, data=<optimized out>, format=<optimized out>, error=0x7ee85492b2e8)
    at ../AppStream-0.12.9/src/as-metadata.c:531
#10 0x00005646c3103b1e in _D9appstream8MetadataQj5parseMFAyaEQBh1c5types12AsFormatKindZv ()
#11 0x00005646c307ce23 in _D5asgen8handlers14metainfoparser17parseMetaInfoDataFC9appstream8MetadataQjCQCw6result15GeneratorResultxAyaxQeZCQCg9ComponentQk
    ()
#12 0x00005646c2ff77d9 in _D5asgen9extractor13DataExtractor14processPackageMFCQBy8backends10interfaces7PackageZCQDg6result15GeneratorResult ()
#13 0x00005646c2fc7e3d in _D5asgen6engine6Engine15processPackagesMFKACQBq8backends10interfaces7PackageCQCx8handlers11iconhandler11IconHandlerZ14__foreachbody3MFKQDoZi ()
#14 0x00005646c2fd3316 in _D3std11parallelism__T15ParallelForeachTAC5asgen8backends10interfaces7PackageZQCe7opApplyMFMDFKQCcZiZ4doItMFZv ()
#15 0x00007f085ae497c1 in _D3std11parallelism8TaskPool5doJobMFPSQBkQBj12AbstractTaskZv () at /home/arojas/appstream/libphobos2-ldc-shared.so.2.0.87
#16 0x00007f085ae4995b in std.parallelism.TaskPool.startWorkLoop() () at /home/arojas/appstream/libphobos2-ldc-shared.so.2.0.87
#17 0x00007f085b0da03c in thread_entryPoint () at /home/arojas/appstream/libdruntime-ldc-shared.so.2.0.87
#18 0x00007f0859b8857f in start_thread () at /usr/lib/libpthread.so.0
#19 0x00007f0859a9c0e3 in clone () at /usr/lib/libc.so.6
@ximion ximion closed this as completed in da9f330 Sep 24, 2019
@ximion
Copy link
Owner

ximion commented Sep 24, 2019

This should be fixed now, thanks for the very useful backtrace!
I do wonder how the faultry code was reached in the first place... Can you by any chance figure out which component/XML/package has produced this particular crash? (maybe by the package name printed to stdout?)

@antonio-rojas
Copy link
Contributor Author

Thank you for the quick fix. The bogus package is pluma
https://www.archlinux.org/packages/community/x86_64/pluma/download/

@ximion
Copy link
Owner

ximion commented Sep 25, 2019

Nice, thank you very much!
This confirms that the culprit was indeed an empty <p/> tag.
Also, that metainfo file is so bad, it has never seen a validator. Throws 51 validation errors and 5 warnings here. I also wonder why the description tag itself is translated, that shouldn't happen.
I can use this to maybe improve the validator a bit :-)

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