phantomjs icon indicating copy to clipboard operation
phantomjs copied to clipboard

process crash saying "pure virtual method called"

Open jart opened this issue 14 years ago • 17 comments

[email protected] commented:

PhantomJS crashes sometimes with the following error:

pure virtual method called terminate called without an active exception

Have you guys seen this before? I think it's some sort of C++ code problem. If not I can spend some time coming up with specific steps to reproduce. Here's what version I'm using:

1.7.0 (development) commit 281d291cfbdac231de4f65eb9757845a93631dd3 Author: Ariya Hidayat <[email protected]> Date: Sun Jul 15 02:13:35 2012 -0700

jart@gothpad:/usr/src/phantomjs$ uname -a Linux gothpad 3.0.0-22-generic #36-Ubuntu SMP Tue Jun 12 17:37:42 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

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

jart avatar Jul 18 '12 07:07 jart

[email protected] commented:

Hooray! I sniped issue no. 666 :D

jart avatar Jul 18 '12 07:07 jart

[email protected] commented:

I got that issue too:

{ [Error: Command failed: pure virtual method called terminate called without an active exception Aborted ] killed: false, code: 134, signal: null }

ariya avatar Sep 21 '12 15:09 ariya

[email protected] commented:

I have a service running calling a phantomjs script multiple times a minute and this fail happens from time to time and seems to recover after 30s

ariya avatar Sep 21 '12 15:09 ariya

[email protected] commented:

Any chance to try it again with the latest stable version?

ariya avatar Mar 12 '13 15:03 ariya

[email protected] commented:

the last time it happened for me it was due to a misconfigured firewall. I didn't ever get that error again since fixing the firewall.

ariya avatar Mar 12 '13 17:03 ariya

[email protected] commented:

 

 
Metadata Updates

  • Status updated: WontFix

ariya avatar Mar 12 '13 17:03 ariya

I've had reports of this happening for multiple people using jmervine/phapper via jmervine/node-yslowjs. I've been able to reproduce it on several different networks hitting (http://edition.cnn.com/). Any chance this is a real issue?

jmervine avatar Aug 21 '13 13:08 jmervine

I agree with @jmervine that this requires further investigation. Even if the cause is ultimately the firewall, the problem still isn't solved because you haven't told us what that misconfiguration may be, or how it can be fixed. But most importantly, a scripting language interpreter should never crash in native code. It should throw a JavaScript exception. Like the core Python developers would never shrug off a segfault as a networking issue. I know that phantomjs isn't casperjs, and casperjs isn't Qt, and Qt isn't webkit, but someone needs to do something about this and we gotta push it upstream if need be.

jart avatar Aug 22 '13 05:08 jart

@ariya - could you elaborate a little on the firewall changes that fixed this problem for you? We are seeing the same issue.

dirkhainc3 avatar Oct 22 '14 15:10 dirkhainc3

I just got this error when running svg2png. Never seen it before, running again to see if it happens again (unfortunately it happened at the end of a very very long heroku deploy, so I won't know for a while).

callumacrae avatar Apr 14 '15 17:04 callumacrae

Unfortunately, "pure virtual method called" is a very generic error message which could be coming from just about anywhere in millions of lines of code. There's an excellent chance that this is in fact several completely unrelated bugs that happen to trigger the same syndrome.

In order to have any chance at all of fixing this we are going to need a self-contained test case or at least a stack trace. If you can make the crash happen reliably, run phantomjs under a debugger with a breakpoint set on __cxa_pure_virtual and take a stack trace when it's hit. Please then file a NEW bug with that stack trace.

zackw avatar Apr 19 '15 20:04 zackw

I'm assuming that as I didn't comment back, it didn't happen again. I have seen it since, but rerunning the deploy usually fixes it, and it's never happens locally. I won't be able to provide a test case unless I work out a way of getting it to happen consistently—sorry!

callumacrae avatar Apr 19 '15 20:04 callumacrae

@callumacrae Sorry, that shouldn't have been aimed directly at you, it was a general observation. Anyhow, I appreciate your letting us know that it went away again for you.

zackw avatar Apr 19 '15 20:04 zackw

No worries, I didn't think it was! Thanks for your work on this project, it's a life-saver at work :smile:

callumacrae avatar Apr 19 '15 20:04 callumacrae

A further note for anyone who can make this happen: this error is supposed to trigger Breakpad and produce a crash dump. If you are in a mood to do some debugging, figuring out why that isn't happening would be very helpful both for your own problem and future bugs that have the same symptoms.

zackw avatar Apr 19 '15 20:04 zackw

I encountered the crash, using strace showed it happening when reading Roboto-Medium.ttf font file. This happened with other Roboto italic, Roboto-Thin and Roboto-Medium files too. When I changed the fonts to Roboto-Regular.ttf (defined earlier in the CSS?) it did not crash. Ubuntu 16.04 LTS, Phantomjs 2.1.1 from https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2

Last log was:

2017-08-09T11:54:04 [DEBUG] WebPage - updateLoading Progress: 90

Strace log here: phantomjs-roboto-italic.txt

Fonts from https://github.com/google/fonts/tree/724bf98e9f5cb98a1d3d5044f45a2e286b817401/apache/roboto

css file:

@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 300;
  src: local('Roboto Light'), local('Roboto-Light'), url('../fonts/Roboto-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  src: local('Roboto'), local('Roboto-Regular'), url('../fonts/Roboto-Regular.ttf') format('truetype'
);
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  src: local('Roboto Bold'), local('Roboto-Bold'), url('../fonts/Roboto-Bold.ttf') format('truetype')
;
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 300;
  src: local('Roboto Thin'), local('Roboto-Thin'), url('../fonts/Roboto-Thin.ttf') format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: italic;
  font-weight: 400;
  src: local('Roboto Medium'), local('Roboto-Medium'), url('../fonts/Roboto-Medium.ttf') format('truetype');
}

If I changed the last 2 fonts to the same as one of the first 3, there is no crash. If they are different, it crashes. Is there a limit on the number of fonts that can be loaded?

markabey avatar Aug 09 '17 12:08 markabey

Recompiling the 2.1.1 release myself on Xenial resolved the crashes with "pure virtual method called". Perhaps building and distributing from the debian wheezy compile isn't fully compatible.

markabey avatar Aug 10 '17 11:08 markabey