Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Preload . causes SIGSEGV #95

Closed
jleahy opened this Issue Jan 29, 2013 · 3 comments

Comments

Projects
None yet
2 participants

jleahy commented Jan 29, 2013

I wasn't able to extract a line number, but I got this stack trace.

(gdb) info threads
* 4 Thread 0x7ffff69b4700 (LWP 26328)  0x000000000046ff0f in get_path_list ()
  3 Thread 0x7ffff73b5700 (LWP 26327)  0x00000036d8a0e54d in read () from /lib64/libpthread.so.0
  2 Thread 0x7ffff7db6700 (LWP 26321)  0x00000036d8a0e54d in read () from /lib64/libpthread.so.0
  1 Thread 0x7ffff7db8700 (LWP 26317)  0x00000036d8a0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
(gdb) where
#0  0x000000000046ff0f in get_path_list ()
#1  0x0000000000473c19 in parse_tupfile ()
#2  0x00000000004718f5 in parse ()
#3  0x000000000041713a in create_work ()
#4  0x00000036d8a07851 in start_thread () from /lib64/libpthread.so.0
#5  0x00000036d86e811d in clone () from /lib64/libc.so.6

To reproduce:

mkdir test
cd test
echo preload . > Tupfile
tup init
tup upd

Owner

gittup commented Jan 29, 2013

On Tue, Jan 29, 2013 at 3:12 PM, Joshua Leahy notifications@github.comwrote:

I wasn't able to extract a line number, but I got this stack trace.

(gdb) info threads

To reproduce:

mkdir test
cd test
echo preload . > Tupfile
tup init
tup upd

Hi Joshua,

I think this is now fixed. It would also segfault if '.' was used as an
input in a :-rule, which is also fixed.

Also I am curious: what are you using run-scripts for? Have you tried the
lua port to see if that is more usable?

Thanks for reporting the issue,
-Mike

jleahy commented Jan 29, 2013

My use of run-scripts is actually a bit of a mess at the moment (as you might imagine). It's because I have series of C++ libraries that form a DAG of dependencies. Files in one library can read header files from any of the libraries it depends upon, and some of those headers might be generated by Tuprules. I used the run-script to read a 'deps' file and then generate the :-rules (adding order only dependencies for ../lib/*.hpp to all the compiles). I'd be interested to know if you can think of neater way of doing it.

I've actually also been having a problem with listing files from a run-script, readdir is only returning the sub-directories (presumably because they're auto created in the output directory), not the source files. I was going to raise another issue for that once I can find a way to reproduce it.

Where can I find the lua port you mentioned? I'd be interested in giving it a go.

Also, thanks for fixing the bug so quickly!

Owner

gittup commented Jan 29, 2013

On Tue, Jan 29, 2013 at 6:16 PM, Joshua Leahy notifications@github.comwrote:

My use of run-scripts is actually a bit of a mess at the moment (as you
might imagine). It's because I have series of C++ libraries that form a DAG
of dependencies. Files in one library can read header files from any of the
libraries it depends upon, and some of those headers might be generated by
Tuprules. I used the run-script to read a 'deps' file and then generate the
:-rules (adding order only dependencies for ../lib/*.hpp to all the
compiles). I'd be interested to know if you can think of neater way of
doing it.

One feature that may help here is 'groups', which aren't actually
documented yet. You can look at the tup/test/group.sh files for some
examples. Basically for each rule that generates a .hpp file, also list a
group as an output. You'll probably just want a single group for your
project, so it might be easiest to stick it in your root directory. Eg:

top-level/Tuprules.tup:
MY_PROJECT_ROOT = $(TUP_CWD)

some/other/Tupfile:
include_rules
: |> generate header |> foo.hpp | $(MY_PROJECT_ROOT)/

Then your compilation commands can depend on instead of
listing each .hpp file that it needs individually, like so:

another/Tupfile:
include_rules
: foreach *.cpp | $(MY_PROJECT_ROOT)/ |> compile |>

Let me know if that helps, or if you're having trouble getting it to work.

I've actually also been having a problem with listing files from a
run-script, readdir is only returning the sub-directories (presumably
because they're auto created in the output directory), not the source
files. I was going to raise another issue for that once I can find a way to
reproduce it.

I'm not really sure what you mean here - if you have a small example that
would help.

Where can I find the lua port you mentioned? I'd be interested in giving
it a go.

Rendaw has made it available here: https://github.com/Rendaw/tup

Note that it removes the existing Tupfile parser, so only the lua parser is
available. I'm currently looking at getting it merged as an alternative.

-Mike

@gittup gittup closed this Sep 26, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment