pay someone for OpenBSD fixes?

Started by TedWalther, April 17, 2009, 04:56:44 PM

Previous topic - Next topic

TedWalther

Hi, I'm using the amd64 (64 bit multicore) version of OpenBSD.  I compile newlisp with readline and UTF8 support using the stock bsd makefile and it seems to work, though I haven't done thorough testing.



I fixed the artful code and the default MySQL modules to load the correct library, and they can both open and close the database, making a connection, but doing a query and looking at the results gives it an instant segfault.  I suspect it has something to do with sizes of datatypes, perhaps even something to do with sql.c



Is anyone willing to log in and do some debugging?  What would you want per hour?



Is it possible I just need to compile and run sql.c to produce correct values for mysql5.lsp?



You can reach me at 778-320-0644 or user "tederific" on skype.





Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#1
I did run sql.c and updated the offset values for mysql5.lsp and it didn't help.  As soon as I try to look at the results of a query, even something simple like MySQL:num-rows, makes for instant segfault.



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

newdep

#2
Hi Ted,



The segfault comes from newlisp?

Just to verify because I dont have my Linux at hand at the moment...



did you install mysql with the kernel tuning parameters?http://www.openbsdsupport.org/mysql.htm">http://www.openbsdsupport.org/mysql.htm



Is sql.c mysql5 code or is it a newlisp code..



Norman.
-- (define? (Cornflakes))

Lutz

#3
The mysql51.lsp shipped with 10.0.2 and also available here:



http://www.newlisp.org/modules/">http://www.newlisp.org/modules/



is independent of offsets and probably works not only for MySQL 5.1 but also for  earlier versions, e.g. 5.0.

TedWalther

#4
Quote from: "Lutz"The mysql51.lsp shipped with 10.0.2 and also available here:



http://www.newlisp.org/modules/">http://www.newlisp.org/modules/



is independent of offsets and probably works not only for MySQL 5.1 but also for  earlier versions, e.g. 5.0.


Thank you Lutz.  I will try that when I get internet access again on Monday.



If it is independent of offsets, could it also be independent of the whole 32bit-vs-64bit thing?



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#5
Quote from: "newdep"Hi Ted,



The segfault comes from newlisp?

Just to verify because I dont have my Linux at hand at the moment...



did you install mysql with the kernel tuning parameters?http://www.openbsdsupport.org/mysql.htm">http://www.openbsdsupport.org/mysql.htm



Is sql.c mysql5 code or is it a newlisp code..



Norman.


sql.c is in the util directory in the newlisp source.  It is used to calculate the proper offsets.



I notice the artful code mysql module does not seem to use offsets.  Lutz says the new mysql51 module doesn't rely on them either.  The artful code module segfaults, so perhaps the problem isn't with the offsets.



I didn't touch the kernel tuning parameters, but I did alter login.conf as suggested by the openbsd installation instructions.  Also, the database is running fine answering many queries per second on a live website.  I'm just hoping to add newlisp to the mix so I'm not stuck developing entirely with PHP.



The segfault definitely happened inside newlisp; doing things using the mysql client connecting to the server works fine.



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#6
Quote from: "Lutz"The mysql51.lsp shipped with 10.0.2 and also available here:



http://www.newlisp.org/modules/">http://www.newlisp.org/modules/



is independent of offsets and probably works not only for MySQL 5.1 but also for  earlier versions, e.g. 5.0.


Thank you Lutz, I just tested and it worked!



I am using OpenBSD 4.4 amd64 (running on Intel chips) with MySQL 5.0.51 installed.



Perhaps the mysql51.lsp module could just be named mysql5.lsp?



Ted
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#7
Quote from: "TedWalther"
Thank you Lutz, I just testd it and it worked!


Sorry, I was premature.  It worked more, but the essential part still doesn't work.



:init works

:connect works

:query works

:num-rows works

:num-fields works

:fetch-row segfaults

:fetch-all segfaults

:databases segfaults

:tables segfaults

:fields segfaults

:data-seek works

:affected-rows works

:inserted-id works

:error works

:escape works

:close-db works



Also, the module documentation omits the "s" from the end of the "tables" function, making it appear to be MySQL:table instead of MySQL:tables.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Lutz

#8
What makefile did you use to compile newLISP on OpenBSD / AMD64 and did it pass "make test" executed inside the distribution directory?

TedWalther

#9
Quote from: "Lutz"What makefile did you use to compile newLISP on OpenBSD / AMD64 and did it pass "make test" executed inside the distribution directory?


I used makefile_bsd and also makefile_bsd_utf8 at different times.  Both get a Signal 11 in qa-dot.  Here is more info:



 $ make -f makefile_bsd_utf8

gcc -Wall -Wno-uninitialized -O2 -c -g -DREADLINE -D_BSD -DSUPPORT_UTF8 newlisp.c

