[rrd-developers] segmentation fault with RRDs::graph in 1.2.18

Tobias Oetiker tobi at oetiker.ch
Tue Apr 10 07:44:39 CEST 2007


Hi Haroon,

I looked over the code and I can't curently see what is going wrong
except that you seem to be running multithreaded and rrd_graph is
not realy done with thread-savety in mind.

have you ever seen this bug in a non multithreaded environment ?

it would be great if you could provide a script to reproduce the
problem.

cheers
tobi

Saturday Haroon Rafique wrote:

> Hi,
>
> I've been noticing a segmentation fault in RRDs::graph for quite some time.
> Just haven't gotten around to tracking it down. I didn't try this with
> v.1.2.19 since there are no functional changes in rrd_graph.c between 1.2.18
> and 1.2.19.
>
> In any case, I get a:
>  Program received signal SIGSEGV, Segmentation fault.
> about 80% of the time. I don't think I'm doing anything unusual. The rest of
> the site uses similar RRDs::graph invocations without any problems. Regardless
> of the usage of RRDs::graph, I think rrd_graph should be enhanced to take care
> of any problems by itself (and not segfault).
>
> Here's my (gdb) bt full info:
>
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread -1218555776 (LWP 29527)]
> 0x007109cd in print_calc (im=0xbfff7490, prdata=0xbfff9154) at
> rrd_graph.c:1376
> 1376    rrd_graph.c: No such file or directory.
>         in rrd_graph.c
> (gdb) bt full
> #0  0x007109cd in print_calc (im=0xbfff7490, prdata=0xbfff9154) at
> rrd_graph.c:1376
>         i = 94
>         ii = 181
>         validsteps = 1
>         printval = 87.000000000000028
>         tmvdef = {tm_sec = 0, tm_min = 0, tm_hour = 19, tm_mday = 31, tm_mon =
> 11, tm_year = 69,
>   tm_wday = 3, tm_yday = 364, tm_isdst = 0, tm_gmtoff = -18000, tm_zone =
> 0x85ef860 "EST"}
>         graphelement = 1
>         vidx = 56
>         max_ii = 181
>         magfact = 1
>         si_symb = 0x743f53 " "
>         prlines = 1
>         now = 1175983474
> #1  0x00713e27 in graph_paint (im=0xbfff7490, calcpr=0xfffff8b4) at
> rrd_graph.c:2591
>         i = 7538217
>         ii = 4
>         lazy = 0
>         fo = (FILE *) 0x0
>         node = (gfx_node_t *) 0x0
>         areazero = 0
>         lastgdes = (graph_desc_t *) 0x0
> #2  0x0071523e in rrd_graph (argc=115, argv=0x8d1bf28, prdata=0xbfff9154,
> xsize=0xfffff8b4,
> ---Type <return> to continue, or q <return> to quit---
>     ysize=0xfffff8b4, stream=0xfffff8b4, ymin=0xfffff8b4, ymax=0xfffff8b4) at
> rrd_graph.c:3049
>         filename = 0xbfff7490
> "/backup/stats/www/htdocs/mrtg/images/rpc_stats/election-hour.png"
>         im = {
>   graphfile =
> "/backup/stats/www/htdocs/mrtg/images/rpc_stats/election-hour.png", '\0'
> <repeats 959 times>, graphhandle = 0x0, xsize = 500, ysize = 120, graph_col =
> {4294967295, 4042322175, 3503345919, 2694881535,
>     2425393280, 3763359872, 255, 2149589247, 538976511, 255}, text_prop =
> {{size = 8,
>       font =
> "/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf\000\231\000\b`]\b?úÄ\b8yÿ¿¬k\214\000\b`]\b­\000\000\000Ëû\220\000hÔ\231\000PÃÄ\b\b`]\b«Ø\222\000hÔ\231\000\b`]\bHìÄ\bXyÿ¿lÀ\222\000\b`]\bð\002\000\000Ð\004Å\bhÔ\231\000hÔ\231\000hÔ\231\000èyÿ¿gk\215\000\b`]\b?úÄ\b\000\002\000\000o\000\000\000\b`]\bt\003\000\000\035¶\217\000hÔ\231\000\b`]\bÔ\000\000\000\001\000\000\000h\001\000\000\b`]\b"...},
> {size = 9,
>       font =
> "/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf\000Ç\bl\001\000\000À\216È\bèÁÈ\bo::\000 \215È\bð¯È\b\f¶È\b\b`]\b«Ø\222\000hÔ\231\000\b`]\b\020?È\bX}ÿ¿lÀ\222\000\b`]\b2\001\000\000Kj\215\000`wÏ\b\b`]\bhÔ\231,è}ÿ¿gk\215\000\b`]\bÐ?È\b\000\002\000\000-í\220\000\b`]\b ~?\b\035¶\217\000hÔ\231\000\b`]\bV\001\000.?}ÿ¿\000\000\000\000\b`]\bø\232Ç\bV\001\000\000"...},
> {size = 7,
>       font =
> "/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf\000Ò\b\001\000\000\000\004\000\000\000n\000\000\000\\wÏ\b\000\000\000\000?wÏ\bH\201ÿ¿lÀ\222\000\b`]\b\017\001\000\000Kj\215\000hÔ\231\000\b`]\bhÔ\231\000Ø\201ÿ¿gk\215\000\b`]\b\020rÈ\b\000\002\000\000-í\220\000\b`]\bÕ\000\000\000\035¶\217\000hÔ\231\000\b`]\b~\001\000\000?\201ÿ¿\000\000\000\000\b`]\bø\232Ç\b~\001\000\000\f¶È\b(ÁÈ\b\235\000\000\000Ëû\220\000hÔ\231\000\f¶È\b"...},
> {size = 8,
>       font =
> "/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf\000\000\000«Ø\222\000hÔ\231\000\b`]\bÈ\000\000\000ø\207ÿ¿ôÉ\225\000\b`]\bÈ\000\000\000\232ÊÒ\b\000\000\000\000\000\000\000\000O\000\000\000é.Ë\b\000\000\000\000\b`]\b ãË\bO\000\000\000ÿÿ\000\000\b`]\bá\000\000\000\000\000\000\000hÔ\231\000¬·Ì\b\b`]\b«Ø\222\000hÔ\231\000\b`]\bÈRÌ\b?\205ÿ¿lÀ\222\000\000\000\000\000twÏ\b\000\000\000\000\000\000\000\000\b`]\bhÔ\231\0008---Type
> <return> to continue, or q <return> to quit---
> \206ÿ¿"...}, {size = 8,
>       font =
> "/usr/share/rrdtool/fonts/DejaVuSansMono-Roman.ttf\000ÿÿÈxÏ\b\000\000\000\000'\000\000\000öU\212\000\b`]\b\000\000\000\000x\211ÿ¿ìtÏ\bìtÏ\b",
> '\0' <repeats 12 times>, "\030j]\b\fj]\b\000j]\b\000\000\000\000?\002", '\0'
> <repeats 19 times>,
> "ÜÑ\b\000ÜÑ\bhÔ\231\000\nÜÑ\bÌ\206º\bX\214ÿ¿\024ì\225\000\b`]\bÌ\206º\b\035\000\000\000p\212ÿ¿\004yÏ\bP\213ÿ¿\000
> \000\000\021³\217\000?ùÊ\b?B\227\000\020\000\000nÿÿ\000"...}},
>   ylegend = "Requests/Minute", '\0' <repeats 136 times>,
> "FÚ\203Ï\b\000\000\000\000hÔ\231\000\b`]\b?zº\bh\220ÿ¿DÃ\225\000\b`]\b¬zº\bØÛÑ\b\003\000\000\000\030j]\b\fj]\b\000j]\bD\005",
>   title = "RPC requests in Election section of SWS", '\0' <repeats 112 times>,
> "\a\000\000*\237#\000\006\000\000\000xj$\000$\220ÿ¿\001\000\000\000 \216ÿ¿YX\032\000À\217ÿ¿ÀÇÿÿ$\220ÿ¿\220\216ÿ¿$\220ÿ¿\000\000\000\000\000\000\000",
>   watermark = "© Haroon Rafique 2003-2007. All rights reserved. Unauthorised
> use prohibited.", '\0' <repeats 23 times>, "\fj]\b\000j]\b\030", draw_x_grid =
> 1, draw_y_grid = 1, grid_dash_on = 1, grid_dash_off = 1,
>   xlab_user = {minsec = -1, length = 147975208, gridtm = TMT_DAY, gridst =
> 140337160, mgridtm = 67,
>     mgridst = 9814387, labtm = 146438832, labst = 146438824, precis = 2386552,
> stst = 0x8ba869c ""},
>   xlab_form =
> "\211\020\000:\200\217ÿ¿]?\225\000hÔ\231\000H\206º\bØÛÑ\b\230\220ÿ¿«?\225\000\b`]\bH\206º\bØÛÑ\b\004\000\000\000`s$\000xj$\000ì\210Ï\bè\204Ï\bÐ\217ÿ¿\2338\030\000`s$\000è\204Ï\b\000\000\000\000\000\000\000\000\001\000\000\000k\000\000\000\002\000\000\000\200P^·0øp\b·ß\220\000ø\030Ë\b{_i\b\035",
> '\0' <repeats 11 times>,
> "x\031q\b[ß\220\000hÔ\231\000\035\000\000\000{_i\b?\220ÿ¿\206\f\217\000\b`]\b0øp\b{_i\b\035\000\000\000\000\000\000\000Y-\030\000`s$\000x\031q\bü\201@@`s$\000?"...,
> ygridstep = nan(0x8000000000000),
>   ylabfact = 2388832, tabwidth = 40, start = 1175972674, end = 1175983474,
> step = 21, minval = 0,
>   maxval = nan(0x8000000000000), rigid = 0, ygrid_scale = {gridstep =
> 5.450938650301083e-306, labfact = 0,
>     labfmt =
> "x\036Ï\b\f\000\000\000hÔ\231\000j\000\000\000\b`]\b\230\220ÿ¿sÁ\225\000\b`]\b?zº\b`v$\000?s$\000ø\001\000\000??Ñ\b]?\225\000hÔ\231\000\000\000\000"},
> gridfit = 1, imginfo = 0x0, lazy = 1,
> ---Type <return> to continue, or q <return> to quit---
>   slopemode = 0, logarithmic = 0, xorigin = 0, yorigin = 0, ximg = 0, yimg =
> 0,
>   magfact = 5.6880351816319198e-308, base = 1000, symbol = 32 ' ', viewfactor
> = 1, unitsexponent = 9999,
>   unitslength = 6, extra_flags = 4, prt_c = 0, gdes_c = 95, gdes = 0xb7581008,
> canvas = 0x8d2e750}
> #3  0x0027a0b5 in XS_RRDs_graph (my_perl=0x85d6008, cv=0x8b83adc) at
> RRDs.xs:223
>         i = 0
>         xsize = 808465464
>         argv = (char **) 0x8d1bf28
>         calcpr = (char **) 0x0
>         ysize = 9625320
>         ymin = 1.2761791207913473e-266
>         ymax = 6.6911817000242767e-306
>         retar = (AV *) 0xbfff9160
>         sp = (SV **) 0x863a5bc
>         mark = (SV **) 0x8cf8910
>         ax = 2
> #4  0x00906195 in Perl_pp_entersub (my_perl=0x85d6008) at pp_hot.c:2781
>         av = (AV *) 0x7
>         items = 2596736
>         markix = 1
>         sp = (SV **) 0x863a784
>         sv = (SV *) 0x8b83ac4
>         gv = (GV *) 0x7
>         stash = (HV *) 0x863a784
> ---Type <return> to continue, or q <return> to quit---
>         cv = (CV *) 0x8b83adc
>         cx = (PERL_CONTEXT *) 0x8ba4f88
>         gimme = 1
> #5  0x008e990a in Perl_runops_debug (my_perl=0x85d6008) at dump.c:1414
> No locals.
> #6  0x0089da2b in S_run_body (my_perl=0x85d6008, oldscope=-1868) at
> perl.c:1705
> No locals.
> #7  0x0089d6b5 in perl_run (my_perl=0x85d6008) at perl.c:1624
>         sp = (SV **) 0x2ade8
>         prev = (PERL_SI *) 0xbfff7490
>         oldscope = 1
>         ret = 175592
>         cur_env = {je_prev = 0x85d619c, je_buf = {{__jmpbuf = {10081384,
> -1073769440, 2376508,
>         -1073769640, -1073769888, 9033130}, __mask_was_saved = 0, __saved_mask
> = {__val = {3221197540,
>           8914124, 3076485120, 14886168, 576, 0, 210923230, 3221197616,
> 14886672, 1, 1, 0, 512, 8923852,
>           3076485120, 14886168, 299, 14886672, 3221197632, 14849039, 14887088,
> 1, 1, 9617364, 3221197656,
>           14848816, 14884896, 100, 10081384, 134527888, 35, 134515063}}}},
> je_ret = 0,
>   je_mustcatch = 0 '\0'}
> #8  0x08049413 in main ()
>
> Let me know if there's anything else I can do to help.
>
> Thanks,
> --
> Haroon Rafique
> <haroon.rafique at utoronto.ca>
>

-- 
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten
http://it.oetiker.ch tobi at oetiker.ch ++41 62 213 9902


More information about the rrd-developers mailing list