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

Segfault when generating Arch metadata #46

Closed
antonio-rojas opened this issue Jul 10, 2017 · 13 comments
Closed

Segfault when generating Arch metadata #46

antonio-rojas opened this issue Jul 10, 2017 · 13 comments

Comments

@antonio-rojas
Copy link
Contributor

antonio-rojas commented Jul 10, 2017

Getting a new segfault with 0.6.5

Core was generated by `appstream-generator process arch'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f268dfed1a5 in g_string_new () from /usr/lib/libglib-2.0.so.0
[Current thread is 1 (Thread 0x7f0673206700 (LWP 6903))]
(gdb) 
(gdb) bt
#0  0x00007f268dfed1a5 in g_string_new () at /usr/lib/libglib-2.0.so.0
#1  0x00007f268d762628 in  () at /usr/lib/libappstream.so.4
#2  0x00007f268a47ee96 in  () at /usr/lib/libxml2.so.2
#3  0x00007f268a480635 in __xmlRaiseError () at /usr/lib/libxml2.so.2
#4  0x00007f268a484064 in  () at /usr/lib/libxml2.so.2
#5  0x00007f268a48aabe in xmlParseEntityRef () at /usr/lib/libxml2.so.2
#6  0x00007f268a497542 in xmlParseReference () at /usr/lib/libxml2.so.2
#7  0x00007f268a498060 in xmlParseContent () at /usr/lib/libxml2.so.2
#8  0x00007f268a498a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#9  0x00007f268a49804f in xmlParseContent () at /usr/lib/libxml2.so.2
#10 0x00007f268a498a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#11 0x00007f268a49913b in xmlParseDocument () at /usr/lib/libxml2.so.2
#12 0x00007f268a499597 in  () at /usr/lib/libxml2.so.2
#13 0x00007f268d762ddf in  () at /usr/lib/libappstream.so.4
#14 0x00007f268d76fc61 in  () at /usr/lib/libappstream.so.4
#15 0x00007f268d76b5a8 in as_metadata_components_to_collection () at /usr/lib/libappstream.so.4
#16 0x000000000093d8cd in appstream.Metadata.Metadata.componentsToCollection(appstream.c.types.AsFormatKind) (this=0x7f268e3588c0, format=<incomplete type>) at /build/appstream-generator/src/build/girepo/appstream/Metadata.d:168
#17 0x00000000006e9fba in asgen.datastore.DataStore.addGeneratorResult(asgen.config.DataType, asgen.result.GeneratorResult) (this=0x7f268e355800, gres=0x7f063fb32c00, dtype=<incomplete type>) at ../appstream-generator-0.6.5/src/asgen/datastore.d:343
#18 0x0000000000709d2f in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f06758377a0: 0x7f067d95b000) at ../appstream-generator-0.6.5/src/asgen/engine.d:139
#19 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#20 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#21 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#22 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#23 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#24 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#25 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
---Type <return> to continue, or q <return> to quit---
#26 0x0000000000a072ae in core.thread.Thread.run() ()
#27 0x0000000000a070d1 in thread_entryPoint ()
#28 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#29 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6
(gdb) thread apply all bt

Thread 8 (Thread 0x7f0672204700 (LWP 6906)):
#0  0x00007f268b58bfbd in read () at /usr/lib/libc.so.6
#1  0x00007f268b522598 in __GI__IO_file_underflow () at /usr/lib/libc.so.6
#2  0x00007f268b521608 in __GI__IO_file_xsgetn () at /usr/lib/libc.so.6
#3  0x00007f268b515eb1 in fread () at /usr/lib/libc.so.6
#4  0x00000000006ae9a6 in std.stdio.trustedFread!(ubyte).trustedFread(shared(core.stdc.stdio._IO_FILE)*, ubyte[]) (obj=..., f=0x7f06543cf530)
    at /usr/include/dlang/dmd/std/stdio.d:4055
#5  0x00000000006ae8e1 in std.stdio.File.rawRead!(ubyte).rawRead(ubyte[]) (this=..., buffer=...) at /usr/include/dlang/dmd/std/stdio.d:919
#6  0x00000000009b55aa in std.stdio.File.ByChunk.prime() ()
#7  0x00000000009b56dc in std.stdio.File.ByChunk.this(std.stdio.File, ubyte[]) ()
#8  0x00000000009b5616 in std.stdio.File.ByChunk.this(std.stdio.File, ulong) ()
#9  0x00000000009b58fe in std.stdio.File.byChunk(ulong) ()
#10 0x00000000009b3955 in std.process.executeImpl!(std.process.pipeProcess, const(char[])[]).executeImpl(const(char[])[], const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, const(char[])) ()
#11 0x00000000009b2fc1 in std.process.execute(const(char[][]), const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, const(char[])) ()
#12 0x00000000007c8144 in asgen.image.optimizePNG(immutable(char)[]) (fname=...) at /usr/include/dlang/dmd/std/process.d:2193
#13 0x00000000007c8961 in asgen.image.Image.savePng(immutable(char)[]) (this=0x7f0646d20740, fname=...)
    at ../appstream-generator-0.6.5/src/asgen/image.d:225
#14 0x000000000077b324 in asgen.handlers.iconhandler.IconHandler.storeIcon(appstream.Component.Component, asgen.result.GeneratorResult, immutable(char)[], asgen.backends.interfaces.Package, immutable(char)[], asgen.utils.ImageSize) (this=0x7ffe0bbe9340, size=..., iconPath=..., sourcePkg=0x7f067fc78b00, cptExportPath=..., gres=0x7f0646b14e00, cpt=0x7f0646b6d080) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:507
#15 0x000000000077bd3b in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component).findAndStoreXdgIcon(asgen.backends.interfaces.Package) (this=0x7f0672202608, epkg=0x7f067fc78b00) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:591
#16 0x000000000077b845 in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component) (this=0x7ffe0bbe9340, cpt=0x7f0646b6d080, gres=0x7f0646b14e00) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:633
#17 0x000000000072d972 in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f067fc78b00)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:267
#18 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675838e00: 0x7f067fc78b00) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
---Type <return> to continue, or q <return> to quit---
#19 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#20 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#21 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#22 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#23 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#24 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#25 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#26 0x0000000000a072ae in core.thread.Thread.run() ()
#27 0x0000000000a070d1 in thread_entryPoint ()
#28 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#29 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 7 (Thread 0x7f0672a05700 (LWP 6905)):
#0  0x00007f268b58bfbd in read () at /usr/lib/libc.so.6
#1  0x00007f268b522598 in __GI__IO_file_underflow () at /usr/lib/libc.so.6
#2  0x00007f268b521608 in __GI__IO_file_xsgetn () at /usr/lib/libc.so.6
#3  0x00007f268b515eb1 in fread () at /usr/lib/libc.so.6
#4  0x00000000006ae9a6 in std.stdio.trustedFread!(ubyte).trustedFread(shared(core.stdc.stdio._IO_FILE)*, ubyte[]) (obj=..., f=0x7f0660044da0)
    at /usr/include/dlang/dmd/std/stdio.d:4055
#5  0x00000000006ae8e1 in std.stdio.File.rawRead!(ubyte).rawRead(ubyte[]) (this=..., buffer=...) at /usr/include/dlang/dmd/std/stdio.d:919
#6  0x00000000009b55aa in std.stdio.File.ByChunk.prime() ()
#7  0x00000000009b56dc in std.stdio.File.ByChunk.this(std.stdio.File, ubyte[]) ()
#8  0x00000000009b5616 in std.stdio.File.ByChunk.this(std.stdio.File, ulong) ()
#9  0x00000000009b58fe in std.stdio.File.byChunk(ulong) ()
#10 0x00000000009b3955 in std.process.executeImpl!(std.process.pipeProcess, const(char[])[]).executeImpl(const(char[])[], const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, const(char[])) ()
#11 0x00000000009b2fc1 in std.process.execute(const(char[][]), const(immutable(char)[][immutable(char)[]]), std.process.Config, ulong, const(char[])) ()
#12 0x00000000007c8144 in asgen.image.optimizePNG(immutable(char)[]) (fname=...) at /usr/include/dlang/dmd/std/process.d:2193
#13 0x00000000007c8961 in asgen.image.Image.savePng(immutable(char)[]) (this=0x7f06467eee60, fname=...)
---Type <return> to continue, or q <return> to quit---
    at ../appstream-generator-0.6.5/src/asgen/image.d:225
#14 0x000000000079910a in asgen.handlers.screenshothandler.processScreenshot(asgen.result.GeneratorResult, appstream.Component.Component, appstream.Screenshot.Screenshot, immutable(char)[], uint) (scrNo=1, mediaExportDir=..., scr=0x7f063ffd2b80, cpt=0x7f063fb20f40, gres=0x7f063f9f2980)
    at ../appstream-generator-0.6.5/src/asgen/handlers/screenshothandler.d:123
#15 0x00000000007989f1 in asgen.handlers.screenshothandler.processScreenshots(asgen.result.GeneratorResult, appstream.Component.Component, immutable(char)[]) (mediaExportDir=..., cpt=0x7f063fb20f40, gres=0x7f063f9f2980) at ../appstream-generator-0.6.5/src/asgen/handlers/screenshothandler.d:52
#16 0x000000000072d9ec in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f067f0f5100)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:274
#17 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675837f08: 0x7f067f0f5100) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#18 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#19 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#20 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#21 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#22 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#23 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#24 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#25 0x0000000000a072ae in core.thread.Thread.run() ()
#26 0x0000000000a070d1 in thread_entryPoint ()
#27 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#28 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 6 (Thread 0x7f268e455800 (LWP 6901)):
#0  0x00007f268b59024d in poll () at /usr/lib/libc.so.6
#1  0x00007f067041e599 in  () at /usr/lib/libcurl.so
#2  0x00007f0670418ff2 in curl_multi_wait () at /usr/lib/libcurl.so
#3  0x00007f0670411750 in curl_easy_perform () at /usr/lib/libcurl.so
#4  0x00000000009c9680 in std.net.curl.Curl.perform(std.typecons.Flag!("throwOnError").Flag) ()
#5  0x00000000009c6994 in std.net.curl.HTTP.perform(std.typecons.Flag!("throwOnError").Flag) ()
---Type <return> to continue, or q <return> to quit---
#6  0x000000000079a7e1 in std.net.curl._basicHTTP!(ubyte)._basicHTTP(const(char)[], const(void)[], std.net.curl.HTTP) (client=..., sendData=..., url=...)
    at /usr/include/dlang/dmd/std/net/curl.d:1049
#7  0x000000000079a5fc in std.net.curl.get!(std.net.curl.HTTP, ubyte).get(const(char)[], std.net.curl.HTTP) (conn=..., url=...)
    at /usr/include/dlang/dmd/std/net/curl.d:540
#8  0x0000000000798d0b in asgen.handlers.screenshothandler.processScreenshot(asgen.result.GeneratorResult, appstream.Component.Component, appstream.Screenshot.Screenshot, immutable(char)[], uint) (scrNo=1, mediaExportDir=..., scr=0x7f0646846780, cpt=0x7f0645ecba40, gres=0x7f0645c42500)
    at ../appstream-generator-0.6.5/src/asgen/handlers/screenshothandler.d:98
#9  0x00000000007989f1 in asgen.handlers.screenshothandler.processScreenshots(asgen.result.GeneratorResult, appstream.Component.Component, immutable(char)[]) (mediaExportDir=..., cpt=0x7f0645ecba40, gres=0x7f0645c42500) at ../appstream-generator-0.6.5/src/asgen/handlers/screenshothandler.d:52
#10 0x000000000072d9ec in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f06768aab00)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:274
#11 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675838900: 0x7f06768aab00) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#12 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#13 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#14 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#15 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#16 0x00000000009b04ed in std.parallelism.submitAndExecute(std.parallelism.TaskPool, scope void() delegate) ()
#17 0x0000000000717e41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate) (this=..., dg=...) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3875
#18 0x0000000000709c3b in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler) (this=0x7f268e358840, iconh=0x7ffe0bbe9340, pkgs=...) at ../appstream-generator-0.6.5/src/asgen/engine.d:131
#19 0x000000000070c39d in asgen.engine.Engine.run(immutable(char)[]) (this=0x7f268e358840, suite_name=...)
    at ../appstream-generator-0.6.5/src/asgen/engine.d:517
#20 0x0000000000671eed in D main (args=...) at ../appstream-generator-0.6.5/src/app.d:119

Thread 5 (Thread 0x7f0671202700 (LWP 6908)):
#0  0x00007f2689509cc9 in  () at /usr/lib/liblzma.so.5
#1  0x00007f268950b622 in  () at /usr/lib/liblzma.so.5
---Type <return> to continue, or q <return> to quit---
#2  0x00007f2689502813 in  () at /usr/lib/liblzma.so.5
#3  0x00007f26894fd23b in  () at /usr/lib/liblzma.so.5
#4  0x00007f26894fed00 in  () at /usr/lib/liblzma.so.5
#5  0x00007f26894f67f1 in lzma_code () at /usr/lib/liblzma.so.5
#6  0x00007f268d2b6be7 in  () at /usr/lib/libarchive.so.13
#7  0x00007f268d2ab918 in __archive_read_filter_consume () at /usr/lib/libarchive.so.13
#8  0x00007f268d2d3372 in  () at /usr/lib/libarchive.so.13
#9  0x00007f268d2aaead in archive_read_data_skip () at /usr/lib/libarchive.so.13
#10 0x00000000006825c6 in asgen.zarchive.ArchiveDecompressor.readData(immutable(char)[]) (this=..., fname=...)
    at ../appstream-generator-0.6.5/src/asgen/zarchive.d:308
#11 0x0000000000883b33 in asgen.backends.archlinux.alpkg.ArchPackage.getFileData(immutable(char)[]) (this=0x7f268e3bf600, fname=...)
    at ../appstream-generator-0.6.5/src/asgen/backends/archlinux/alpkg.d:82
#12 0x000000000077abee in asgen.handlers.iconhandler.IconHandler.storeIcon(appstream.Component.Component, asgen.result.GeneratorResult, immutable(char)[], asgen.backends.interfaces.Package, immutable(char)[], asgen.utils.ImageSize) (this=0x7ffe0bbe9340, size=..., iconPath=..., sourcePkg=0x7f268e3bf600, cptExportPath=..., gres=0x7f063db12d00, cpt=0x7f063dfad380) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:462
#13 0x000000000077bd3b in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component).findAndStoreXdgIcon(asgen.backends.interfaces.Package) (this=0x7f0671200608, epkg=0x0) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:591
#14 0x000000000077b870 in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component) (this=0x7ffe0bbe9340, cpt=0x7f063dfad380, gres=0x7f063db12d00) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:636
#15 0x000000000072d972 in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f067dfc7600)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:267
#16 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675837dd0: 0x7f067dfc7600) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#17 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#18 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#19 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#20 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#21 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#22 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
---Type <return> to continue, or q <return> to quit---
#23 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#24 0x0000000000a072ae in core.thread.Thread.run() ()
#25 0x0000000000a070d1 in thread_entryPoint ()
#26 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#27 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 4 (Thread 0x7f0673a07700 (LWP 6902)):
#0  0x00007f2689507d30 in  () at /usr/lib/liblzma.so.5
#1  0x00007f268950b622 in  () at /usr/lib/liblzma.so.5
#2  0x00007f2689502813 in  () at /usr/lib/liblzma.so.5
#3  0x00007f26894fd23b in  () at /usr/lib/liblzma.so.5
#4  0x00007f26894fed00 in  () at /usr/lib/liblzma.so.5
#5  0x00007f26894f67f1 in lzma_code () at /usr/lib/liblzma.so.5
#6  0x00007f268d2b6be7 in  () at /usr/lib/libarchive.so.13
#7  0x00007f268d2ab918 in __archive_read_filter_consume () at /usr/lib/libarchive.so.13
#8  0x00007f268d2d3372 in  () at /usr/lib/libarchive.so.13
#9  0x00007f268d2aaead in archive_read_data_skip () at /usr/lib/libarchive.so.13
#10 0x00000000006825c6 in asgen.zarchive.ArchiveDecompressor.readData(immutable(char)[]) (this=..., fname=...)
    at ../appstream-generator-0.6.5/src/asgen/zarchive.d:308
#11 0x0000000000883b33 in asgen.backends.archlinux.alpkg.ArchPackage.getFileData(immutable(char)[]) (this=0x7f06763c8300, fname=...)
    at ../appstream-generator-0.6.5/src/asgen/backends/archlinux/alpkg.d:82
#12 0x000000000077abee in asgen.handlers.iconhandler.IconHandler.storeIcon(appstream.Component.Component, asgen.result.GeneratorResult, immutable(char)[], asgen.backends.interfaces.Package, immutable(char)[], asgen.utils.ImageSize) (this=0x7ffe0bbe9340, size=..., iconPath=..., sourcePkg=0x7f06763c8300, cptExportPath=..., gres=0x7f063d360d00, cpt=0x7f063e581e80) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:462
#13 0x000000000077bd3b in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component).findAndStoreXdgIcon(asgen.backends.interfaces.Package) (this=0x7f0673a05608, epkg=0x0) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:591
#14 0x000000000077b870 in asgen.handlers.iconhandler.IconHandler.process(asgen.result.GeneratorResult, appstream.Component.Component) (this=0x7ffe0bbe9340, cpt=0x7f063e581e80, gres=0x7f063d360d00) at ../appstream-generator-0.6.5/src/asgen/handlers/iconhandler.d:636
#15 0x000000000072d972 in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f06763c8300)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:267
---Type <return> to continue, or q <return> to quit---
#16 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f06758384c0: 0x7f06763c8300) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#17 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#18 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#19 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#20 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#21 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#22 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#23 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#24 0x0000000000a072ae in core.thread.Thread.run() ()
#25 0x0000000000a070d1 in thread_entryPoint ()
#26 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#27 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 3 (Thread 0x7f0671a03700 (LWP 6907)):
#0  0x00007f2689507871 in  () at /usr/lib/liblzma.so.5
#1  0x00007f268950b622 in  () at /usr/lib/liblzma.so.5
#2  0x00007f2689502813 in  () at /usr/lib/liblzma.so.5
#3  0x00007f26894fd23b in  () at /usr/lib/liblzma.so.5
#4  0x00007f26894fed00 in  () at /usr/lib/liblzma.so.5
#5  0x00007f26894f67f1 in lzma_code () at /usr/lib/liblzma.so.5
#6  0x00007f268d2b6be7 in  () at /usr/lib/libarchive.so.13
#7  0x00007f268d2ab918 in __archive_read_filter_consume () at /usr/lib/libarchive.so.13
#8  0x00007f268d2d3372 in  () at /usr/lib/libarchive.so.13
#9  0x00007f268d2aaead in archive_read_data_skip () at /usr/lib/libarchive.so.13
#10 0x00000000006825c6 in asgen.zarchive.ArchiveDecompressor.readData(immutable(char)[]) (this=..., fname=...)
    at ../appstream-generator-0.6.5/src/asgen/zarchive.d:308
#11 0x0000000000883b33 in asgen.backends.archlinux.alpkg.ArchPackage.getFileData(immutable(char)[]) (this=0x7f067efa0000, fname=...)
    at ../appstream-generator-0.6.5/src/asgen/backends/archlinux/alpkg.d:82
---Type <return> to continue, or q <return> to quit---
#12 0x000000000072d375 in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f067efa0000)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:198
#13 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675838318: 0x7f067efa0000) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#14 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#15 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#16 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#17 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#18 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#19 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#20 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#21 0x0000000000a072ae in core.thread.Thread.run() ()
#22 0x0000000000a070d1 in thread_entryPoint ()
#23 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#24 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 2 (Thread 0x7f066bfff700 (LWP 6904)):
#0  0x00007f2689507442 in  () at /usr/lib/liblzma.so.5
#1  0x00007f268950b622 in  () at /usr/lib/liblzma.so.5
#2  0x00007f2689502813 in  () at /usr/lib/liblzma.so.5
#3  0x00007f26894fd23b in  () at /usr/lib/liblzma.so.5
#4  0x00007f26894fed00 in  () at /usr/lib/liblzma.so.5
#5  0x00007f26894f67f1 in lzma_code () at /usr/lib/liblzma.so.5
#6  0x00007f268d2b6be7 in  () at /usr/lib/libarchive.so.13
#7  0x00007f268d2ab918 in __archive_read_filter_consume () at /usr/lib/libarchive.so.13
#8  0x00007f268d2d3372 in  () at /usr/lib/libarchive.so.13
#9  0x00007f268d2aaead in archive_read_data_skip () at /usr/lib/libarchive.so.13
#10 0x00000000006825c6 in asgen.zarchive.ArchiveDecompressor.readData(immutable(char)[]) (this=..., fname=...)
    at ../appstream-generator-0.6.5/src/asgen/zarchive.d:308
---Type <return> to continue, or q <return> to quit---
#11 0x0000000000883b33 in asgen.backends.archlinux.alpkg.ArchPackage.getFileData(immutable(char)[]) (this=0x7f067e49bd00, fname=...)
    at ../appstream-generator-0.6.5/src/asgen/backends/archlinux/alpkg.d:82
#12 0x000000000072d375 in asgen.extractor.DataExtractor.processPackage(asgen.backends.interfaces.Package) (this=0x7ffe0bbe90e8, pkg=0x7f067e49bd00)
    at ../appstream-generator-0.6.5/src/asgen/extractor.d:198
#13 0x0000000000709cf6 in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f0675838be8: 0x7f067e49bd00) at ../appstream-generator-0.6.5/src/asgen/engine.d:136
#14 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#15 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#16 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#17 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#18 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#19 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#20 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#21 0x0000000000a072ae in core.thread.Thread.run() ()
#22 0x0000000000a070d1 in thread_entryPoint ()
#23 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#24 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6

Thread 1 (Thread 0x7f0673206700 (LWP 6903)):
#0  0x00007f268dfed1a5 in g_string_new () at /usr/lib/libglib-2.0.so.0
#1  0x00007f268d762628 in  () at /usr/lib/libappstream.so.4
#2  0x00007f268a47ee96 in  () at /usr/lib/libxml2.so.2
#3  0x00007f268a480635 in __xmlRaiseError () at /usr/lib/libxml2.so.2
#4  0x00007f268a484064 in  () at /usr/lib/libxml2.so.2
#5  0x00007f268a48aabe in xmlParseEntityRef () at /usr/lib/libxml2.so.2
#6  0x00007f268a497542 in xmlParseReference () at /usr/lib/libxml2.so.2
#7  0x00007f268a498060 in xmlParseContent () at /usr/lib/libxml2.so.2
#8  0x00007f268a498a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#9  0x00007f268a49804f in xmlParseContent () at /usr/lib/libxml2.so.2
---Type <return> to continue, or q <return> to quit---
#10 0x00007f268a498a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#11 0x00007f268a49913b in xmlParseDocument () at /usr/lib/libxml2.so.2
#12 0x00007f268a499597 in  () at /usr/lib/libxml2.so.2
#13 0x00007f268d762ddf in  () at /usr/lib/libappstream.so.4
#14 0x00007f268d76fc61 in  () at /usr/lib/libappstream.so.4
#15 0x00007f268d76b5a8 in as_metadata_components_to_collection () at /usr/lib/libappstream.so.4
#16 0x000000000093d8cd in appstream.Metadata.Metadata.componentsToCollection(appstream.c.types.AsFormatKind) (this=0x7f268e3588c0, format=<incomplete type>) at /build/appstream-generator/src/build/girepo/appstream/Metadata.d:168
#17 0x00000000006e9fba in asgen.datastore.DataStore.addGeneratorResult(asgen.config.DataType, asgen.result.GeneratorResult) (this=0x7f268e355800, gres=0x7f063fb32c00, dtype=<incomplete type>) at ../appstream-generator-0.6.5/src/asgen/datastore.d:343
#18 0x0000000000709d2f in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(ref asgen.backends.interfaces.Package) (this=0x7ffe0bbe9180, pkg=@0x7f06758377a0: 0x7f067d95b000) at ../appstream-generator-0.6.5/src/asgen/engine.d:139
#19 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe0bbe90b0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#20 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#21 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#22 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#23 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#24 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#25 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#26 0x0000000000a072ae in core.thread.Thread.run() ()
#27 0x0000000000a070d1 in thread_entryPoint ()
#28 0x00007f268c18e297 in start_thread () at /usr/lib/libpthread.so.0
#29 0x00007f268b59a1ef in clone () at /usr/lib/libc.so.6
@antonio-rojas
Copy link
Contributor Author

lyx seems to be the package triggering this (hard to tell with multithreading, but I tried 3 times and it was the one package being processed every time when the segfault happened)

https://www.archlinux.org/packages/extra/x86_64/lyx/

@ximion
Copy link
Owner

ximion commented Jul 10, 2017

Which version of AppStream do you use? I assume the latest one? (0.11.1)
This appears to be a bug in AS itself, I might find some time to fix that today.
Can you please reproduce this bug with debug symbols for AppStream installed as well? That would be incredibly helpful!

@antonio-rojas
Copy link
Contributor Author

Yes, 0.11.1. Do you need a backtrace with AS symbols?

@ximion
Copy link
Owner

ximion commented Jul 10, 2017

Yes, 0.11.1. Do you need a backtrace with AS symbols?

Yes :D I edited my previous comment with a note on that in the second you wrote your reply :D

@antonio-rojas
Copy link
Contributor Author

Here you go. It was lyx indeed

Core was generated by `appstream-generator process arch'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f9a20f8d1a5 in g_string_new () from /usr/lib/libglib-2.0.so.0
[Current thread is 1 (Thread 0x7f79fd9b2700 (LWP 8523))]
(gdb) bt
#0  0x00007f9a20f8d1a5 in g_string_new () at /usr/lib/libglib-2.0.so.0
#1  0x00007f9a2070132a in libxml_generic_error (error_str_ptr=<optimized out>, format=0x7f9a1d4febce "Entity: line %d: ")
    at /build/appstream/src/AppStream-0.11.1/src/as-xml.c:506
#2  0x00007f9a1d41fe96 in  () at /usr/lib/libxml2.so.2
#3  0x00007f9a1d421635 in __xmlRaiseError () at /usr/lib/libxml2.so.2
#4  0x00007f9a1d425064 in  () at /usr/lib/libxml2.so.2
#5  0x00007f9a1d42babe in xmlParseEntityRef () at /usr/lib/libxml2.so.2
#6  0x00007f9a1d438542 in xmlParseReference () at /usr/lib/libxml2.so.2
#7  0x00007f9a1d439060 in xmlParseContent () at /usr/lib/libxml2.so.2
#8  0x00007f9a1d439a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#9  0x00007f9a1d43904f in xmlParseContent () at /usr/lib/libxml2.so.2
#10 0x00007f9a1d439a33 in xmlParseElement () at /usr/lib/libxml2.so.2
#11 0x00007f9a1d43a13b in xmlParseDocument () at /usr/lib/libxml2.so.2
#12 0x00007f9a1d43a597 in  () at /usr/lib/libxml2.so.2
#13 0x00007f9a20701b12 in as_xml_add_description_node_helper (lang=0x7f79f025aec0 "C", description_markup=0x7f79f025ae70 "<p>An advanced WYSIWYM document processor & LaTeX front-end</p>", desc_node=<synthetic pointer>, root=0x7f79f025aff0, ctx=0x1dff220)
    at /build/appstream/src/AppStream-0.11.1/src/as-xml.c:278
#14 0x00007f9a20701b12 in as_xml_add_description_node (ctx=ctx@entry=0x1dff220, root=root@entry=0x7f79f025aff0, desc_table=<optimized out>)
    at /build/appstream/src/AppStream-0.11.1/src/as-xml.c:370
#15 0x00007f9a2070f175 in as_component_to_xml_node (cpt=0x7f79f80fefa0, ctx=ctx@entry=0x1dff220, root=root@entry=0x0)
    at /build/appstream/src/AppStream-0.11.1/src/as-component.c:3793
#16 0x00007f9a2070a872 in as_metadata_xml_serialize_to_collection_without_rootnode (metad=<optimized out>, cpts=<optimized out>, context=0x1dff220)
    at /build/appstream/src/AppStream-0.11.1/src/as-metadata.c:888
#17 0x00007f9a2070a872 in as_metadata_components_to_collection (metad=<optimized out>, format=<optimized out>, error=<optimized out>)
    at /build/appstream/src/AppStream-0.11.1/src/as-metadata.c:1054
#18 0x000000000093d8cd in appstream.Metadata.Metadata.componentsToCollection(appstream.c.types.AsFormatKind) (this=0x7f9a212f88c0, format=<incomplete type>) at /build/appstream-generator/src/build/girepo/appstream/Metadata.d:168
#19 0x00000000006e9fba in asgen.datastore.DataStore.addGeneratorResult(asgen.config.DataType, asgen.result.GeneratorResult) (this=0x7f9a212f5800, gres=0x7f69de962e00, dtype=<incomplete type>) at ../appstream-generator-0.6.5/src/asgen/datastore.d:343
#20 0x0000000000709d2f in asgen.engine.Engine.processPackages(asgen.backends.interfaces.Package[], asgen.handlers.iconhandler.IconHandler).__foreachbody3(---Type <return> to continue, or q <return> to quit---
ref asgen.backends.interfaces.Package) (this=0x7ffe5b72daa0, pkg=@0x7f7a087d87a0: 0x7f7a0d3e4e00) at ../appstream-generator-0.6.5/src/asgen/engine.d:139
#21 0x0000000000717f41 in std.parallelism.ParallelForeach!(asgen.backends.interfaces.Package[]).ParallelForeach.opApply(scope int(ref asgen.backends.interfaces.Package) delegate).doIt() (this=0x7ffe5b72d9d0) at /usr/include/dlang/dmd/std/parallelism.d-mixin-3823:3869
#22 0x00000000009b0cb4 in std.parallelism.run!(void() delegate).run(void() delegate) ()
#23 0x00000000009b0814 in std.parallelism.Task!(std.parallelism.run, void() delegate).Task.impl(void*) ()
#24 0x00000000009fc77b in std.parallelism.AbstractTask.job() ()
#25 0x00000000009af55c in std.parallelism.TaskPool.doJob(std.parallelism.AbstractTask*) ()
#26 0x00000000009af6b2 in std.parallelism.TaskPool.executeWorkLoop() ()
#27 0x00000000009af65a in std.parallelism.TaskPool.startWorkLoop() ()
#28 0x0000000000a072ae in core.thread.Thread.run() ()
#29 0x0000000000a070d1 in thread_entryPoint ()
#30 0x00007f9a1f12f297 in start_thread () at /usr/lib/libpthread.so.0
#31 0x00007f9a1e53b1ef in clone () at /usr/lib/libc.so.6

@ximion
Copy link
Owner

ximion commented Jul 10, 2017

Can you please test if the attached patch really resolves this issue?
I could not reproduce the problem with the LyX data here, and I actually think LyX isn't to blame here...

Also, if it works (I am rather confident that it will work...), can you look for any warning messages in the asgen output regarding XML serialization issues?

@antonio-rojas
Copy link
Contributor Author

Confirmed fixed. There are no warnings in the output besides some "Package has no file list" which have been there forever.

@ximion
Copy link
Owner

ximion commented Jul 10, 2017

Okay, that's great! :-)
Thank you for the bug report, and there will be an AppStream release soonish (maybe one or two weeks).

@antonio-rojas
Copy link
Contributor Author

Actually I just realized there is a parser error related to lyx in the output (it's not labeled as WARNING so I didn't notice before):

Entity: line 1: parser error : xmlParseEntityRef: no name

An advanced WYSIWYM document processor & LaTeX front-end


^

@ximion
Copy link
Owner

ximion commented Jul 19, 2017

@antonio-rojas Hah! I don't know for sure, but I would bet the & is the problem here... I wonder why this isn't escaped properly, I'll look into it.

@antonio-rojas
Copy link
Contributor Author

Yes, the ^ is pointing to the &, the github editor messed up the formatting

ximion added a commit that referenced this issue Jul 19, 2017
@ximion
Copy link
Owner

ximion commented Jul 19, 2017

Yes, the ^ is pointing to the &, the github editor messed up the formatting

Use a code-fence for that, like so:

`-``
My code here
`-``

(Remove the dash so you get ``` only)

@ximion
Copy link
Owner

ximion commented Jul 19, 2017

In related news, I think this is fixed now.

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