Bug 435468 - [Python bindings]: Python segfaults when calling rrdtool.info on a file
[Python bindings]: Python segfaults when calling rrdtool.info on a file
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rrdtool (Show other bugs)
8
All Linux
low Severity low
: ---
: ---
Assigned To: Chris Ricker
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-29 10:32 EST by David Kovalsky
Modified: 2014-03-31 19:44 EDT (History)
2 users (show)

See Also:
Fixed In Version: 1.3-0.12.beta4.fc8
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-02 13:46:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
2.rrd (5.23 KB, application/octet-stream)
2008-02-29 10:32 EST, David Kovalsky
no flags Details
strace.log (56.04 KB, text/plain)
2008-02-29 10:35 EST, David Kovalsky
no flags Details

  None (edit)
Description David Kovalsky 2008-02-29 10:32:27 EST
Python segfaults when calling info on a file (attached). 

[dkovalsk@kovinek ~]$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> rrdtool.info("/var/tmp/2.rrd")
Segmentation fault

[dkovalsk@kovinek ~]$ rpm -q rrdtool-python-1.3-0.6.beta3.fc8
rrdtool-python-1.3-0.6.beta3.fc8

[dkovalsk@kovinek ~]$ ls -l /var/tmp/2.rrd
-rw-rw-r-- 1 dkovalsk dkovalsk 5360 2008-02-29 16:11 /var/tmp/2.rrd

### callling `rrdtool info' on the file shows no problems
[dkovalsk@kovinek ~]$ rrdtool info /var/tmp/2.rrd
filename = "/var/tmp/2.rrd"
rrd_version = "0003"
step = 60
last_update = 1204297895
ds[load1].type = "GAUGE"
ds[load1].minimal_heartbeat = 180
ds[load1].min = 0.0000000000e+00
ds[load1].max = NaN
ds[load1].last_ds = "UNKN"
ds[load1].value = 0.0000000000e+00
ds[load1].unknown_sec = 35
ds[load5].type = "GAUGE"
ds[load5].minimal_heartbeat = 180
ds[load5].min = 0.0000000000e+00
ds[load5].max = NaN
ds[load5].last_ds = "UNKN"
ds[load5].value = 0.0000000000e+00
ds[load5].unknown_sec = 35
ds[load15].type = "GAUGE"
ds[load15].minimal_heartbeat = 180
ds[load15].min = 0.0000000000e+00
ds[load15].max = NaN
ds[load15].last_ds = "UNKN"
ds[load15].value = 0.0000000000e+00
ds[load15].unknown_sec = 35
rra[0].cf = "AVERAGE"
rra[0].rows = 60
rra[0].pdp_per_row = 1
rra[0].xff = 5.0000000000e-01
rra[0].cdp_prep[0].value = NaN
rra[0].cdp_prep[0].unknown_datapoints = 0
rra[0].cdp_prep[1].value = NaN
rra[0].cdp_prep[1].unknown_datapoints = 0
rra[0].cdp_prep[2].value = NaN
rra[0].cdp_prep[2].unknown_datapoints = 0
rra[1].cf = "AVERAGE"
rra[1].rows = 100
rra[1].pdp_per_row = 5
rra[1].xff = 5.0000000000e-01
rra[1].cdp_prep[0].value = NaN
rra[1].cdp_prep[0].unknown_datapoints = 1
rra[1].cdp_prep[1].value = NaN
rra[1].cdp_prep[1].unknown_datapoints = 1
rra[1].cdp_prep[2].value = NaN
rra[1].cdp_prep[2].unknown_datapoints = 1

Let me know if you need more information to diagnose the issue.
Comment 1 David Kovalsky 2008-02-29 10:32:27 EST
Created attachment 296367 [details]
2.rrd
Comment 2 David Kovalsky 2008-02-29 10:35:49 EST
Created attachment 296368 [details]
strace.log
Comment 3 David Kovalsky 2008-02-29 10:37:12 EST
JFTR, I'm running the latest & greatest F8 i386.
Comment 4 David Kovalsky 2008-02-29 10:43:38 EST
I've tried the same on Fedora 7 i386, works OK:

