bug-oleo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: command line version also has bugs


From: Pete Wyckoff
Subject: Re: command line version also has bugs
Date: Tue, 28 Jan 2003 19:59:29 -0500

address@hidden said:
> This seems more serious: 
> 
> % oleo -t
> dyld: oleo multiple definitions of symbol _instr oleo definition of _instr
> /sw/lib/libncurses.5.dylib(lib_gen.lo) definition of _instr Trace/BPT trap
> 
> And then it doesn't start.  Similarly for the -x option. 
> 
> Am I doing something wrong?  More likely, was Fink doing something wrong?

Definitely serious.  Unfortunately I have no access to a cygwin at the
moment, and my oleo tree is a mess.  But if you're feeling adventurous,
you could help track this down.

First, let's see what symbols ended up in likely places:

    $ cd oleo
    $ objdump -t src/lex.o | fgrep inst
    00000004       O *COM*  00000004 instr

    $ objdump -T /lib/libncurses.so.3.4 | fgrep -i instr
    00014a40 g    DF .text  0000002b instr
    ...

(Use /sw/lib/libncurses.5.dynlib on your machine, perhaps.)
They shouldn't collide since they're not both .text, but perhaps
your linker behaves differently.

Just grasping at straws, but perhaps the instr() from curses is
fighting with the char* variable in oleo.  Can you apply this patch,
recompile, and see if it magically fixes itself?  It continues to
work here, at least.

                -- Pete

Index: src/global.h
===================================================================
RCS file: /cvsroot/oleo/oleo/src/global.h,v
retrieving revision 1.20
diff -u -r1.20 global.h
--- src/global.h        14 Feb 2001 20:54:50 -0000      1.20
+++ src/global.h        29 Jan 2003 00:40:16 -0000
@@ -260,7 +260,9 @@
 
 extern char *new_value (CELLREF, CELLREF, char *);
 
-extern unsigned char parse_cell_or_range (char **, struct rng *);
+/* lex.c */
+extern unsigned char parse_cell_or_range(char **, struct rng *);
+extern void lex_set_instr(char *new_instr);
 
 struct var; /* in case it hasn't been declared yet */
 extern void for_all_vars (void (*)(char *, struct var *));
Index: src/lex.c
===================================================================
RCS file: /cvsroot/oleo/oleo/src/lex.c,v
retrieving revision 1.1
diff -u -r1.1 lex.c
--- src/lex.c   16 Apr 2001 00:16:21 -0000      1.1
+++ src/lex.c   29 Jan 2003 00:40:17 -0000
@@ -46,9 +46,15 @@
 extern VOIDSTAR hash_find(VOIDSTAR handle, char *string);
 
 /*
- * Callers of yyparse() will hang the input string here.
+ * Callers of yyparse() will pass the input string to this routine.
  */
-char *instr;
+static char *instr;
+
+void
+lex_set_instr(char *new_instr)
+{
+    instr = new_instr;
+}
 
 /* This table contains a list of the infix single-char functions */
 static unsigned char fnin[] = {
Index: src/byte-compile.c
===================================================================
RCS file: /cvsroot/oleo/oleo/src/byte-compile.c,v
retrieving revision 1.13
diff -u -r1.13 byte-compile.c
--- src/byte-compile.c  16 Apr 2001 00:16:21 -0000      1.13
+++ src/byte-compile.c  29 Jan 2003 00:40:17 -0000
@@ -66,7 +66,6 @@
 extern struct function mysql_functions[];
 extern struct function gsl_functions[];
 
-extern char *instr;
 extern int parse_error;
 extern struct node *parse_return;
 extern void sort ();
@@ -403,7 +402,7 @@
   int need_relax;
   int byte;
 
-  instr = string;
+  lex_set_instr(string);
   parse_error = 0;
   patches_used = 0;
   if (yyparse () || parse_error)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]