Code Monkey home page Code Monkey logo

Comments (12)

isaacs avatar isaacs commented on July 19, 2024
  1. what version of glob are you using?
  2. what operating system?
  3. what version of node?
  4. I'm pretty sure */.js is not going to match anything. Sure you didn't mean *.js?

from node-glob.

cjohansen avatar cjohansen commented on July 19, 2024

🤦 Sorry for the noob bug report.

  1. 2.0.6
  2. Linux Mint (Ubuntu 10.10)
  3. 0.4.0
  4. Hmm, think Github mangled my pattern. */.js is meaningless, and it doesn't trigger the segfault. The pattern I tried was **/*.js

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Ok, cool. See if the problem goes away by upgrading node to 0.4.5 (it might).

I'm going to port glob to be just in js soon. It won't be quite as fast, but it will be way more stable and portable that way.

from node-glob.

cjohansen avatar cjohansen commented on July 19, 2024

Still have the problem on node 0.4.5. It's interesting; it really doesn't want that pattern - glob("./**/*.js") also segfaults, while somedir/**/*.js does not.

Porting to JavaScript: +1 :)

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

You could maybe do path.resolve("./**/*.js") then, in the meantime.

If you could run it in gdb, I'd love a stack trace. Otherwise closing this for now.

from node-glob.

cjohansen avatar cjohansen commented on July 19, 2024

If you want to tell a gdb noob how, and I'd love to help :)

Interestingly, the path.resolve approach also segfaults. Maybe it just hates my directory? :)

from node-glob.

isaacs avatar isaacs commented on July 19, 2024
echo 'require("glob").glob("./**/*.js", function (er, paths) { console.error(er, paths) })' > g.js
gdb node
# in gdb:
set args g.js
run

The "help" command is helpful :)

from node-glob.

cjohansen avatar cjohansen commented on July 19, 2024

Heh, seems this bug report is here to make me look bad... Sorry.

Reading symbols from /home/christian/local/bin/node...done.
(gdb) set args g.js
(gdb) run
Starting program: /home/christian/local/bin/node g.js
[Thread debugging using libthread_db enabled]
[New Thread 0x7fffd1f42700 (LWP 8183)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd1f42700 (LWP 8183)]
0x00007fffd1f4a16b in g_lstat (fn=0x0, sb=0x0, pglob=0x0) at ../deps/glob/glob.c:1156
1156 {

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Ah, right, so, at that point, do this:

(gdb) backtrace

I can repro this on my linux box (was missing something obvious before). Here's what I'm seeing:

#0  0x00007fffd1f9a4d1 in g_lstat (fn=0x0, sb=0x0, pglob=0x0) at ../deps/glob/glob.c:1156
#1  0x00007fffd1f998e8 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e8e, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae9a, restpattern=0x7ffff7e1aea2, 
    pglobstar=0x7ffff7e1aea2, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:827
#2  0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e8e, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae9a, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#3  0x00007fffd1f9983f in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e8e, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:821
#4  0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e8e, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#5  0x00007fffd1f99d26 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e7c, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:931
#6  0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e7c, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#7  0x00007fffd1f99d26 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e74, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:931
#8  0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e74, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#9  0x00007fffd1f99d26 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e64, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:931
#10 0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e64, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#11 0x00007fffd1f99d26 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e58, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:931
#12 0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e58, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#13 0x00007fffd1f99d26 in glob3 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e44, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, restpattern=0x7ffff7e1ae98, 
    pglobstar=0x7ffff7e1ae94, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:931
#14 0x00007fffd1f99652 in glob2 (pathbuf=0x7ffff7e18e40, pathend=0x7ffff7e18e44, pathlim=0x7ffff7e1ae40, pattern=0x7ffff7e1ae94, pglob=0xc16490, 
    limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:766
#15 0x00007fffd1f991ea in glob1 (pattern=0x7ffff7e1ae90, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:670
#16 0x00007fffd1f99063 in glob0 (pattern=0x7ffff7e1cf50, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:616
#17 0x00007fffd1f98697 in globexp1 (pattern=0x7ffff7e1cf50, pglob=0xc16490, limit=0x7ffff7e1ef60) at ../deps/glob/glob.c:333
#18 0x00007fffd1f985aa in myglob (pattern=0xbe46c8 "./**/*.js", flags=33920, errfunc=0, pglob=0xc16490) at ../deps/glob/glob.c:306
#19 0x00007fffd1f97269 in EIO_Glob (req=0xc164f0) at ../src/glob.cc:86
#20 0x0000000000542890 in eio_execute (thr_arg=<value optimized out>) at ../deps/libeio/eio.c:1826
#21 etp_proc (thr_arg=<value optimized out>) at ../deps/libeio/eio.c:1635
#22 0x00007ffff683aa04 in start_thread () from /lib/libpthread.so.0
#23 0x00007ffff65a3d4d in clone () from /lib/libc.so.6
#24 0x0000000000000000 in ?? ()

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Yeah, solution is just to write this in JS.

from node-glob.

cjohansen avatar cjohansen commented on July 19, 2024

Cool. Thanks for being so helpful!

from node-glob.

isaacs avatar isaacs commented on July 19, 2024

Will be solved by #23

from node-glob.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.