Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <58264f01db6167845914c0e02d23b57c@smtp.hushmail.com>
Date: Thu, 28 Feb 2013 20:59:43 +0100
From: magnum <john.magnum@...hmail.com>
To: john-users@...ts.openwall.com
Subject: Re: Fuzzing with regular expressions

On 28 Feb, 2013, at 19:55 , magnum <john.magnum@...hmail.com> wrote:

> On 28 Feb, 2013, at 13:37 , Jan Starke <jan.starke@...ofbed.org> wrote:
> 
>> I fixed the version detection of bison and flex, so that e.g. a
>> version 2.7 will also match.
>> 
>> I also tried to compile the code with clang (I only have 3.0), which
>> failed (with segmentation fault of clang). This evening I'll try to
>> install clang 3.3, which should have full support for C++11, which I
>> need for deque::cbegin() and deque::cend(), beyond others. You can set
>> CXX=g++ to circumvent this, so far...
> 
> Ah, I did not notice that CXX was still wrong. With that fixed and latest updates everything works as it should except I miss some lua library on OSX at final linking (not likely your fault at all). On Linux it builds fine.


I turns out I do not miss the libs on OSX, they are located in /usr/local/lib. I don't know cmake well but I think it is supposed to find stuff automatically as you're using find_library to find lua5.2. But it ends like this:

Linking CXX shared library librexgen-0.1.0.dylib
ld: library not found for -llua5.2
collect2: error: ld returned 1 exit status
make[2]: *** [librexgen/librexgen-0.1.0.dylib] Error 1
make[1]: *** [librexgen/CMakeFiles/rexgen-0.1.0.dir/all] Error 2
make: *** [all] Error 2

$ file -L /usr/local/lib/liblua.5.2.dylib
/usr/local/lib/liblua.5.2.dylib: Mach-O 64-bit dynamically linked shared library x86_64

No wait, there is an extra dot there... so I did this:
$ ln -s liblua.5.2.dylib /usr/local/lib/liblua5.2.dylib

$ make install
[100%] Built target rexgen-0.1.0
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/librexgen-0.1.0.dylib
-- Installing: /usr/local/bin/rexgen.lua

...and now it works. I'm not sure whether this was a problem with cmake itself or your cmake magic, or even my lua installation.

Next problem:

$ rexgen 'abc[0-9]'
-bash: /usr/local/bin/rexgen: /usr/bin/lua5.2: bad interpreter: No such file or directory

OK so hardcoded somewhere?

$ git grep 'bin/lua' ..
../rexgen/rexgen_tmpl.lua:#!/usr/bin/lua5.2

Naughty. Also, I only have /usr/local/bin/lua so I changed the shebang to:

-#!/usr/bin/lua5.2
+#!/usr/bin/env lua

Maybe some cmake magic could do that in a canonical way. Anway this just lead to the next obstacle :-)

$ rexgen 'abc[0-9]'
lua: /usr/local/bin/rexgen:3: module 'rexgen' not found:
	no field package.preload['rexgen']
	no file '/usr/local/share/lua/5.2/rexgen.lua'
	no file '/usr/local/share/lua/5.2/rexgen/init.lua'
	no file '/usr/local/lib/lua/5.2/rexgen.lua'
	no file '/usr/local/lib/lua/5.2/rexgen/init.lua'
	no file './rexgen.lua'
	no file '/usr/local/lib/librexgen.so'
stack traceback:
	[C]: in function 'require'
	/usr/local/bin/rexgen:3: in main chunk
	[C]: in ?

$ find /usr/local -name "rexgen*"
/usr/local/bin/rexgen
/usr/local/bin/rexgen.lua

Now I'm not quite sure what to do. Did it try to find itself and failed? I must be close now :-P

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.