fedora-core 1 segfault

ras1

09-11-2003 02:04:39

hello folks,

I just recently switched from rh 9 to fedora core 1, and I can't get netmrg to run on this rascal. netmrg_cron.sh segfaults everytime. Not sure what is causing it. I have included some of the output of strace right before it segfaults.

mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf3ad000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2601
read(3, "", 4096) = 0
close(3) = 0
munmap(0xbf3ad000, 4096) = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "/usr/local/bin/netmrg_cron.sh l"..., 96/usr/local/bin/netmrg_cron.sh line 31 11647 Segmentation fault $netmrg >$output 2>$error
) = 96

thanks in advance for you time,

--ras

balleman

09-11-2003 19:02:39

Hmm... it looks as though bash is segfaulting when trying to run the script? That seems really odd to me.

Could you try running netmrg-gatherer manually to see if that works?

ras1

09-11-2003 23:05:09

here is the end output of strace ./netmrg-gatherer

old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf533000
set_thread_area({entry_number-1 -> 6, base_addr0xbf5332a0, limit1048575, seg_32bit1, contents0, read_exec_only0, limit_in_pages1, seg_not_present0, useable1}) = 0
munmap(0xbf537000, 16803) = 0
set_tid_address(0xbf5332e8) = 29600
rt_sigaction(SIGRTMIN, {0x2fa620, [], SA_RESTORER|SA_SIGINFO, 0x300f10}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
brk(0) = 0x811b000
brk(0x813c000) = 0x813c000
brk(0) = 0x813c000
futex(0x269764, FUTEX_WAKE, 2147483647) = 0
stat64("/usr/local/etc/netmrg.xml", {st_mode=S_IFREG|0644, st_size=788, ...}) = 0
stat64("/usr/local/etc/netmrg.xml", {st_mode=S_IFREG|0644, st_size=788, ...}) = 0
stat64("/usr/local/etc/netmrg.xml", {st_mode=S_IFREG|0644, st_size=788, ...}) = 0
open("/usr/local/etc/netmrg.xml", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=788, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xbf53b000
read(3, "<netmrg>\n\t<database>\n\t\t<host>loc"..., 16384) = 788
read(3, "", 12288) = 0
_llseek(3, 0, [788], SEEK_CUR) = 0
read(3, "", 4096) = 0
read(3, "", 4096) = 0
close(3) = 0
munmap(0xbf53b000, 4096) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++

balleman

10-11-2003 09:59:36

If you compiled from source, did you try recompiling after upgrading to Fedora?

ras1

10-11-2003 16:12:14

Yeah, I first tried to install the rpm but it was complaining that it needed rrdtool installed (which I compiled and put int /bin/rrdtool). I then proceeded to compile the latest netmrg and it gave me those errors when I ran it. After that I tried to compile an older version netmrg-0.10pre2 because that's whath I was running on rh8 but I got the same error. It could just be something dumb that fedora has done (wouldn't surprise me), but I really like netmrg so I thought I wouold let you folks know.

--ras

balleman

10-11-2003 21:37:56

Not sure what changed in this version of libxml2, but it seems to be the culprit.

Try editing your [bcfecea6bc2]settings.cpp[/bcfecea6bc2] file, line 93

Old line
[code1cfecea6bc2]sprintf(temp, "%s", input);[/code1cfecea6bc2]

Replace with this
[code1cfecea6bc2]snprintf(temp, 1023, "%s", input);[/code1cfecea6bc2]

That prevented my NetMRG from segfaulting on parsing the config file (on Fedora). That may not be the only issue we'll encounter, though.

Please let us know if this fixes the problem.

balleman

10-11-2003 21:45:50

We'll continue to discuss this issue here, but it is now also being tracked as bug#90.

ras1

11-11-2003 01:36:20

Changing that line in settings.cpp fixed the problem ) Thanks folks for your quick response, and keep up the good work with netmrg!

--ras

silfreed

17-11-2003 16:05:54

Just in case people are still watching this thread, I wanted to let everyone know that I've rolled a new RPM for 0.10 to address this problem. I've also rolled an rrdtool package for FC1 that can be found in the contribs section of our page.
You can find all the packages here http//www.netmrg.net/download.php

-Doug

presidency

29-02-2004 01:52:54

Hello,

I just discovered NetMRG when I was trying to find some GUI for MRTG.

*Preamble*
I downloaded the netmrg-0.13.tar.gz and ran "./configure" and "make" - the package compiled without any problems since I had all the required libraries / dependencies on my Redhat Fedora Core 1 system. However, I actually installed the NetMRG binary RPM "/binary/netmrg-0.13-1.fc1.i386.rpm" package instead of running "make install". RRDtool 1.0.46

*Status*

NetMRG Web GUI works without any problems and I can get the graphs. However, when the "/usr/bin/netmrg_cron.sh" is run a 2 minute intervals from cron, I get the same error message that a previous post was about in this list ->

"/usr/bin/netmrg_cron.sh line 31 11700 Segmentation fault $netmrg >$output
2>$error"

I looked for the "settings.cpp" file as directed in the earlier post, and the "RPM" package had not installed any file with that name. However, I did find that file in the NetMRG src directory ->"netmrg-0.13/src". Should I replace the line as instructed in the earlier post, recompile NetMRG from source again and re-install using "make install"?

The "settings.cpp" file already had the replaced line (line 93) mentioned in the earlier post. What do I do now, do a "make install" after compiling from the netmrg-0.13 source?

Thank you for your time and help.

silfreed

29-02-2004 20:51:59

[quote926cab0fd5="presidency"]"/usr/bin/netmrg_cron.sh line 31 11700 Segmentation fault $netmrg >$output
2>$error"[/quote926cab0fd5]

Try running

[code1926cab0fd5]/usr/bin/netmrg-gatherer -sm[/code1926cab0fd5]

and posting the output. I'm not sure what's going on if you're getting graphs; NetMRG might be stepping on itself.

Also, you don't really need both the source and the RPM. Just one or the other is fine.

Let us know the output and we'll see what we can figure out.

-Doug

presidency

29-02-2004 23:33:54

Following is the output of "/usr/bin/netmrg-gatherer -sm" . It looks like it is running fine, however, when I run the "/usr/binnetmrg_cron.sh" script, thats when the error occurs and emailed.

[mhkhan@aparajita]# /usr/bin/netmrg-gatherer -sm
NetMRG starting.
Start time is 1078115412
Creating Lockfile.
Initializing SNMP library.
Initializing RRDTOOL pipe.
[Dev 0001] Starting device thread.
[Dev 0001] MySQL connection established.
[Dev 0001] Template Linux Box / <Field Omitted>
[Dev 0001] SNMP Uptime is 12960546
[Dev 0001] [Sub 0001] Starting Subdevice.
[Dev 0001] [Sub 0001] [Mon 0009] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0009] Value 76
[Dev 0001] [Sub 0001] [Mon 0008] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0008] Value 1
[Dev 0001] [Sub 0001] [Mon 0001] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0001] Value 538408
[Dev 0001] [Sub 0001] [Mon 0002] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0002] Value 45270
[Dev 0001] [Sub 0001] [Mon 0003] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0003] Value 95827
[Dev 0001] [Sub 0001] [Mon 0004] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0004] Value 0.23
[Dev 0001] [Sub 0001] [Mon 0005] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0005] Value 0.11
[Dev 0001] [Sub 0001] [Mon 0006] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0006] Value 0.03
[Dev 0001] [Sub 0001] [Mon 0011] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0011] Value 951616
[Dev 0001] [Sub 0001] [Mon 0010] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0010] Value 4408
[Dev 0001] [Sub 0001] [Mon 0007] Starting Monitor.
[Dev 0001] [Sub 0001] [Mon 0007] Value 3
[Dev 0001] [Sub 0002] Starting Subdevice.
[Dev 0001] [Sub 0002] Interface subdevice has no interface parameters.
[Dev 0001] [Sub 0002] Subdevice aborted due to previous errors.
[Dev 0001] [Sub 0003] Starting Subdevice.
[Dev 0001] [Sub 0003] Disk subdevice has no disk parameters.
[Dev 0001] [Sub 0003] Subdevice aborted due to previous errors.
[Dev 0001] [Sub 0004] Starting Subdevice.
[Dev 0001] [Sub 0004] [Mon 0017] Starting Monitor.
[PASSIVE] Last 0, Now 1
[Dev 0001] [Sub 0004] [Mon 0017] Value 249409005
[Dev 0001] [Sub 0004] [Mon 0018] Starting Monitor.
[Dev 0001] [Sub 0004] [Mon 0018] Value 47093156
[Dev 0001] [Sub 0005] Starting Subdevice.
[Dev 0001] [Sub 0005] [Mon 0019] Starting Monitor.
[Dev 0001] [Sub 0005] [Mon 0019] Value 145248251
[Dev 0001] [Sub 0005] [Mon 0020] Starting Monitor.
[Dev 0001] [Sub 0005] [Mon 0020] Value 310129985
[Dev 0001] [Sub 0006] Starting Subdevice.
[Dev 0001] [Sub 0006] [Mon 0021] Starting Monitor.
[Dev 0001] [Sub 0006] [Mon 0021] Value U
[Dev 0001] [Sub 0006] [Mon 0022] Starting Monitor.
[Dev 0001] [Sub 0006] [Mon 0022] Value U
[Dev 0001] [Sub 0007] Starting Subdevice.
[Dev 0001] [Sub 0007] [Mon 0023] Starting Monitor.
[Dev 0001] [Sub 0007] [Mon 0023] Value U
[Dev 0001] [Sub 0007] [Mon 0024] Starting Monitor.
[Dev 0001] [Sub 0007] [Mon 0024] Value U
[Dev 0001] [Sub 0008] Starting Subdevice.
[Dev 0001] [Sub 0008] [Mon 0025] Starting Monitor.
[Dev 0001] [Sub 0008] [Mon 0025] Value U
[Dev 0001] [Sub 0008] [Mon 0026] Starting Monitor.
[Dev 0001] [Sub 0008] [Mon 0026] Value U
[Dev 0001] Ending device thread.
Thread Ended.
[PASSIVE] Last 1, Now 0
Closed MySQL connection.
Runtime 0
Closed RRDTOOL pipe.
Cleaned up SNMP.
[mhkhan@aparajita]#

