* AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer
@ 2006-02-28 15:35 Roderik_Wildenburg
2006-02-28 16:27 ` Heikki Lindholm
0 siblings, 1 reply; 5+ messages in thread
From: Roderik_Wildenburg @ 2006-02-28 15:35 UTC (permalink / raw)
To: holindho; +Cc: xenomai
You are right, but who is somebody ? The example definitly does not call any xchg-function directly. The only thing I did, was to activate debugging and recompile all the libraries (make clean; configure --debug-enable; make ) and soon I get this error message when compiling the demo (I don´t get an error message when debugging is disabled) . Amazingly I don´t get this error message when compiling the native examples (ksrc/skins/native/demos) (debug enabled).
Any ideas ?
Roderik
> -----Ursprüngliche Nachricht-----
> Von: xenomai-help-bounces@domain.hid
> [mailto:xenomai-help-bounces@domain.hid] Im Auftrag von Heikki Lindholm
> Gesendet: Dienstag, 28. Februar 2006 15:48
> An: Wildenburg, Roderik RAEK3 MRA
> Cc: xenomai@xenomai.org
> Betreff: Re: [Xenomai-help] undefinedreference
> __xnarch_xchg_called_with_bad_pointer
>
> Roderik_Wildenburg@domain.hid kirjoitti:
> > Dear Gurus,
> >
> > I have compiled ppc(!)-xenomai with debug information
> (configure --enable-debug), so far so good (compiling of
> xenomai itself and it´s libraries, testsuite etc. was successful).
> > Buuuut ..., when compiling the vxWorks-demos
> (ksrc/skins/vxworks/demos/*.c), I get an error message about
> an undefined refernce __xnarch_xchg_called_with_bad_pointer.
> I searched for this mysterious function, but could only find
> it in asm-powerpc/atomic.h, where it is declared as external
> (extern void __xnarch_xchg_called_with_bad_pointer(void);).
> >
> > Does anybody know, where I can get the implementation of
> this function, or what I have to do else to get rid of the
> error message ?
>
> You might also want to read the comment near the extern
> declaration of the function in atomic.h, where it says that
> the function is not even intended to be implemented. The
> error means somebody called *atomic_xchg with wrong arguments
> (or there's something else wrong like inlines not working).
>
> -- Heikki Lindholm
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer
2006-02-28 15:35 AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer Roderik_Wildenburg
@ 2006-02-28 16:27 ` Heikki Lindholm
2006-02-28 18:27 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Heikki Lindholm @ 2006-02-28 16:27 UTC (permalink / raw)
To: Roderik_Wildenburg; +Cc: xenomai
Uh. I guess the compiler isn't killing the *_bad_pointer function as
dead code when debug is enabled (although it is dead-code.) As a
work-around, I think, you could just comment the line, where
*_bad_pointer is called.
-- Heikki Lindholm
Roderik_Wildenburg@domain.hid kirjoitti:
> You are right, but who is somebody ? The example definitly does not call any xchg-function directly. The only thing I did, was to activate debugging and recompile all the libraries (make clean; configure --debug-enable; make ) and soon I get this error message when compiling the demo (I don´t get an error message when debugging is disabled) . Amazingly I don´t get this error message when compiling the native examples (ksrc/skins/native/demos) (debug enabled).
> Any ideas ?
>
> Roderik
>
>
>
>
>>-----Ursprüngliche Nachricht-----
>>Von: xenomai-help-bounces@domain.hid
>>[mailto:xenomai-help-bounces@domain.hid] Im Auftrag von Heikki Lindholm
>>Gesendet: Dienstag, 28. Februar 2006 15:48
>>An: Wildenburg, Roderik RAEK3 MRA
>>Cc: xenomai@xenomai.org
>>Betreff: Re: [Xenomai-help] undefinedreference
>>__xnarch_xchg_called_with_bad_pointer
>>
>>Roderik_Wildenburg@domain.hid kirjoitti:
>>
>>>Dear Gurus,
>>>
>>>I have compiled ppc(!)-xenomai with debug information
>>
>>(configure --enable-debug), so far so good (compiling of
>>xenomai itself and it´s libraries, testsuite etc. was successful).
>>
>>>Buuuut ..., when compiling the vxWorks-demos
>>
>>(ksrc/skins/vxworks/demos/*.c), I get an error message about
>>an undefined refernce __xnarch_xchg_called_with_bad_pointer.
>>I searched for this mysterious function, but could only find
>>it in asm-powerpc/atomic.h, where it is declared as external
>>(extern void __xnarch_xchg_called_with_bad_pointer(void);).
>>
>>>Does anybody know, where I can get the implementation of
>>
>>this function, or what I have to do else to get rid of the
>>error message ?
>>
>>You might also want to read the comment near the extern
>>declaration of the function in atomic.h, where it says that
>>the function is not even intended to be implemented. The
>>error means somebody called *atomic_xchg with wrong arguments
>>(or there's something else wrong like inlines not working).
>>
>>-- Heikki Lindholm
>>
>>_______________________________________________
>>Xenomai-help mailing list
>>Xenomai-help@domain.hid
>>https://mail.gna.org/listinfo/xenomai-help
>>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer
2006-02-28 16:27 ` Heikki Lindholm
@ 2006-02-28 18:27 ` Philippe Gerum
2006-02-28 19:06 ` Heikki Lindholm
0 siblings, 1 reply; 5+ messages in thread
From: Philippe Gerum @ 2006-02-28 18:27 UTC (permalink / raw)
To: Heikki Lindholm; +Cc: xenomai
Heikki Lindholm wrote:
> Uh. I guess the compiler isn't killing the *_bad_pointer function as
> dead code when debug is enabled (although it is dead-code.)
The optimizer is disabled by --enable-debug so that we don't get strange jumps
while tracing with GDB, I guess that's why the dead code is not eliminated. What
about just killing this check, since the same code is already validated when
compiling it as a kernel module? (except asm-uvm/system.h, but that's not important).
As a
> work-around, I think, you could just comment the line, where
> *_bad_pointer is called.
>
> -- Heikki Lindholm
>
> Roderik_Wildenburg@domain.hid kirjoitti:
>
>> You are right, but who is somebody ? The example definitly does not
>> call any xchg-function directly. The only thing I did, was to activate
>> debugging and recompile all the libraries (make clean; configure
>> --debug-enable; make ) and soon I get this error message when
>> compiling the demo (I don´t get an error message when debugging is
>> disabled) . Amazingly I don´t get this error message when compiling
>> the native examples (ksrc/skins/native/demos) (debug enabled).
>> Any ideas ?
>>
>> Roderik
>>
>>
>>
>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: xenomai-help-bounces@domain.hid
>>> [mailto:xenomai-help-bounces@domain.hid] Im Auftrag von Heikki Lindholm
>>> Gesendet: Dienstag, 28. Februar 2006 15:48
>>> An: Wildenburg, Roderik RAEK3 MRA
>>> Cc: xenomai@xenomai.org
>>> Betreff: Re: [Xenomai-help] undefinedreference
>>> __xnarch_xchg_called_with_bad_pointer
>>>
>>> Roderik_Wildenburg@domain.hid kirjoitti:
>>>
>>>> Dear Gurus,
>>>>
>>>> I have compiled ppc(!)-xenomai with debug information
>>>
>>>
>>> (configure --enable-debug), so far so good (compiling of xenomai
>>> itself and it´s libraries, testsuite etc. was successful).
>>>
>>>> Buuuut ..., when compiling the vxWorks-demos
>>>
>>>
>>> (ksrc/skins/vxworks/demos/*.c), I get an error message about an
>>> undefined refernce __xnarch_xchg_called_with_bad_pointer. I searched
>>> for this mysterious function, but could only find it in
>>> asm-powerpc/atomic.h, where it is declared as external (extern void
>>> __xnarch_xchg_called_with_bad_pointer(void);).
>>>
>>>> Does anybody know, where I can get the implementation of
>>>
>>>
>>> this function, or what I have to do else to get rid of the error
>>> message ?
>>>
>>> You might also want to read the comment near the extern declaration
>>> of the function in atomic.h, where it says that the function is not
>>> even intended to be implemented. The error means somebody called
>>> *atomic_xchg with wrong arguments (or there's something else wrong
>>> like inlines not working).
>>>
>>> -- Heikki Lindholm
>>>
>>> _______________________________________________
>>> Xenomai-help mailing list
>>> Xenomai-help@domain.hid
>>> https://mail.gna.org/listinfo/xenomai-help
>>>
>
>
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
>
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer
2006-02-28 18:27 ` Philippe Gerum
@ 2006-02-28 19:06 ` Heikki Lindholm
2006-03-01 8:04 ` Philippe Gerum
0 siblings, 1 reply; 5+ messages in thread
From: Heikki Lindholm @ 2006-02-28 19:06 UTC (permalink / raw)
To: Philippe Gerum; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 760 bytes --]
Philippe Gerum kirjoitti:
> Heikki Lindholm wrote:
>
>> Uh. I guess the compiler isn't killing the *_bad_pointer function as
>> dead code when debug is enabled (although it is dead-code.)
>
>
> The optimizer is disabled by --enable-debug so that we don't get strange
> jumps while tracing with GDB, I guess that's why the dead code is not
> eliminated. What about just killing this check, since the same code is
> already validated when compiling it as a kernel module? (except
> asm-uvm/system.h, but that's not important).
Yep. That seems like the way to go. I don't see much to gain from the
check. Of course, paranoid way would be to add the __bad_ptr() function
with abort() or something inside. Quick patch attached for the former case.
- hl
[-- Attachment #2: xeno-atomic-badptr.patch --]
[-- Type: text/plain, Size: 550 bytes --]
--- atomic.h.orig 2006-02-28 21:01:59.000000000 +0200
+++ atomic.h 2006-02-28 21:01:34.000000000 +0200
@@ -142,12 +142,6 @@
}
#endif
-/*
- * This function doesn't exist, so you'll get a linker error
- * if something tries to do an invalid xchg().
- */
-extern void __xnarch_xchg_called_with_bad_pointer(void);
-
static __inline__ unsigned long
__xchg(volatile void *ptr, unsigned long x, unsigned int size)
{
@@ -159,7 +153,6 @@
return __xchg_u64(ptr, x);
#endif
}
- __xnarch_xchg_called_with_bad_pointer();
return x;
}
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer
2006-02-28 19:06 ` Heikki Lindholm
@ 2006-03-01 8:04 ` Philippe Gerum
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Gerum @ 2006-03-01 8:04 UTC (permalink / raw)
To: Heikki Lindholm; +Cc: xenomai
Heikki Lindholm wrote:
> Philippe Gerum kirjoitti:
>
>> Heikki Lindholm wrote:
>>
>>> Uh. I guess the compiler isn't killing the *_bad_pointer function as
>>> dead code when debug is enabled (although it is dead-code.)
>>
>>
>>
>> The optimizer is disabled by --enable-debug so that we don't get
>> strange jumps while tracing with GDB, I guess that's why the dead code
>> is not eliminated. What about just killing this check, since the same
>> code is already validated when compiling it as a kernel module?
>> (except asm-uvm/system.h, but that's not important).
>
>
> Yep. That seems like the way to go. I don't see much to gain from the
> check. Of course, paranoid way would be to add the __bad_ptr() function
> with abort() or something inside. Quick patch attached for the former case.
Applied, thanks.
>
> - hl
>
>
> ------------------------------------------------------------------------
>
> --- atomic.h.orig 2006-02-28 21:01:59.000000000 +0200
> +++ atomic.h 2006-02-28 21:01:34.000000000 +0200
> @@ -142,12 +142,6 @@
> }
> #endif
>
> -/*
> - * This function doesn't exist, so you'll get a linker error
> - * if something tries to do an invalid xchg().
> - */
> -extern void __xnarch_xchg_called_with_bad_pointer(void);
> -
> static __inline__ unsigned long
> __xchg(volatile void *ptr, unsigned long x, unsigned int size)
> {
> @@ -159,7 +153,6 @@
> return __xchg_u64(ptr, x);
> #endif
> }
> - __xnarch_xchg_called_with_bad_pointer();
> return x;
> }
>
--
Philippe.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-03-01 8:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-28 15:35 AW: [Xenomai-help] undefinedreference __xnarch_xchg_called_with_bad_pointer Roderik_Wildenburg
2006-02-28 16:27 ` Heikki Lindholm
2006-02-28 18:27 ` Philippe Gerum
2006-02-28 19:06 ` Heikki Lindholm
2006-03-01 8:04 ` Philippe Gerum
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.