On 4/29/2012 9:51 AM, John Morris wrote:
> With the attached patch, I can now use gdb to get through to the fork of
> rtapi_app and watch it segfault.
>

Very nice!

In the "I'd rather be lucky than good" category, I may have found a fix
although I don't know *WHY* it works.  Perhaps your gdb prowess will
shed some light on this.

I got tired of stepping past a bunch of rtapi_print* calls with the
level set to RTAPI_MSG_DEBUG and not seeing any console output even
though I'm calling halcmd with the -V option.  So, instead of trying to
figure out how to actually get messages to print, I just hacked the
default_rtapi_msg_handler routine to just dump everything to stdout,
regardless of the message level (minor patch below).

The AMAZING thing is I can now "sudo scripts/latency-test" and IT WORKS!!!

So...any idea why switching some debugging prints from stderr to stdout
might fix things?  Is stderr even properly defined anywhere (normally I
expect the stderr output to show up on-screen, but it hasn't been and I
have not yet tried tracking down where it's actually going).

Patch attached.  If the list eats it, just comment out lines 171, 173,
and 174 in /src/rtapi/linux_common.h (patch reproduced below, but
probably with line wrapping issues):

diff --git a/src/rtapi/linux_common.h b/src/rtapi/linux_common.h
index 12fe04c..b8e04e6 100644
--- a/src/rtapi/linux_common.h
+++ b/src/rtapi/linux_common.h
@@ -168,10 +168,10 @@ int rtapi_shmem_delete(int handle, int module_id)

 void default_rtapi_msg_handler(msg_level_t level, const char *fmt,
va_list ap)
 {
-    if (level == RTAPI_MSG_ALL)
+//    if (level == RTAPI_MSG_ALL)
        vfprintf(stdout, fmt, ap);
-     else
-        vfprintf(stderr, fmt, ap);
+//     else
+//      vfprintf(stderr, fmt, ap);
 }

 static rtapi_msg_handler_t rtapi_msg_handler = default_rtapi_msg_handler;

-- 
Charles Steinkuehler
char...@steinkuehler.net
diff --git a/src/rtapi/linux_common.h b/src/rtapi/linux_common.h
index 12fe04c..b8e04e6 100644
--- a/src/rtapi/linux_common.h
+++ b/src/rtapi/linux_common.h
@@ -168,10 +168,10 @@ int rtapi_shmem_delete(int handle, int module_id)
 
 void default_rtapi_msg_handler(msg_level_t level, const char *fmt, va_list ap)
 {
-    if (level == RTAPI_MSG_ALL)
+//    if (level == RTAPI_MSG_ALL)
        vfprintf(stdout, fmt, ap);
-     else
-        vfprintf(stderr, fmt, ap);
+//     else
+//      vfprintf(stderr, fmt, ap);
 }
 
 static rtapi_msg_handler_t rtapi_msg_handler = default_rtapi_msg_handler;

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to