Thanks,

mhkhan.

balleman

02-03-2004 17:54:19

That's really odd. Essentially, that script is just a wrapper for netmrg-gatherer. Try running netmrg-gatherer with no options, and see if it segfaults then.

presidency

07-03-2004 03:48:11

Following is the output if I only run netmrg-gatherer


[mhkhan@aparajita]# netmrg-gatherer
NetMRG starting.
[Dev 0001] Starting device thread.
[Dev 0001] [Sub 0002] Interface subdevice has no interface parameters.
[Dev 0001] [Sub 0002] Subdevice aborted due to previous errors.
[Dev 0001] [Sub 0003] Disk subdevice has no disk parameters.
[Dev 0001] [Sub 0003] Subdevice aborted due to previous errors.
[Dev 0001] Ending device thread.
Thread Ended.
[mhkhan@aparajita]#


Any ideas? I am pretty much stuck .... Thanks

[quote565c8b182b="balleman"]That's really odd. Essentially, that script is just a wrapper for netmrg-gatherer. Try running netmrg-gatherer with no options, and see if it segfaults then.[/quote565c8b182b]

silfreed

07-03-2004 07:27:22

[quote46ec5bdbbf="presidency"]Any ideas? I am pretty much stuck .... Thanks[/quote46ec5bdbbf]

Hopefully not ;)
Let us know the output of this

[code146ec5bdbbf]ls -al /bin/sh[/code146ec5bdbbf]

Mine shows

[code146ec5bdbbf]$ ls -al /bin/sh
lrwxrwxrwx 1 root root 4 Jan 6 23:48 /bin/sh -> bash[/code146ec5bdbbf]

We haven't done any testing of the cron wrapper script with other shells than 'sh' and 'bash2', so if you didn't install bash, it might be linked to something else.
The [i46ec5bdbbf]netmrg_cron.sh[/i46ec5bdbbf] script is just a wrapper for [i46ec5bdbbf]netmrg-gatherer[/i46ec5bdbbf], so if you wanted to put that in cron instead and redirect the output somewhere, that would be fine.

presidency

07-03-2004 23:37:13

Output of ls -al /bin/sh

lrwxrwxrwx 1 root root 4 Feb 17 2045 /bin/sh -> bash

I put the following command in the master cron to run every 5 minutes with user "netmrg".

/usr/bin/netmrg_cron.sh

That is where this program starts to segfault ....

Thanks for your time ..