[Cs-dev] Error with api using new build
Date | 2005-09-02 21:14 |
From | Iain Duncan |
Subject | [Cs-dev] Error with api using new build |
Hi, just rebuilt csound5 with a fresh checkout. My little api host no longer runs. I get a bunch of the following errors: Error in pre-initialization function in module: "libfoobar.so" along with a segfault. Any clues? Thanks Iain ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-02 21:42 |
From | Istvan Varga |
Subject | Re: [Cs-dev] Error with api using new build |
Iain Duncan wrote: > Hi, just rebuilt csound5 with a fresh checkout. My little api host no > longer runs. I get a bunch of the following errors: > > Error in pre-initialization function in module: "libfoobar.so" > > along with a segfault. > > Any clues? Other than trying to check out the sources again, and doing a clean recompile (the error message does suggest an inconsistent build), it would help to see the source of the host (assuming that it is public and not very large) to find out why it does not work. Also, what is libfoobar.so ? Maybe it is a plugin that was compiled for older sources, and is not binary compatible with your current build of libcsound ? ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-02 22:05 |
From | Iain Duncan |
Subject | Re: [Cs-dev] Error with api using new build |
Istvan Varga wrote: > Iain Duncan wrote: > >> Hi, just rebuilt csound5 with a fresh checkout. My little api host no >> longer runs. I get a bunch of the following errors: >> >> Error in pre-initialization function in module: "libfoobar.so" >> >> along with a segfault. >> >> Any clues? > > > Other than trying to check out the sources again, and doing a clean > recompile (the error message does suggest an inconsistent build), > it would help to see the source of the host (assuming that it is public > and not very large) to find out why it does not work. > Also, what is libfoobar.so ? Maybe it is a plugin that was compiled > for older sources, and is not binary compatible with your current > build of libcsound ? This was a totally clean checkout, and I tested with a simple csd. The api app is just the same simple thing I was playing with a week or two ago. I didn't mean it was actually "libfooba.so", sorry, I meant I get a whole wack of them for a bunch of the csound libs: libmixer_util.so libscale.so etc Iain ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-02 22:11 |
From | Steven Yi |
Subject | Re: [Cs-dev] Error with api using new build |
Attachments | None |
Date | 2005-09-04 05:08 |
From | Iain Duncan |
Subject | Re: [Cs-dev] Error with api using new build |
Attachments | cs_simple_3.c cs_simple_lfo.csd |
Ok, just discovered something very weird with the api and OPCODEDIR, this on a fresh check out I just did. if OPCODEDIR=/csound5/ - csound works fine from control line - api doesn't work, gives me the aforementioned errors, no matter the flags ( with or without -odac ) Error in pre-initialization function in module: "lib etc if OPCODEDIR=/csound5/Opcodes - csound gives me "no legal opcode" from control line - api works, as long as I don't use -odac if OPCODEDIR=/csound5/Opcodes and I use -odac ( with or without -+rtaudio=alsa ) I get errors saying "unknown rtaudio module: 'PortAudio' ( or alsa ) Failed to initialize real time audio output Csound Segmentation fault. Attached are the files in questions. Thanks Iain Steven Yi wrote: > Not sure if you've done this, but have you cleared out all of your old > .so's from your OPCODEDIR? That bit me once or twice, so just thought > I'd mention that. > > On 9/2/05, Iain Duncan |
Date | 2005-09-04 11:19 |
From | Istvan Varga |
Subject | Re: [Cs-dev] Error with api using new build |
Iain Duncan wrote: > Ok, just discovered something very weird with the api and OPCODEDIR, > this on a fresh check out I just did. > > if OPCODEDIR=/csound5/ > - csound works fine from control line > - api doesn't work, gives me the aforementioned errors, no matter the > flags ( with or without -odac ) > Error in pre-initialization function in module: "lib etc I do not know what may be causing this, but I still suspect there is old source or object code somewhere, because this problem is a typical result of an inconsistent build. Or maybe the error is specific to x86-64, and that is why I cannot reproduce it ? > if OPCODEDIR=/csound5/Opcodes > - csound gives me "no legal opcode" from control line > - api works, as long as I don't use -odac > > if OPCODEDIR=/csound5/Opcodes and I use -odac ( with or without > -+rtaudio=alsa ) I get errors saying > "unknown rtaudio module: 'PortAudio' ( or alsa ) > Failed to initialize real time audio output > Csound Segmentation fault. Are the plugin libraries actually in /csound5/Opcodes ? > Attached are the files in questions. The host looks like it was written for an older version of the Csound 5 CVS sources, and in fact it should not even compile. Or are you using the old host binary (compiled and linked against a previous version of Csound) with new plugin libraries ? That should explain the lots of "pre-initialization" errors. The segmentation fault in the case of no plugins may be caused by not checking the return value of csoundCompile or other functions and trying to continue anyway even if something failed. ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-04 23:15 |
From | Iain Duncan |
Subject | Re: [Cs-dev] Error with api using new build |
> The host looks like it was written for an older version of the Csound 5 > CVS sources, and in fact it should not even compile. Or are you using > the old host binary (compiled and linked against a previous version of > Csound) with new plugin libraries ? That should explain the lots of > "pre-initialization" errors. The segmentation fault in the case of no > plugins may be caused by not checking the return value of csoundCompile > or other functions and trying to continue anyway even if something failed. Well, I recompiled it, but I'm not sure that I'm not linking against old libraries. What all do I need to get rid of to insure I am using only new stuff? Also, how is that my host is now incorrect? Have there been api changes that make it wrong now? Iain ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-05 18:49 |
From | Istvan Varga |
Subject | Re: [Cs-dev] Error with api using new build |
Iain Duncan wrote: > Also, how is that my host is now incorrect? Have there been api changes > that make it wrong now? As Csound 5 is not released yet, the API is subject to incompatible changes; fortunately most of those have already been made, but you can only consider it stable once there is an "official" release that is no longer beta. I do suspect though that some people waiting for the final release will only then complain about things that could have been done better. In this particular case, your host is affected by changes to the thread wrapper functions (see below); also, the Csound instance pointer type that previously used to be sometimes void* and other times ENVIRON* (or even struct ENVIRON_*) is now consistently CSOUND*, but this affects only sources and not binary compatibility. /** * Creates and starts a new thread of execution. * Returns an opaque pointer that represents the thread on success, * or NULL for failure. * The userdata pointer is passed to the thread routine. */ PUBLIC void *csoundCreateThread(uintptr_t (*threadRoutine)(void *), void *userdata); /** * Waits until the indicated thread's routine has finished. * Returns the value returned by the thread routine. */ PUBLIC uintptr_t csoundJoinThread(void *thread); /** * Creates and returns a monitor object, or NULL if not successful. * The object is initially in signaled (notified) state. */ PUBLIC void *csoundCreateThreadLock(void); /** * Waits on the indicated monitor object for the indicated period * (the timeout is not implemented on some platforms, so any non-zero * value may possibly request infinite wait time). * The function returns either when the monitor object is notified, * or when the period has elapsed, whichever is sooner; in the first case, * zero is returned. * If 'milliseconds' is zero and the object is not notified, the function * will return immediately with a non-zero status. */ PUBLIC int csoundWaitThreadLock(void *lock, size_t milliseconds); /** * Waits on the indicated monitor object until it is notified. * This function is similar to csoundWaitThreadLock() with an infinite * wait time, but may be more efficient. */ PUBLIC void csoundWaitThreadLockNoTimeout(void *lock); /** * Notifies the indicated monitor object. */ PUBLIC void csoundNotifyThreadLock(void *lock); /** * Destroys the indicated monitor object. */ PUBLIC void csoundDestroyThreadLock(void *lock); /** * Waits for at least the specified number of milliseconds, * yielding the CPU to other threads. */ PUBLIC void csoundSleep(size_t milliseconds); ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-09-05 20:13 |
From | Iain Duncan |
Subject | Re: [Cs-dev] Error with api using new build |
Thanks for the explanation. Iain Istvan Varga wrote: > Iain Duncan wrote: > >> Also, how is that my host is now incorrect? Have there been api >> changes that make it wrong now? > > > As Csound 5 is not released yet, the API is subject to incompatible > changes; fortunately most of those have already been made, but you can > only consider it stable once there is an "official" release that is > no longer beta. I do suspect though that some people waiting for the > final release will only then complain about things that could have been > done better. > In this particular case, your host is affected by changes to the > thread wrapper functions (see below); also, the Csound instance pointer > type that previously used to be sometimes void* and other times ENVIRON* > (or even struct ENVIRON_*) is now consistently CSOUND*, but this affects > only sources and not binary compatibility. > > /** > * Creates and starts a new thread of execution. > * Returns an opaque pointer that represents the thread on success, > * or NULL for failure. > * The userdata pointer is passed to the thread routine. > */ > PUBLIC void *csoundCreateThread(uintptr_t (*threadRoutine)(void *), > void *userdata); > > /** > * Waits until the indicated thread's routine has finished. > * Returns the value returned by the thread routine. > */ > PUBLIC uintptr_t csoundJoinThread(void *thread); > > /** > * Creates and returns a monitor object, or NULL if not successful. > * The object is initially in signaled (notified) state. > */ > PUBLIC void *csoundCreateThreadLock(void); > > /** > * Waits on the indicated monitor object for the indicated period > * (the timeout is not implemented on some platforms, so any non-zero > * value may possibly request infinite wait time). > * The function returns either when the monitor object is notified, > * or when the period has elapsed, whichever is sooner; in the first > case, > * zero is returned. > * If 'milliseconds' is zero and the object is not notified, the function > * will return immediately with a non-zero status. > */ > PUBLIC int csoundWaitThreadLock(void *lock, size_t milliseconds); > > /** > * Waits on the indicated monitor object until it is notified. > * This function is similar to csoundWaitThreadLock() with an infinite > * wait time, but may be more efficient. > */ > PUBLIC void csoundWaitThreadLockNoTimeout(void *lock); > > /** > * Notifies the indicated monitor object. > */ > PUBLIC void csoundNotifyThreadLock(void *lock); > > /** > * Destroys the indicated monitor object. > */ > PUBLIC void csoundDestroyThreadLock(void *lock); > > /** > * Waits for at least the specified number of milliseconds, > * yielding the CPU to other threads. > */ > PUBLIC void csoundSleep(size_t milliseconds); > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices > Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |