Csound Csound-dev Csound-tekno Search About

[Csnd] debugging segfaults?

Date2012-01-04 07:00
FromIain Duncan
Subject[Csnd] debugging segfaults?
Hi folks, I'm trying to get some code working that I used to use in 2005 on Csound at the time, but now it's segfaulting. This was on a different machine, different environment, lots of changes, so I expect I'll have to step through, eliminating things until I find the culprit. I thought I'd check first though to find out if there are any tips out there for debugging a segfault. What kind of thing I might be looking for, or is there any way to run csound through a debugger and see where it segfaults?

thanks!
Iain

Date2012-01-04 07:17
FromAndres Cabrera
SubjectRe: [Csnd] debugging segfaults?
Hi,

The first thing to rule out is the new parser, which is the cause of
most segfaults these days. Try running with the old parser first. Old
csds should still run no problem, and 6 year old csds are not too old
in Csoundland.

Cheers,
Andres

On Wed, Jan 4, 2012 at 7:00 AM, Iain Duncan  wrote:
> Hi folks, I'm trying to get some code working that I used to use in 2005 on
> Csound at the time, but now it's segfaulting. This was on a different
> machine, different environment, lots of changes, so I expect I'll have to
> step through, eliminating things until I find the culprit. I thought I'd
> check first though to find out if there are any tips out there for debugging
> a segfault. What kind of thing I might be looking for, or is there any way
> to run csound through a debugger and see where it segfaults?
>
> thanks!
> Iain


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2012-01-04 07:38
FromErik de Castro Lopo
SubjectRe: [Csnd] debugging segfaults?
Iain Duncan wrote:

> Hi folks, I'm trying to get some code working that I used to use in 2005 on
> Csound at the time, but now it's segfaulting. This was on a different
> machine, different environment, lots of changes, so I expect I'll have to
> step through, eliminating things until I find the culprit. I thought I'd
> check first though to find out if there are any tips out there for
> debugging a segfault. What kind of thing I might be looking for, or is
> there any way to run csound through a debugger and see where it segfaults?

Well on Linux (and I suspect OS X), segfaults are actually the easiest
problems to find with the gdb debugger.

First you need to compile csound with debugging symbols (and I haven't
looked at how to do that). Then run:

    gdb --args csound file.csd

When you get the gdb prompt "r" to run the program and when it segfaults,
"bt" to get the backtrace.

Erik

Date2012-01-04 08:08
Fromjpff@cs.bath.ac.uk
SubjectRe: [Csnd] debugging segfaults?
I am with Erik on this.  I always use gdb for this kind of thing.  And I
always compile with -g (controlled by noDebug option to the build process)

and....
The only known cause of a segfault is giving it a non-existent input not
ending in .csd -- now fixed in git


==John ff



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2012-01-04 16:54
FromIain Duncan
SubjectRe: [Csnd] debugging segfaults?
On Wed, Jan 4, 2012 at 12:08 AM,  <jpff@cs.bath.ac.uk> wrote:
I am with Erik on this.  I always use gdb for this kind of thing.  And I

always compile with -g (controlled by noDebug option to the build process)

Great, thanks, exactly the kinds of tips I needed. I guess it's time to read the gdb chapter in the Audio Programming Book, =)
 

and....
The only known cause of a segfault is giving it a non-existent input not
ending in .csd -- now fixed in git

Would including files of macro defs that don't end in .orc or .sco do this? There are a bunch of those, but I know that they used to work ok. There are hundreds of macros in this beast, can the preprocessor segfault?

There is also a lot of audio passing over zak channels and global variables. The ensemble actually had a much of it's work done before UDOs were ready for primetime, so it has some really ugly code that I'm looking forward to refactoring with the recent developments in Csound. But first to get it to just work...

thanks
Iain


Date2012-01-04 17:20
FromTito Latini
SubjectRe: [Csnd] debugging segfaults?
AttachmentsNone