[GCC 4.1.2 20070925 (Red Hat 4.1.2-27)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> rrtool.info("2.rrd")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'rrtool' is not defined
>>> rrdtool.info("2.rrd")
{'rrd_version': '0003', 'rra': [{'pdp_per_row': 1, 'rows': 60, 'cf': 'AVERAGE',
'cdp_prep': [{'unknown_datapoints': 0, 'value': None}, {'unknown_datapoints': 0,
'value': None}, {'unknown_datapoints': 0, 'value': None}], 'xff': 0.5},
{'pdp_per_row': 5, 'rows': 100, 'cf': 'AVERAGE', 'cdp_prep':
[{'unknown_datapoints': 1, 'value': None}, {'unknown_datapoints': 1, 'value':
None}, {'unknown_datapoints': 1, 'value': None}], 'xff': 0.5}], 'last_update':
1204297895, 'step': 60, 'filename': '2.rrd', 'ds': {'load1': {'min': 0.0, 'max':
None, 'unknown_sec': 35, 'minimal_heartbeat': 180, 'value': 0.0, 'ds_name':
'load1', 'type': 'GAUGE', 'last_ds': 'UNKN'}, 'load15': {'min': 0.0, 'max':
None, 'unknown_sec': 35, 'minimal_heartbeat': 180, 'value': 0.0, 'ds_name':
'load15', 'type': 'GAUGE', 'last_ds': 'UNKN'}, 'load5': {'min': 0.0, 'max':
None, 'unknown_sec': 35, 'minimal_heartbeat': 180, 'value': 0.0, 'ds_name':
'load5', 'type': 'GAUGE', 'last_ds': 'UNKN'}}}
>>>

python-2.5-15.fc7
rrdtool-1.2.23-6.fc7
rrdtool-python-1.2.23-6.fc7
Comment 5 David Kovalsky 2008-02-29 10:47:34 EST
Also tried on Rawhide (64 bit), segfaults same F8. So this is from F8 upwards.

[root@rawhide64 ~]# python
Python 2.5.1 (r251:54863, Jan  4 2008, 10:38:21)
[GCC 4.1.2 20071124 (Red Hat 4.1.2-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> rrdtool.info("2.rrd")
Segmentation fault (core dumped)
[root@rawhide64 ~]# rpm -q python
python-2.5.1-19.fc9
[root@rawhide64 ~]# rpm -q rrdtool-python
rrdtool-python-1.3-0.8.beta4.fc9
Comment 6 Jarod Wilson 2008-02-29 10:49:34 EST
Hrm. Would actually be best to chase this upstream if beta4 is still broken.
Comment 7 David Kovalsky 2008-03-04 09:16:48 EST
Okay, opened as upstream ticket 148.

http://oss.oetiker.ch/rrdtool-trac/ticket/148
Comment 8 David Kovalsky 2008-04-23 10:08:04 EDT
Hi Jarod, 

according to http://oss.oetiker.ch/rrdtool-trac/ticket/148#comment:1 the issue
is fixed. Can you please spin up the new package for Fedora?

Thanks!

Comment 9 Jarod Wilson 2008-04-23 14:44:15 EDT
Building now for both F9 and F8...
Comment 10 Fedora Update System 2008-04-24 13:15:35 EDT
rrdtool-1.3-0.12.beta4.fc8 has been submitted as an update for Fedora 8
Comment 11 Jarod Wilson 2008-04-24 13:17:37 EDT
Patched build has also been tagged for inclusion in the F9 release.
Comment 12 Fedora Update System 2008-04-29 16:58:22 EDT
rrdtool-1.3-0.12.beta4.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 13 David Kovalsky 2008-05-02 08:34:56 EDT
Hey Jarod, 

I've just tested with 1.3-0.12.beta4 and python still segfaults. Strace output
seems to be the same as above. You can verify that by using the rrd file
attached in comment #2 using the reproducer in comments #0. 
Comment 14 Jarod Wilson 2008-05-02 10:19:36 EDT
Crud, I just assumed the patch fixed it. :\

I'm going to hand this one over to Chris, who is taking over point on rrdtool
maintenance.
Comment 15 Chris Ricker 2008-05-19 11:25:11 EDT
I've reopened it upstream, as it's still appears to not work with 1.3rc4

You can get scratch RPMs of 1.3rc4 if you want to try it also:

F-8 -- http://koji.fedoraproject.org/koji/taskinfo?taskID=617631
F-9 -- http://koji.fedoraproject.org/koji/taskinfo?taskID=617605

no RPMs for rawhide currently, as it's having issues building x86_64

BTW, I noticed you're doing some testing on both i386 and x86_64. rrd databases
currently aren't portable across platforms, so if you're testing with the same
attached 2.rrd file (which appears to be from i386) on both i386 and x86_64 I
wouldn't necessarily expect it to work on x86_64

Comment 16 David Kovalsky 2008-05-19 17:47:03 EDT
Several hours later, seems there's a fix available :-)
http://oss.oetiker.ch/rrdtool-trac/ticket/148#comment:4

Chris, please spin up new packages when you get a chance. I'll be happy to do
the testing and this time make sure that I'm using the right database for the
right arch :)

Thanks!
Comment 17 Chris Ricker 2008-05-19 22:14:00 EDT
Scratch builds at

F-8:  http://koji.fedoraproject.org/koji/taskinfo?taskID=619067
F-9:  http://koji.fedoraproject.org/koji/taskinfo?taskID=619065

(real 1.3 release should be very soon, so I'm waiting for it to push real builds
to F8 / F9)

I've tested it with your rrd, and it looks better

On x86-64, it fails nicely instead of segfaulting:

$ python
Python 2.5.1 (r251:54863, Apr  8 2008, 01:19:33) 
[GCC 4.3.0 20080404 (Red Hat 4.3.0-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> rrdtool.info("2.rrd")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
rrdtool.error: This RRD was created on another architecture
>>> 


On i386, it reads the rrd fine:

$ python
Python 2.5.1 (r251:54863, Oct 30 2007, 13:54:11) 
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import rrdtool
>>> rrdtool.info("2.rrd")
{'rra[1].cdp_prep[1].unknown_datapoints': 1L, 'rra[0].cdp_prep[0].value': None,
'rra[1].pdp_per_row': 5L, 'rra[1].xff': 0.5, 'rra[1].cdp_prep[2].value': None,
'ds[load15].unknown_sec': 35L, 'rra[0].cdp_prep[1].unknown_datapoints': 0L,
'ds[load5].max': None, 'ds[load1].value': 0.0, 'filename': '2.rrd',
'rra[0].pdp_per_row': 1L, 'ds[load1].min': 0.0, 'rra[1].rows': 100L,
'ds[load15].last_ds': 'UNKN', 'rrd_version': '0003', 'ds[load1].max': None,
'rra[1].cf': 'AVERAGE', 'last_update': 1204297895L, 'ds[load5].type': 'GAUGE',
'rra[0].cf': 'AVERAGE', 'ds[load1].type': 'GAUGE', 'ds[load15].type': 'GAUGE',
'ds[load15].value': 0.0, 'ds[load15].min': 0.0, 'rra[0].cur_row': 59L,
'ds[load5].last_ds': 'UNKN', 'ds[load1].minimal_heartbeat': 180L,
'ds[load15].max': None, 'rra[1].cdp_prep[2].unknown_datapoints': 1L, 'step':
60L, 'ds[load15].minimal_heartbeat': 180L,
'rra[0].cdp_prep[0].unknown_datapoints': 0L, 'rra[0].cdp_prep[2].value': None,
'rra[0].rows': 60L, 'rra[1].cdp_prep[0].value': None, 'rra[1].cur_row': 99L,
'ds[load5].unknown_sec': 35L, 'rra[1].cdp_prep[1].value': None, 'ds[load5].min':
0.0, 'ds[load1].last_ds': 'UNKN', 'rra[0].xff': 0.5,
'rra[0].cdp_prep[2].unknown_datapoints': 0L, 'rra[0].cdp_prep[1].value': None,
'rra[1].cdp_prep[0].unknown_datapoints': 1L, 'ds[load5].minimal_heartbeat':
180L, 'ds[load5].value': 0.0, 'ds[load1].unknown_sec': 35L}
>>> 


Note You need to log in before you can comment on or make changes to this bug.