I have tracked down a segmentation fault in my drupal install to this module. I am running Drupal 5.2 with various modules. One of my content types had a link field with an optional title. Both nodes of that content type consistently caused a segmentation fault until I removed the link field from the content type.

I've attached a copy of the database where this is reproduceable. This attached copy was produced by phpMyAdmin's export feature. NOTE WELL: the database is really a .gz. I renamed it to end with .txt to get around a silly file upload extension restriction.

I am running an up-to-date copy of Ubuntu 7.04 server with all necessary components installed through aptitude, and my Drupal install is completely up to date (i.e., all modules and core are latest version) as of today--EXCEPT CCK data is 1.6 and not 1.6.1 in the attached file. Upgrading to 1.6.1 does not fix the problem.

CommentFileSizeAuthor
db.txt299.93 KBAren Cambre
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Aren Cambre’s picture

Title: Link module causes segmentation fault » Token module causes segmentation fault
Project: Link » Token
Version: 5.x-1.5 » 5.x-1.8

CORRECTION: this problem is being caused by the Token module. I noticed that Link can use Token. When I deactivate the Token module, the issue goes away.

Aren Cambre’s picture

Here's additional background info on what apparently caused the error for me: in the link field configuration for my content type, under Link Title I had Static Title selected, and in the box I typed [title]. I have since switched to No title, and the error is gone.

I case it matters, I do have Automatic nodetitles installed, but it's not used on that particular content type.

Aren Cambre’s picture

Another reason to implicate Token: I have basically the same site running on a commercial host. (The above stuff was done on a Ubuntu virtual machine running on my laptop.) While the trick of turning off the link field type title didn't stop a bunch of 500 errors, disabling the token module did.

I do not have access to the Apache error_log for this server, and PHP was not returning a usable error, so I am not sure I can provide much useful information for this web host.

Aren Cambre’s picture

CORRECTION: in the Link field, I have to not select Static title under Link Title and I have to not check Allow tokens. If either are not this way, I will get the segmentation fault on my local virtual machine or the 500 error on the web host.

Therefore, both the web host and the virtual machine are in fact consistent in how the problem surfaces.

It is my impression that even if Link happens to be incorrectly using Token, Token could still be at fault for failing to validate all input.

greggles’s picture

Can you copy/paste your segmentation fault message from the error logs?

Also, it might be helpful if you can do some debugging like a putting watchdog('line 123'); on progressive lines of the file and then see exactly where in the call stack the segmentation fault is happening.

Aren Cambre’s picture

Here's a typical segmentation fault message from the Apache error.log:
[Tue Aug 21 07:25:33 2007] [notice] child pid 10521 exit signal Segmentation fault (11)

As far as watchdog, is there no debugger with PHP? I really don't have time to debug code on a line-by-line analysis.

greggles’s picture

Status: Active » Postponed (maintainer needs more info)

Sure, you can use xdebug or zend or many other tools to debug php.

This problem hasn't been reported by anyone else and I haven't seen it myself. That means we either wait for someone else who experiences it and fixes it, or you do the debugging yourself using whatever tool you are most comfortable with. I suggested the watchdog() solution since it is a simple debugger available to anyone. xdebug and zend and the other tools can take some time to setup.

Anonymous’s picture

I've just had the same problem:

[Fri Aug 31 15:31:33 2007] [notice] child pid 10995 exit signal Segmentation fault (11)

I had been adding some links to the biography type so people can add links to their other online profiles. I removed all the links and the site's now working again. Not sure how I'm gonna get round this!

amanire’s picture

I've reproduced what appears to be the same problem that Aren Cambre describes: http://drupal.org/node/172126

When using a token in the CCK Link "Static Title" field, I get a blank screen as output when attempting to create the content type.

When using a token in the CCK Link "link" field, I get a blank screen as output after submitting the content type.

It would appear that these two modules do not play well together, which is danged shame since their relationship has serious potential. :-)

greggles’s picture

Perhaps this is caused by the recursive problem in token. Can those of you experiencing this try a dev build (which includes that patch) and report back if you are still having the problem?

Thanks.

amanire’s picture

Upon further review, I'm not experiencing a segmentation fault, but a blank screen. I don't see anything in the Apache error log or Drupal watchdog that corresponds to it.

amanire’s picture

greggles,
Yes, that fixed the problem that I was having. I can't confirm it as a fix for the segmentation fault, though. Thanks!

Anonymous’s picture

Just downloaded the dev release of token and it's all working great now - thanks! No more segmentation fault here!

fyi - before, it broke as soon as I entered one link, which had a static title; and I wasn't allowing tokens to be used on any of the fields.

Aren Cambre’s picture

Upgrading token to dev fixed it for me on my ubuntu VM.

greggles’s picture

Status: Postponed (maintainer needs more info) » Fixed

Great news. Just updating status.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.