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

llvm-g++ crash compiling MySQL 5.2.27 #1399

Closed
tkremenek opened this issue Dec 1, 2006 · 6 comments
Closed

llvm-g++ crash compiling MySQL 5.2.27 #1399

tkremenek opened this issue Dec 1, 2006 · 6 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag

Comments

@tkremenek
Copy link
Contributor

Bugzilla Link 1027
Resolution FIXED
Resolved on Feb 22, 2010 12:55
Version trunk
OS All
Attachments preprocessed .i file exhibiting the bug

Extended Description

compiling set_var.cc in MySQL 5.2.27 triggers an internal compilation error:

make[4]: Nothing to be done for `all'.
if llvm-g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME=""/usr/local""
-DDATADIR=""/usr/local/var"" -DSHAREDIR=""/usr/local/share/mysql""
-DHAVE_CONFIG_H -I. -I. -I.. -I../innobase/include -I../include -I../include
-I../regex -I. -O3 -DDBUG_OFF -fno-implicit-templates -fno-exceptions
-fno-rtti -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ
-DIGNORE_SIGHUP_SIGQUIT -MT set_var.o -MD -MP -MF ".deps/set_var.Tpo" -c -o
set_var.o set_var.cc;
then mv -f ".deps/set_var.Tpo" ".deps/set_var.Po"; else rm -f
".deps/set_var.Tpo"; exit 1; fi
set_var.cc:3690: internal compiler error: in EmitLV_COMPONENT_REF, at
llvm-convert.cpp:4841
Please submit a full bug report,

Attached is the preprocessed .i file. compile with:

llvm-g++ -fno-implicit-templates -fno-exceptions -fno-rtti -c -o set_var.o
set_var.i

@tkremenek
Copy link
Contributor Author

assigned to @lattner

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 1, 2006

The code in question is:

// Check for variable sized array reference.
if (TREE_CODE(TREE_TYPE(Array)) == ARRAY_TYPE) {
tree Domain = TYPE_DOMAIN(TREE_TYPE(Array));
if (Domain && TYPE_MAX_VALUE(Domain)) {
assert(TREE_CODE(TYPE_MAX_VALUE(Domain)) == INTEGER_CST &&
"Cannot have globals with variable size!");
}
}

Does MySQL try to create a variable sized global array on that line?

@llvmbot
Copy link
Collaborator

llvmbot commented Dec 1, 2006

The MySQL source line complained about is:

template class List<set_var_base>;

Looks pretty much like a bug to me.

Reid.

@tkremenek
Copy link
Contributor Author

header file declaring template that triggers error
from set_var.cc:

/****************************************************************************

Used templates

****************************************************************************/

#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION

template class List<set_var_base>;

template class List_iterator_fast<set_var_base>; <--- LINE 3690

template class I_List_iterator<NAMED_LIST>;

#endif

List_iterator_fast is declared in "sql_list.h" (attached).

@lattner
Copy link
Collaborator

lattner commented Dec 1, 2006

Reduced testcase:

struct sys_var {
unsigned name_length;

bool no_support_one_shot;
sys_var() {}
};

struct sys_var_thd : public sys_var {
};

extern sys_var_thd sys_auto_is_null;
sys_var *sys_variables = &sys_auto_is_null;

@lattner
Copy link
Collaborator

lattner commented Dec 1, 2006

Fixed, testcase here: Regression/C++Frontend/2006-11-30-ConstantExprCrash.cpp

Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20061127/040515.html

Thanks Ted!

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla compile-fail Use [accepts-invalid] and [rejects-valid] instead llvm-tools All llvm tools that do not have corresponding tag
Projects
None yet
Development

No branches or pull requests

3 participants