Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

Segmentation faults

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


miroslav.sulc at startnet

Sep 15, 2009, 4:31 PM

Post #1 of 5 (430 views)
Permalink
Segmentation faults

hi,

i have issues running some pages of trac, they simply do not load (empty
page displays in browser). i found out in apache log that the cause is
segmentation fault. here are the pages that cause seg fault:
/browser
/ticket/1 (any number)
/changeset/349%3Afd2a05fbaab3 (any changeset)

i tried to run trac using tracd and found out it crashes with seg fault
too so imo it must by python/modules related. here is my setup:
gentoo linux
www-apps/trac-0.11.5
dev-lang/python-2.6.2-r1 (python expat version is 2.0.1)
dev-python/genshi-0.5.1
dev-python/pygments-1.1.1
dev-python/docutils-0.5
dev-python/pytz-2009j
dev-python/psycopg-2.0.11 (using postgresql database)
TracMercurial 0.11.0.7 (using mercurial repository)

i also tried to debug tracd but it seems i miss debug info in python and
did not find a way how to turn it on:
# gdb /usr/bin/python
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(no debugging symbols found)
(gdb) run /usr/bin/tracd --env-parent-dir=/var/lib/trac/ --port 8000
Starting program: /usr/bin/python /usr/bin/tracd
--env-parent-dir=/var/lib/trac/ --port 8000
(no debugging symbols found)
Executing new program: /usr/bin/python2.6
(no debugging symbols found)
(no debugging symbols found)
Server starting in PID 538.
Serving on 0.0.0.0:8000 view at http://127.0.0.1:8000/
[New LWP 548]

Program received signal SIGSEGV, Segmentation fault.
[Switching to LWP 548]
0x4e236136 in ?? ()
(gdb) bt
#0 0x4e236136 in ?? ()
#1 0x00000013 in ?? ()
#2 0x1625cbc0 in ?? ()
#3 0x16245320 in ?? ()
#4 0x4e23fc00 in ?? ()
#5 0x4df4d528 in ?? ()
#6 0x4df4d52c in ?? ()
#7 0x4e23fee0 in ?? ()
#8 0x1625cc20 in ?? ()
#9 0x00000000 in ?? ()

anyone has an idea why i get the segfaults and how to fix it? or at
least how to turn on debugging symbols for python so i could see the
cause in the stack?

thx for any help/suggestions.

miroslav

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


olemis at gmail

Sep 16, 2009, 5:09 AM

Post #2 of 5 (407 views)
Permalink
Re: Segmentation faults [In reply to]

2009/9/15 Miroslav Šulc <miroslav.sulc [at] startnet>:
>
> hi,
>
> i have issues running some pages of trac, they simply do not load (empty
> page displays in browser). i found out in apache log that the cause is
> segmentation fault. here are the pages that cause seg fault:
> /browser
> /ticket/1 (any number)
> /changeset/349%3Afd2a05fbaab3 (any changeset)
>
[...]
>
> i also tried to debug tracd but it seems i miss debug info in python and
> did not find a way how to turn it on:
>
> anyone has an idea why i get the segfaults and how to fix it? or at
> least how to turn on debugging symbols for python so i could see the
> cause in the stack?
>

try this one :

- Disable trac.versioncontrol.*
- Restart the server

The only cause why I've experienced segfauls with Trac is
py-svn-bindings. If the problem persists at least you know that you
should look somewhere else ;o)

Hint : You can debug Trac using PyDev + Eclipse ;o)

--
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
¿Quiénes somos realmente? -
http://feedproxy.google.com/~r/simelo-es/~3/qNYfwaHMEm0/quienes-somos-realmente.html

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


miroslav.sulc at startnet

Sep 16, 2009, 12:53 PM

Post #3 of 5 (405 views)
Permalink
Re: Segmentation faults [In reply to]

thx for answer, i tried what you suggest but the problem persists. i
also tried to compile python with -ggdb but that showed exactly the same
stack as without the debug flags so i'm not sure what's wrong. i am noob
wrt python and eclipse (i use netbeans) so i doubt i could manage to
debug trac remotely within short time and i cannot afford to spend on it
several hours or days.

miroslav

Olemis Lang napsal(a):
> 2009/9/15 Miroslav Šulc <miroslav.sulc [at] startnet>:
>
>> hi,
>>
>> i have issues running some pages of trac, they simply do not load (empty
>> page displays in browser). i found out in apache log that the cause is
>> segmentation fault. here are the pages that cause seg fault:
>> /browser
>> /ticket/1 (any number)
>> /changeset/349%3Afd2a05fbaab3 (any changeset)
>>
>>
> [...]
>
>> i also tried to debug tracd but it seems i miss debug info in python and
>> did not find a way how to turn it on:
>>
>> anyone has an idea why i get the segfaults and how to fix it? or at
>> least how to turn on debugging symbols for python so i could see the
>> cause in the stack?
>>
>>
>
> try this one :
>
> - Disable trac.versioncontrol.*
> - Restart the server
>
> The only cause why I've experienced segfauls with Trac is
> py-svn-bindings. If the problem persists at least you know that you
> should look somewhere else ;o)
>
> Hint : You can debug Trac using PyDev + Eclipse ;o)
>
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


miroslav.sulc at startnet

Sep 16, 2009, 2:24 PM

Post #4 of 5 (403 views)
Permalink
Re: Segmentation faults [In reply to]

i tried to debug the code through logging statements (while reloading
page /browser) and found out, that the problem is in web/chrome.py in method

def render_template(self, req, filename, data, content_type=None,
fragment=False):

on these lines (logging statements were added by me):

try:
buffer = cStringIO()
self.log.debug('stream.render')
stream.render(method, doctype=doctype, out=buffer)
self.log.debug('stream.render.done')
return buffer.getvalue().translate(_translate_nop,
_invalid_control_chars)
except Exception, e:
self.log.debug('here')
# restore what may be needed by the error template
req.chrome['links'] = links
req.chrome['scripts'] = scripts

log output is this (i added some other log statements to trac the path):

Trac[main] DEBUG: genshi
Trac[main] DEBUG: other
Trac[chrome] DEBUG: filename: browser.html method: xhtml
Trac[chrome] DEBUG: <MarkupTemplate "browser.html"> (this is output of
self.log.debug(template))
Trac[chrome] DEBUG: stream.render

string 'stream.render' is logged but 'stream.render.done' is not logged
nor string 'here' so i guess it crashes on stream.render() call. also,
from other logging attempts, it seems to me that even just access to
stream variable causes the seg fault (attempt to perform
self.log.debug(stream) ended log output). stream seems to be instance of
MarkupTemplate which seems to be part of genshi package, so i guess this
call:

stream = template.generate(**data)

creates stream that crashes the app. any ideas what could be the cause
that access to stream causes app crash? just to summarize:
www-apps/trac-0.11.5
dev-python/genshi-0.5.1
dev-lang/python-2.6.2-r1

thx

miroslav


Miroslav Šulc napsal(a):
> thx for answer, i tried what you suggest but the problem persists. i
> also tried to compile python with -ggdb but that showed exactly the same
> stack as without the debug flags so i'm not sure what's wrong. i am noob
> wrt python and eclipse (i use netbeans) so i doubt i could manage to
> debug trac remotely within short time and i cannot afford to spend on it
> several hours or days.
>
> miroslav
>
> Olemis Lang napsal(a):
>
>> 2009/9/15 Miroslav Šulc <miroslav.sulc [at] startnet>:
>>
>>
>>> hi,
>>>
>>> i have issues running some pages of trac, they simply do not load (empty
>>> page displays in browser). i found out in apache log that the cause is
>>> segmentation fault. here are the pages that cause seg fault:
>>> /browser
>>> /ticket/1 (any number)
>>> /changeset/349%3Afd2a05fbaab3 (any changeset)
>>>
>>>
>>>
>> [...]
>>
>>
>>> i also tried to debug tracd but it seems i miss debug info in python and
>>> did not find a way how to turn it on:
>>>
>>> anyone has an idea why i get the segfaults and how to fix it? or at
>>> least how to turn on debugging symbols for python so i could see the
>>> cause in the stack?
>>>
>>>
>>>
>> try this one :
>>
>> - Disable trac.versioncontrol.*
>> - Restart the server
>>
>> The only cause why I've experienced segfauls with Trac is
>> py-svn-bindings. If the problem persists at least you know that you
>> should look somewhere else ;o)
>>
>> Hint : You can debug Trac using PyDev + Eclipse ;o)
>>
>>
>>
>
>
> >
>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---


miroslav.sulc at startnet

Sep 17, 2009, 4:54 AM

Post #5 of 5 (403 views)
Permalink
Re: Segmentation faults [In reply to]

i have just found this bug report so i guess it's the cause:
https://bugs.gentoo.org/show_bug.cgi?id=284219

miroslav

Miroslav Šulc napsal(a):
> i tried to debug the code through logging statements (while reloading
> page /browser) and found out, that the problem is in web/chrome.py in method
>
> def render_template(self, req, filename, data, content_type=None,
> fragment=False):
>
> on these lines (logging statements were added by me):
>
> try:
> buffer = cStringIO()
> self.log.debug('stream.render')
> stream.render(method, doctype=doctype, out=buffer)
> self.log.debug('stream.render.done')
> return buffer.getvalue().translate(_translate_nop,
> _invalid_control_chars)
> except Exception, e:
> self.log.debug('here')
> # restore what may be needed by the error template
> req.chrome['links'] = links
> req.chrome['scripts'] = scripts
>
> log output is this (i added some other log statements to trac the path):
>
> Trac[main] DEBUG: genshi
> Trac[main] DEBUG: other
> Trac[chrome] DEBUG: filename: browser.html method: xhtml
> Trac[chrome] DEBUG: <MarkupTemplate "browser.html"> (this is output of
> self.log.debug(template))
> Trac[chrome] DEBUG: stream.render
>
> string 'stream.render' is logged but 'stream.render.done' is not logged
> nor string 'here' so i guess it crashes on stream.render() call. also,
> from other logging attempts, it seems to me that even just access to
> stream variable causes the seg fault (attempt to perform
> self.log.debug(stream) ended log output). stream seems to be instance of
> MarkupTemplate which seems to be part of genshi package, so i guess this
> call:
>
> stream = template.generate(**data)
>
> creates stream that crashes the app. any ideas what could be the cause
> that access to stream causes app crash? just to summarize:
> www-apps/trac-0.11.5
> dev-python/genshi-0.5.1
> dev-lang/python-2.6.2-r1
>
> thx
>
> miroslav

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To post to this group, send email to trac-users [at] googlegroups
To unsubscribe from this group, send email to trac-users+unsubscribe [at] googlegroups
For more options, visit this group at http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.