Scodigo, Inc.

Log In | Register

Cart Items:
0

Crashes on Intel

i have a cf which does a http post and sends a user/pass. when i call the CF with the dec 9, 07 build FMP unexpectedly quits. fmpa 9v3, 10.4.11

here is the cf...

/*
NAME:
_PostURL

HISTORY:
Created: 07-APR-2007 by Micah Woods

PURPOSE:
To return the output of the requested URL (typically an HTML page).

PARAMETERS:
url; timeout ; post ; user ; pass

NOTES:
The default timeout is 30 seconds
application/xml
POSSIBLE ERRORS:

*/
Let (
[
// initialize CF vars
init = _SetCFError ( 0 ) & _SetCFLog ( EMPTY ) & _SetCFWarning ( 0 ) ;
$url = url ;
$timeout = If ( timeout <=0 ; 30 ; timeout ) ;
$user = user;
$pass = pass;
$post = post ;
phpCode =
"// get url and timeout values from FileMaker¶" &
"$url = fm_evaluate('$url');¶" &
"$timeout = fm_evaluate('$timeout');¶" &
"$user = fm_evaluate('$user');¶" &
"$pass = fm_evaluate('$pass');¶" &
"$post = fm_evaluate('$post');¶" &
"¶" &
"// create a new cURL resouce¶" &
"$ch = curl_init();¶" &
"¶" &
"// set header options¶" &
"$header[0] = \"Accept: application/xml\";¶" &
"$userpass = $user . \":\". $pass ;¶" &
"¶" &
"// set curl options¶" &
"$options = array(¶" &
" CURLOPT_URL => $url,¶" &
" CURLOPT_HTTPAUTH => CURLAUTH_BASIC,¶" &
" CURLOPT_USERPWD => $userpass, ¶" &
" CURLOPT_HTTPHEADER => $header,¶" &
" CURLOPT_HEADER => true,¶" &
" CURLOPT_RETURNTRANSFER => true,¶" &
" CURLOPT_CONNECTTIMEOUT => $timeout,¶" &
" CURLOPT_SSL_VERIFYPEER => false,¶" &
" CURLOPT_SSL_VERIFYHOST => false,¶" &
" CURLOPT_POST => true,¶" &
" CURLOPT_POSTFIELDS => $post¶" &
");¶" &
"curl_setopt_array($ch, $options);¶" &
"¶" &
"// get the url¶" &
"$response = curl_exec($ch);¶" &
"¶" &
"// get info for log¶" &
"$info = curl_getinfo($ch);¶" &
"// buffer output so that it's not returned¶" &
"ob_start();¶" &
"print_r($info);¶" &
"$log = ob_get_contents();¶" &
"// clear buffer¶" &
"ob_end_clean();¶" &
"// write to CF log¶" &
"$cfLog = fm_evaluate('_SetCFLog ( \"' . $log . '\" )');¶" &
"¶" &
"// check for error¶" &
"$error = curl_errno($ch);¶" &
"$errorMsg = curl_error($ch);¶" &
"¶" &
"// close cURL resource.¶" &
"curl_close($ch);¶" &
"¶" &
"if ($error) {¶" &
" $response = 'cURL error: (' . $error . ') ' . $errorMsg;¶" &
" // write to CF error¶" &
" $cfError = fm_evaluate('_SetCFError ( \"' . $error . '\" )');¶" &
"}¶" &
"¶" &
"echo $response;"
] ;
PHP_Execute( phpCode ; 0 ; $timeout )
)

ppc

fwiw - i changed fmp to use rosetta with the ppc plugin and the same function runs without error. i went back and tried the intel plugin from 2/07 and 4/22/07 and both of them crashed with the same CF call.

Strange

Micah Woods's picture

Hmmm, it works fine here running on Intel, same beta version of the plug-in.

Are you using a custom php.ini file?

If you go to Applications -> Utilities and open the Console app, we should be able to get some insight into what's going on by looking at the console log. Try opening the Console, clear it, then run the function in FMP that causes the crash. If you post the log info here or email it to me, we'll take a look.

Regards,
Micah

crash log

i emailed over the log file. i'm not using a custom php.ini file.