Re: [Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-27 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
---+--
 Reporter:  tapanpandita   |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  GIS|  Version:  1.9
 Severity:  Normal |   Resolution:  needsinfo
 Keywords:  libgeos geodjango  | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => needsinfo


--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.8489d836d3146f58a3631691fd3e4ef2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-26 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
---+--
 Reporter:  tapanpandita   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  GIS|  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords:  libgeos geodjango  | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by timgraham):

 Also reported on [https://groups.google.com/d/topic/django-
 users/zfqG7ZR3rQE/discussion django-users].

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.cc9bc8adc50ea3ec94caac89352a24f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-26 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
---+--
 Reporter:  tapanpandita   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  GIS|  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords:  libgeos geodjango  | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by timgraham):

 Can you provide a minimal project to reproduce the crash?

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.17bd80beefe3850f99de9133380092f9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-25 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
---+--
 Reporter:  tapanpandita   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  GIS|  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords:  libgeos geodjango  | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Description changed by tapanpandita:

Old description:

> I am running django 1.9.6 on gunicorn 19.5 with the gevent worker
> (gevent==1.1.1, greenlet==0.4.9). My app is deployed on heroku. For some
> requests, I have noticed this error: `*** Error in
> '/app/.heroku/python/bin/python': double free or corruption (out):
> 0x0403bc90 ***`
>
> This is the command I'm using to start gunicorn: `gunicorn
> api.wsgi:application -b 0.0.0.0:$PORT -c config/gunicorn.py` and this is
> my gunicorn config:
> {{{#!python
> from os import environ
>

> workers = environ.get('GUNICORN_NUM_WORKERS', 2)
> max_requests = environ.get('GUNICORN_MAX_REQUESTS', 0)
> worker_class = environ.get(
> 'GUNICORN_WORKER_CLASS', 'gevent
> )
> loglevel = environ.get('GUNICORN_LOG_LEVEL', 'info')
> preload = False
> timeout = 20
> accesslog = '-'
> errorlog = '-'
> access_log_format = ('%({X-Forwarded-For}i)s %(l)s %(u)s %(t)s "%(r)s"
> %(s)s'
>  ' %(b)s "%(f)s" "%(a)s" %(D)s')
>

> def post_fork(server, worker):
> from psycogreen.gevent import patch_psycopg
> patch_psycopg()
> server.log.info('Worker spawned (pid: %s)', worker.pid)
>

> def pre_exec(server):
> server.log.info('Forked child, re-executing.')
>

> def when_ready(server):
> server.log.info('Server is ready. Spawning workers')
> }}}
>
> I  set the MALLOC_CHECK_ environment variable to 3. Here is the backtrace
> and the memory map that I got. I can't really make much sense of it but
> it looks like the crash happens when libgeos tries to free memory. I can
> reproduce it consistently with the gevent worker and everything works
> fine with the sync worker.
>
> {{{#!python
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/newrelic-2.64.0.48/newrelic/api/function_trace.py", line 98, in
> dynamic_wrapper
> return wrapped(*args, **kwargs)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 197, in _render
> return self.nodelist.render(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 992, in render
> bit = node.render_annotated(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 959, in render_annotated
> return self.render(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/defaulttags.py", line 220, in render
> nodelist.append(node.render_annotated(context))
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 743, in resolve
> return obj
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 862, in resolve
> return value
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 935, in _resolve_lookup
> return current
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 503, in iter_options
> cutoff_text=self.html_cutoff_text
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 497, in grouped_choices
> return self.choices
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 493, in choices
> return self.child_relation.choices
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/geometry.py", line 125, in __del__
> capi.destroy_geom(self._ptr)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/libgeos.py", line 157, in __call__
> return self.func(*args, **kwargs)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/prototypes/threadsafe.py", line 56, in
> __call__
> return self.cfunc(self.thread_context.handle.ptr, *args)
>
> *** Error in `/app/.heroku/python/bin/python': free(): invalid pointer:
> 0x0346c530 ***
> === Backtrace: =
> /lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f51ab67f38f]
> /lib/x86_64-linux-gnu/libc.so.6(+0x81fb6)[0x7f51ab68dfb6]
> /app/.heroku/vendor/lib/libgeos_c.so.1(GEOSGeom_destroy_r+0x12)[0x7f5193706572]
> /app/.heroku/python/lib/python2.7/lib-
> dynload/_ctypes.so(ffi_call_u

Re: [Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-25 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
---+--
 Reporter:  tapanpandita   |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  GIS|  Version:  1.9
 Severity:  Normal |   Resolution:
 Keywords:  libgeos geodjango  | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by tapanpandita):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Old description:

> I am running django 1.9.6 on gunicorn 19.5 with the gevent worker
> (gevent==1.1.1, greenlet==0.4.9). My app is deployed on heroku. For some
> requests, I have noticed this error: `*** Error in
> '/app/.heroku/python/bin/python': double free or corruption (out):
> 0x0403bc90 ***`
>
> This is the command I'm using to start gunicorn: `gunicorn
> hypertrackapi.wsgi:application -b 0.0.0.0:$PORT -c config/gunicorn.py`
> and this is my gunicorn config:
> {{{#!python
> from os import environ
>

> workers = environ.get('GUNICORN_NUM_WORKERS', 2)
> max_requests = environ.get('GUNICORN_MAX_REQUESTS', 0)
> worker_class = environ.get(
> 'GUNICORN_WORKER_CLASS', 'gevent
> )
> loglevel = environ.get('GUNICORN_LOG_LEVEL', 'info')
> preload = False
> timeout = 20
> accesslog = '-'
> errorlog = '-'
> access_log_format = ('%({X-Forwarded-For}i)s %(l)s %(u)s %(t)s "%(r)s"
> %(s)s'
>  ' %(b)s "%(f)s" "%(a)s" %(D)s')
>

> def post_fork(server, worker):
> from psycogreen.gevent import patch_psycopg
> patch_psycopg()
> server.log.info('Worker spawned (pid: %s)', worker.pid)
>

> def pre_exec(server):
> server.log.info('Forked child, re-executing.')
>

> def when_ready(server):
> server.log.info('Server is ready. Spawning workers')
> }}}
>
> I  set the MALLOC_CHECK_ environment variable to 3. Here is the backtrace
> and the memory map that I got. I can't really make much sense of it but
> it looks like the crash happens when libgeos tries to free memory. I can
> reproduce it consistently with the gevent worker and everything works
> fine with the sync worker.
>
> {{{#!python
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/newrelic-2.64.0.48/newrelic/api/function_trace.py", line 98, in
> dynamic_wrapper
> return wrapped(*args, **kwargs)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 197, in _render
> return self.nodelist.render(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 992, in render
> bit = node.render_annotated(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 959, in render_annotated
> return self.render(context)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/defaulttags.py", line 220, in render
> nodelist.append(node.render_annotated(context))
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 743, in resolve
> return obj
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 862, in resolve
> return value
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/template/base.py", line 935, in _resolve_lookup
> return current
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 503, in iter_options
> cutoff_text=self.html_cutoff_text
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 497, in grouped_choices
> return self.choices
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/rest_framework/relations.py", line 493, in choices
> return self.child_relation.choices
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/geometry.py", line 125, in __del__
> capi.destroy_geom(self._ptr)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/libgeos.py", line 157, in __call__
> return self.func(*args, **kwargs)
>   File "/app/.heroku/python/lib/python2.7/site-
> packages/django/contrib/gis/geos/prototypes/threadsafe.py", line 56, in
> __call__
> return self.cfunc(self.thread_context.handle.ptr, *args)
>
> *** Error in `/app/.heroku/python/bin/python': free(): invalid pointer:
> 0x0346c530 ***
> === Backtrace: =
> /lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f51ab67f38f]
> /lib/x86_64-linux-gnu/libc.so.6(+0x81fb6)[0x7f51ab68dfb6]
> /app/.heroku/vendor/lib/libgeos_c.so.1(GEOSGeom_destroy_r+0x12)[0x7f5193706

[Django] #26663: libgeos in django makes a gevent gunicorn worker crash

2016-05-25 Thread Django
#26663: libgeos in django makes a gevent gunicorn worker crash
--+---
 Reporter:  tapanpandita  |  Owner:  nobody
 Type:  Bug   | Status:  new
Component:  GIS   |Version:  1.9
 Severity:  Normal|   Keywords:  libgeos geodjango
 Triage Stage:  Unreviewed|  Has patch:  0
Easy pickings:  0 |  UI/UX:  0
--+---
 I am running django 1.9.6 on gunicorn 19.5 with the gevent worker
 (gevent==1.1.1, greenlet==0.4.9). My app is deployed on heroku. For some
 requests, I have noticed this error: `*** Error in
 '/app/.heroku/python/bin/python': double free or corruption (out):
 0x0403bc90 ***`

 This is the command I'm using to start gunicorn: `gunicorn
 hypertrackapi.wsgi:application -b 0.0.0.0:$PORT -c config/gunicorn.py` and
 this is my gunicorn config:
 {{{#!python
 from os import environ


 workers = environ.get('GUNICORN_NUM_WORKERS', 2)
 max_requests = environ.get('GUNICORN_MAX_REQUESTS', 0)
 worker_class = environ.get(
 'GUNICORN_WORKER_CLASS', 'gevent
 )
 loglevel = environ.get('GUNICORN_LOG_LEVEL', 'info')
 preload = False
 timeout = 20
 accesslog = '-'
 errorlog = '-'
 access_log_format = ('%({X-Forwarded-For}i)s %(l)s %(u)s %(t)s "%(r)s"
 %(s)s'
  ' %(b)s "%(f)s" "%(a)s" %(D)s')


 def post_fork(server, worker):
 from psycogreen.gevent import patch_psycopg
 patch_psycopg()
 server.log.info('Worker spawned (pid: %s)', worker.pid)


 def pre_exec(server):
 server.log.info('Forked child, re-executing.')


 def when_ready(server):
 server.log.info('Server is ready. Spawning workers')
 }}}

 I  set the MALLOC_CHECK_ environment variable to 3. Here is the backtrace
 and the memory map that I got. I can't really make much sense of it but it
 looks like the crash happens when libgeos tries to free memory. I can
 reproduce it consistently with the gevent worker and everything works fine
 with the sync worker.

 {{{#!python
   File "/app/.heroku/python/lib/python2.7/site-
 packages/newrelic-2.64.0.48/newrelic/api/function_trace.py", line 98, in
 dynamic_wrapper
 return wrapped(*args, **kwargs)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 197, in _render
 return self.nodelist.render(context)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 992, in render
 bit = node.render_annotated(context)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 959, in render_annotated
 return self.render(context)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/defaulttags.py", line 220, in render
 nodelist.append(node.render_annotated(context))
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 743, in resolve
 return obj
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 862, in resolve
 return value
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/template/base.py", line 935, in _resolve_lookup
 return current
   File "/app/.heroku/python/lib/python2.7/site-
 packages/rest_framework/relations.py", line 503, in iter_options
 cutoff_text=self.html_cutoff_text
   File "/app/.heroku/python/lib/python2.7/site-
 packages/rest_framework/relations.py", line 497, in grouped_choices
 return self.choices
   File "/app/.heroku/python/lib/python2.7/site-
 packages/rest_framework/relations.py", line 493, in choices
 return self.child_relation.choices
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/contrib/gis/geos/geometry.py", line 125, in __del__
 capi.destroy_geom(self._ptr)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/contrib/gis/geos/libgeos.py", line 157, in __call__
 return self.func(*args, **kwargs)
   File "/app/.heroku/python/lib/python2.7/site-
 packages/django/contrib/gis/geos/prototypes/threadsafe.py", line 56, in
 __call__
 return self.cfunc(self.thread_context.handle.ptr, *args)

 *** Error in `/app/.heroku/python/bin/python': free(): invalid pointer:
 0x0346c530 ***
 === Backtrace: =
 /lib/x86_64-linux-gnu/libc.so.6(+0x7338f)[0x7f51ab67f38f]
 /lib/x86_64-linux-gnu/libc.so.6(+0x81fb6)[0x7f51ab68dfb6]
 /app/.heroku/vendor/lib/libgeos_c.so.1(GEOSGeom_destroy_r+0x12)[0x7f5193706572]
 /app/.heroku/python/lib/python2.7/lib-
 dynload/_ctypes.so(ffi_call_unix64+0x4c)[0x7f51a7bae552]
 /app/.heroku/python/lib/python2.7/lib-
 dynload/_ctypes.so(ffi_call+0x1b0)[0x7f51a7bad600]
 /app/.heroku/python/lib/python2.7/lib-
 dynload/_ctypes.so(_ctypes_callproc+0x293)[0x7f51a7ba58a3]
 /app/.heroku/python/lib/python2.7/lib-
 dynload/_ctypes.so(+0x98b5)[0x7f51a7b9c8b5]
 /app/.heroku/python/bin/python(PyObject_Call+0x3a)[0x4230ba]
 /app/.heroku/python/bin/python(PyEva