newlisp.c: In function `newlisp_completion':

newlisp.c:809: warning: implicit declaration of function `completion_matches'

newlisp.c:809: warning: return makes pointer from integer without a cast

.

.

.

gcc newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o  nl-sock.o nl-import.o nl-xml.o nl-web.o nl-matrix.o nl-debug.o nl-utf8.o pcre.o -g -lm -lreadline -lncurses -o newlisp

newlisp.o(.text+0xc3d): In function `command_generator':

/data/local/newlisp-10.0.2/newlisp.c:795: warning: strcpy() is almost always misused, please use strlcpy()

newlisp.o(.text+0x2a1): In function `loadStartup':

/data/local/newlisp-10.0.2/newlisp.c:445: warning: strcat() is almost always misused, please use strlcat()

strip newlisp

m6 $ make test

./newlisp qa-dot



Testing built-in functions ...

*** Signal 11



Stop in /data/local/newlisp-10.0.2 (line 239 of Makefile).
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#10
>>>>> THE CILK API TESTED SUCESSFULL

.

get-char get-float get-int Segmentation fault (core dumped)

.

>>>>> DICTIONARY API TESTED SUCCESSFUL

.

Testing built-in functions ...

Segmentation fault (core dumped)

.

mandelbrot text image came up nicely

.

4990000 kbytes written



ERR: symbol expected in function read-buffer

.

net-peek: 11

HELLO WORLD: Ok

.

>>>>> NETWORK EVAL AND NETWORK FILE FUNCTIONS SUCCESSFUL

.

process 1

.

>>>>> REFERENCE TESTING SUCCESSFUL

.

>>>>> SIGNAL TESTING SUCCESSFUL

.

Step 5



ERR: user error : Expression failed! (not (rename-file UnicodeStr InvalidUTF8))

.

Yiddish:××× ×§×¢× ×¢×¡× ×××60</PRICE>

.

>>>>> XML CALLBACK TESTED SUCCESSFUL
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Lutz

#11
In makefile_bsd change the CFLAGS and CC line to:


CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -
DREADLINE -D_BSD
...
$(CC) $(OBJS) -m32 -g -lm -lreadline -lncurses -o newlisp


this will force a 32Bit app on a 64bit CPU then try "make test" again (note that "make test" does not run all qa-* files). Also, there is a TAB character before $(CC) in order for the makefile to work.



ps: mysql51.lsp as a test routine too. After loading the module do:
(test-mysql)

TedWalther

#12
Quote from: "Lutz"In makefile_bsd change the CFLAGS and CC line to:


CFLAGS = -m32 -Wall -Wno-uninitialized -fno-strict-aliasing -O2 -c -g -
DREADLINE -D_BSD
...
$(CC) $(OBJS) -m32 -g -lm -lreadline -lncurses -o newlisp


this will force a 32Bit app on a 64bit CPU then try "make test" again (note that "make test" does not run all qa-* files). Also, there is a TAB character before $(CC) in order for the makefile to work.



ps: mysql51.lsp as a test routine too. After loading the module do:
(test-mysql)


Tried that, then also tried the -melf_i386_obsd option at the link stage.  It doesn't link because the 32 bit toolchain and libraries are missing.  Then I found out that OpenBSD doesn't support a mixed 64/32 bit system.  It is all one or the other.  If you'd like a login account to try this, let me know.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

Lutz

#13
Try the makefile posted here (make sure TABs don't get lost, make will complain, use the download option in your browser):



http://www.newlisp.org/downloads/development/makefile_bsdLP64">http://www.newlisp.org/downloads/develo ... le_bsdLP64">http://www.newlisp.org/downloads/development/makefile_bsdLP64



it is full 64 bit (basically added the -m64 option and the -DNEWLISP64 flag)



when you used the original makefile_bsd, it probably already tried to compile for 64 bit already but had the -DNEWLISP64 missing in the CFLAGS line. This then caused the segfaults in some of the functions.

TedWalther

#14
Quote from: "Lutz"Try the makefile posted here (make sure TABs don't get lost, make will complain, use the download option in your browser):



http://www.newlisp.org/downloads/development/makefile_bsdLP64">http://www.newlisp.org/downloads/develo ... le_bsdLP64">http://www.newlisp.org/downloads/development/makefile_bsdLP64



it is full 64 bit (basically added the -m64 option and the -DNEWLISP64 flag)



when you used the original makefile_bsd, it probably already tried to compile for 64 bit already but had the -DNEWLISP64 missing in the CFLAGS line. This then caused the segfaults in some of the functions.


Wow, that's beautiful.  Passes all tests with flying colors.



When I add UTF8 into the mix, some of the tests fail, so I backed it out again:



>>>>> TESTING: ./newlisp FINISHED WITH ERRORS:



UTF-8 upper-case: failed

UTF-8 lower-case: failed



Back to the mysql51 module, it still segfaults same as before.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.