Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

segfault on page.uploadFile() #10694

Closed
ariya opened this issue Aug 6, 2012 · 6 comments
Closed

segfault on page.uploadFile() #10694

ariya opened this issue Aug 6, 2012 · 6 comments
Labels

Comments

@ariya
Copy link
Owner

ariya commented Aug 6, 2012

dieterpl...@gmail.com commented:

version 1.6.1 (built it myself with ./build.sh), on arch linux 64bit.

i can consistently reproduce a segfault with this file:
testcase.js:
var system = require('system');
var page = new WebPage();

var url = system.args[1];
var input_name = system.args[2];
var file_path = system.args[3];

page.open(url, function (status) {
if (status !== "success") {
console.log('OPEN_ERROR', 'unable to open ', url);
} else {
page.uploadFile('input[name='+input_name+']', file_path);
}
});

gdb session:
simple-black-box ❯ gdb phantomjs
GNU gdb (GDB) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/phantomjs...(no debugging symbols found)...done.
(gdb) run testcase.js http://localhost:8080 file_selector /tmp/tmp.pEZuQAMJss
Starting program: /usr/bin/phantomjs testcase.js http://localhost:8080 file_selector /tmp/tmp.pEZuQAMJss
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
no
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.3200.4-gdb.py", line 9, in <module>
from gobject import register
File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in <module>
import gdb.backtrace
ImportError: No module named backtrace
[New Thread 0x7ffff0f0b700 (LWP 13759)]
[New Thread 0x7ffff060a700 (LWP 13760)]
[New Thread 0x7fffef386700 (LWP 13761)]
[New Thread 0x7fffa7fff700 (LWP 13763)]

Program received signal SIGSEGV, Segmentation fault.
QIODevice::read (this=this@entry=0x0, data=0x99fb78 "", maxSize=maxSize@entry=16384) at io/qiodevice.cpp:769
769 Q_D(QIODevice);
(gdb) no
(gdb) bt

0 ?? () at io/qiodevice.cpp:769

1 0x00007ffff4e118fe in ?? ()

2 0x00007ffff6e9e0ac in ?? ()

3 0x000000000099fb60 in ?? ()

4 0x0000000000000000 in ?? ()

(gdb)

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #694.
🌟   2 people had starred this issue at the time of migration.

@ariya
Copy link
Owner Author

ariya commented Aug 6, 2012

dieterpl...@gmail.com commented:

commenting the page.uploadFile() stops the segfault from happening.

@ariya
Copy link
Owner Author

ariya commented Aug 10, 2012

dieterpl...@gmail.com commented:

I just noticed apparently I had debug symbols disabled.
I recompiled and made sure both phantomjs as its qt dependencies have debug symbols enabled, and this is the new output, unfortunately not much clearer:

simple-black-box ❯ gdb phantomjs
GNU gdb (GDB) 7.4.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/...
Reading symbols from /usr/bin/phantomjs...done.
(gdb) run testcase.js http://localhost:8080 file_selector /home/dieter/tabula_V14nomast.mp3
Starting program: /usr/bin/phantomjs testcase.js http://localhost:8080 file_selector /home/dieter/tabula_V14nomast.mp3
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
no
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Traceback (most recent call last):
File "/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.3200.4-gdb.py", line 9, in
from gobject import register
File "/usr/share/glib-2.0/gdb/gobject.py", line 3, in
import gdb.backtrace
ImportError: No module named backtrace
[New Thread 0x7ffff0f0b700 (LWP 18624)]
[New Thread 0x7ffff060a700 (LWP 18625)]
[New Thread 0x7fffef386700 (LWP 18627)]
[New Thread 0x7fffa7fff700 (LWP 18628)]

Program received signal SIGSEGV, Segmentation fault.
QIODevice::read (this=this@entry=0x0, data=0x9b9b68 "", maxSize=maxSize@entry=16384) at io/qiodevice.cpp:769
769 Q_D(QIODevice);
(gdb) no
(gdb) bt
#0 ?? () at io/qiodevice.cpp:769
#1 0x00007ffff4e118fe in ?? ()
#2 0x00007ffff6e9e0ac in ?? ()
#3 0x00000000009b9b50 in ?? ()
#4 0x0000000000000000 in ?? ()
(gdb)

@ariya
Copy link
Owner Author

ariya commented Mar 8, 2013

martin.h...@gmail.com commented:

I have the same problem with using Poltergeist and PhantomJS 1.8.2 installed from Homebrew on Mac OS X ML 10.8.2. In my case but it happens randomly.

@jk779
Copy link

jk779 commented Mar 20, 2013

Using Arch and PhantomJS 1.8.2, PhantomJS withing poltergeist also crashes here in 1/3 of my rails rspec test-suite runs. It's using a lot of upload testing.
Compiled it from source, according to the (outdated) AUR with this options:

build() {
  # (...)
  # workaround for http://code.google.com/p/phantomjs/issues/detail?id=635
  sed -i 's/QMAKE_LFLAGS+=-fuse-ld=gold/#QMAKE_LFLAGS+=-fuse-ld=gold/' src/qt/src/3rdparty/webkit/Source/common.pri
 ./build.sh
}

@lencioni
Copy link

I'm also getting random segfaults with Poltergeist 1.3.0 and PhantomJS 1.9.1 on Ruby 2.0.0p195.

@ghost ghost removed old.Priority-Medium labels Dec 19, 2017
@stale stale bot added the stale label Dec 26, 2019
@stale
Copy link

stale bot commented Dec 29, 2019

Due to our very limited maintenance capacity (see #14541 for more details), we need to prioritize our development focus on other tasks. Therefore, this issue will be automatically closed. In the future, if we see the need to attend to this issue again, then it will be reopened. Thank you for your contribution!

@stale stale bot closed this as completed Dec 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants