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

Segmentation fault in "get_free_list () at arena.c:855" #25

Closed
iainlane opened this issue Sep 23, 2016 · 6 comments
Closed

Segmentation fault in "get_free_list () at arena.c:855" #25

iainlane opened this issue Sep 23, 2016 · 6 comments

Comments

@iainlane
Copy link
Collaborator

I think that's inside the libc.

A few of my asgen runs end when the generator segfaults :(.

Thread 355 (Thread 0x7fefcd7fa700 (LWP 12934)):
#0  get_free_list () at arena.c:855
#1  0x00007ffff54df58d in arena_get2 (avoid_arena=0x0, size=552) at arena.c:950
#2  __GI___libc_malloc (bytes=552) at malloc.c:2912
#3  0x00007ffff54c9c8d in __fopen_internal (filename=0x7ffff55eb11b "/etc/resolv.conf", mode=0x7ffff55e7f73 "rce",
    is32=1) at iofopen.c:69
#4  0x00007ffff54c9d2a in _IO_new_fopen (filename=<optimized out>, mode=<optimized out>) at iofopen.c:97
#5  0x00007ffff5582454 in __res_vinit (statp=0x7fefcd7fadb8, preinit=preinit@entry=0) at res_init.c:230
#6  0x00007ffff5582dd7 in __GI___res_ninit (statp=<optimized out>) at res_init.c:143
#7  0x00007ffff55841cd in __GI___res_maybe_init (resp=0x7fefcd7fadb8, preinit=preinit@entry=0) at res_libc.c:125
#8  0x00007ffff5546c08 in gaih_inet (name=name@entry=0x37aee40 "ftpmaster.internal", service=<optimized out>,
    req=req@entry=0x55c1090, pai=pai@entry=0x7fefcd7f8ca8, naddrs=naddrs@entry=0x7fefcd7f8ca4)
    at ../sysdeps/posix/getaddrinfo.c:819
#9  0x00007ffff554a4ae in __GI_getaddrinfo (name=<optimized out>, service=0x7fefcd7f8e40 "80", hints=0x55c1090,
    pai=0x7fefcd7f8df0) at ../sysdeps/posix/getaddrinfo.c:2417
#10 0x00007ffff7ba5887 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#11 0x00007ffff7bb06ca in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#12 0x00007ffff7bade5b in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#13 0x00007ffff5c4a6fa in start_thread (arg=0x7fefcd7fa700) at pthread_create.c:333
#14 0x00007ffff5562b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
Thread 354 (Thread 0x7fefce7fc700 (LWP 12930)):
#0  __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
#1  0x00007ffff54d99c4 in get_free_list () at arena.c:867
#2  0x00007ffff54df58d in arena_get2 (avoid_arena=0x0, size=552) at arena.c:950
#3  __GI___libc_malloc (bytes=552) at malloc.c:2912
#4  0x00007ffff54c9c8d in __fopen_internal (filename=0x7ffff55eb11b "/etc/resolv.conf", mode=0x7ffff55e7f73 "rce",
    is32=1) at iofopen.c:69
#5  0x00007ffff54c9d2a in _IO_new_fopen (filename=<optimized out>, mode=<optimized out>) at iofopen.c:97
#6  0x00007ffff5582454 in __res_vinit (statp=0x7fefce7fcdb8, preinit=preinit@entry=0) at res_init.c:230
#7  0x00007ffff5582dd7 in __GI___res_ninit (statp=<optimized out>) at res_init.c:143
#8  0x00007ffff55841cd in __GI___res_maybe_init (resp=0x7fefce7fcdb8, preinit=preinit@entry=0) at res_libc.c:125
#9  0x00007ffff5546c08 in gaih_inet (name=name@entry=0x37aee80 "ftpmaster.internal", service=<optimized out>,
    req=req@entry=0xa4c300, pai=pai@entry=0x7fefce7faca8, naddrs=naddrs@entry=0x7fefce7faca4)
    at ../sysdeps/posix/getaddrinfo.c:819
#10 0x00007ffff554a4ae in __GI_getaddrinfo (name=<optimized out>, service=0x7fefce7fae40 "80", hints=0xa4c300,
    pai=0x7fefce7fadf0) at ../sysdeps/posix/getaddrinfo.c:2417
#11 0x00007ffff7ba5887 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#12 0x00007ffff7bb06ca in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#13 0x00007ffff7bade5b in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#14 0x00007ffff5c4a6fa in start_thread (arg=0x7fefce7fc700) at pthread_create.c:333
#15 0x00007ffff5562b5d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

No debugging symbols for libcurl atm, sorry. But that's two threads in the same codepath.

I think it's called from this thread

Thread 1 (Thread 0x7ffff7fc87c0 (LWP 12527)):
#0  0x00007ffff5556e8d in poll () at ../sysdeps/unix/syscall-template.S:84
#1  0x00007ffff7ba2564 in ?? () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#2  0x00007ffff7b966ec in curl_easy_perform () from /usr/lib/x86_64-linux-gnu/libcurl-gnutls.so.4
#3  0x00000000005c288d in std.net.curl.Curl.perform(std.typecons.Flag!("throwOnError").Flag) (throwOnError=true,
    this=...) at ../../../../src/libphobos/src/std/net/curl.d:3808
#4  std.net.curl.HTTP.perform(std.typecons.Flag!("throwOnError").Flag) (this=...,
    throwOnError=throwOnError@entry=true) at ../../../../src/libphobos/src/std/net/curl.d:2280
#5  0x00000000004e4902 in utils.download(const(immutable(char)[]), ref std.stdio.File, const(uint)) (url=...,
    dest=..., retryCount=retryCount@entry=4) at source/utils.d:371
#6  0x00000000004e4a2f in utils.download(const(immutable(char)[]), ref std.stdio.File, const(uint)) (url=...,
    dest=..., retryCount=retryCount@entry=5) at source/utils.d:386
#7  0x00000000004e4ae3 in utils.getFileContents(const(immutable(char)[]), const(uint)) (path=...,
    retryCount=retryCount@entry=5) at source/utils.d:416
#8  0x00000000004e4ca7 in backends.debian.debpkgindex.DebianPackageIndex.findTranslations(const(immutable(char)[]), const(immutable(char)[])) (this=this@entry=0x7ffff7eced80, suite=..., section=...)
    at source/backends/debian/debpkgindex.d:78
#9  0x00000000004e6a26 in backends.debian.debpkgindex.DebianPackageIndex.loadPackageLongDescs(backends.debian.debpkg.DebPackage[immutable(char)[]], immutable(char)[], immutable(char)[]) (this=this@entry=0x7ffff7eced80, pkgs=...,
    suite=..., section=...) at source/backends/debian/debpkgindex.d:99
#10 0x00000000004e79cd in backends.debian.debpkgindex.DebianPackageIndex.loadPackages(immutable(char)[], immutable(char)[], immutable(char)[]) (this=0x7ffff7eced80, suite=..., section=..., arch=...)
    at source/backends/debian/debpkgindex.d:225
#11 0x00000000004e7b94 in backends.debian.debpkgindex.DebianPackageIndex.packagesFor(immutable(char)[], immutable(char)[], immutable(char)[]) (this=0x7ffff7eced80, suite=..., section=..., arch=...)
    at source/backends/debian/debpkgindex.d:234
#12 0x00000000004e7c89 in backends.ubuntu.ubupkgindex.UbuntuPackageIndex.packagesFor(immutable(char)[], immutable(char)[], immutable(char)[]) (this=0x7ffff7eced80, suite=..., section=..., arch=...)
    at source/backends/ubuntu/ubupkgindex.d:60
#13 0x00000000004ec834 in engine.Engine.seedContentsData(config.Suite, immutable(char)[], immutable(char)[]) (
    arch=..., section=..., suite=..., this=0x7ffff7ed07c0) at source/engine.d:177
#14 engine.Engine.run(immutable(char)[]) (this=<optimized out>, suite_name=...) at source/engine.d:481
#15 0x00000000004e45f0 in D main (args=...) at source/app.d:118

It looks like something is blowing up when trying to resolve a DNS name. curl is supposed to be thread safe, so hopefully it's not that. Any ideas?

@ximion
Copy link
Owner

ximion commented Sep 23, 2016

Wtf... Which version of curl are you using? I wonder if curl can't handle the DNS setup of that machine...
I'll try something when I'm home, but I think thread-safety is not the issue here (or should not be it, unless this is a curl bug...)

@iainlane
Copy link
Collaborator Author

It's what we have in xenial, so 7.47.0-1ubuntu2.1.

Hmm, I found https://sourceware.org/bugzilla/show_bug.cgi?id=10652 (comment #12) - I'll try rebuilding with -pthread and seeing if that reduces the crashes.

@ximion
Copy link
Owner

ximion commented Sep 23, 2016

That sounds promising!

@iainlane
Copy link
Collaborator Author

That didn't work, but FYI no crash or hang (#24) so far when built with ldc...

@ximion
Copy link
Owner

ximion commented Sep 27, 2016

Oho! If it stays that way, we are likely experiencing some bug in GDC or the ancient DRuntime/Phobos GDC is using.
In that case, I wonder if we should block compilations with non-LDC compilers. But let's see if it stays working :)

@ximion
Copy link
Owner

ximion commented Apr 20, 2017

I have never seen this, and apparently it also doesn't happen anymore... And since the code has evolved a lot since this was reported, I'll close the bug report. Please file a new one if this happens ever again (TBH, this looks like a GC bug that might have been fixed in GDC/DRuntime).

@ximion ximion closed this as completed Apr 20, 2017
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