Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDF who use ib_util_malloc crash the Server on a Linux system windows will work [CORE2809] #3197

Closed
firebird-automations opened this issue Jan 14, 2010 · 5 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Sascha Michel (datiscum1)

In the Linux version all function that use ib_util_malloc will crash the
server.

Example: This code in the UDF, I use from Firebird 1.5 to 2.1 without
any problems under Linux and Windows. In2.5RC1 only Linux will Crash

static ISC_TIMESTAMP * gen_ib_date (struct tm *);
static ISC_TIMESTAMP * gen_ib_date (struct tm *t)
{
ISC_TIMESTAMP *ibd = (ISC_TIMESTAMP *) ib_util_malloc (sizeof(ISC_TIMESTAMP));
isc_encode_date(t, ibd);
return ibd;
}

ISC_TIMESTAMP * EXPORT Zeit_NULLEN(ib_date)
ISC_TIMESTAMP *ib_date;
{
struct tm t;
isc_decode_date(ib_date, &t);

t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_isdst = 0;

return gen_ib_date(&t);

}

@firebird-automations
Copy link
Collaborator Author

Modified by: Sascha Michel (datiscum1)

description: In the Linux version all function that use ib_util_malloc will crash the
server.

Example: This code in the UDF, I use from Firebird 1.5 to 2.1 without
any problems under Linux and Windows. In2.5RC1 only Linux will Crash

static ISC_TIMESTAMP * gen_ib_date (struct tm *);
static ISC_TIMESTAMP * gen_ib_date (struct tm *t)
{
ISC_QUAD *ibd = (ISC_TIMESTAMP *) ib_util_malloc (sizeof(ISC_QUAD));
isc_encode_date(t, ibd);
return ibd;
}

ISC_TIMESTAMP * EXPORT Zeit_NULLEN(ib_date)
ISC_TIMESTAMP *ib_date;
{
struct tm t;
isc_decode_date(ib_date, &t);

t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_isdst = 0;

return gen_ib_date(&t);

}

=>

In the Linux version all function that use ib_util_malloc will crash the
server.

Example: This code in the UDF, I use from Firebird 1.5 to 2.1 without
any problems under Linux and Windows. In2.5RC1 only Linux will Crash

static ISC_TIMESTAMP * gen_ib_date (struct tm *);
static ISC_TIMESTAMP * gen_ib_date (struct tm *t)
{
ISC_TIMESTAMP *ibd = (ISC_TIMESTAMP *) ib_util_malloc (sizeof(ISC_TIMESTAMP));
isc_encode_date(t, ibd);
return ibd;
}

ISC_TIMESTAMP * EXPORT Zeit_NULLEN(ib_date)
ISC_TIMESTAMP *ib_date;
{
struct tm t;
isc_decode_date(ib_date, &t);

t.tm_sec = 0;
t.tm_min = 0;
t.tm_hour = 0;
t.tm_isdst = 0;

return gen_ib_date(&t);

}

@firebird-automations
Copy link
Collaborator Author

Commented by: Sascha Michel (datiscum1)

#⁠include "ib_util.h"

was missing in my UDF :-(

Now all works fine.
Now under 64Bit

Sorry,
Sascha

Please close

@firebird-automations
Copy link
Collaborator Author

Modified by: Sascha Michel (datiscum1)

priority: Critical [ 2 ] => Trivial [ 5 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant